@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&display=swap");

:root{
  --bg:#0b1220;
  --card:#111a2b;
  --muted:#94a3b8;
  --text:#e2e8f0;
  --accent:#22c55e;
  --danger:#ef4444;
  --border:rgba(148,163,184,.18);
  --shadow: 0 18px 45px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 10% 0%, rgba(34,197,94,.16), transparent 55%),
              radial-gradient(900px 700px at 100% 20%, rgba(59,130,246,.14), transparent 50%),
              var(--bg);
  color:var(--text);
}

body.theme-light{
  --bg:#f6f8fb;
  --card:#ffffff;
  --muted:#5c6b80;
  --text:#0f172a;
  --accent:#2563eb;
  --danger:#ef4444;
  --border:#d5dde9;
  --shadow: 0 18px 40px rgba(15,23,42,.12);
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(37,99,235,.14), transparent 60%),
    radial-gradient(900px 700px at 100% 0%, rgba(14,165,164,.16), transparent 55%),
    linear-gradient(180deg, #f6f8fb 0%, #e7edf6 100%);
  color: var(--text);
}

body.theme-light .topbar{
  background: rgba(255,255,255,.92);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
body.theme-light .brand p{ color: var(--muted); }
body.theme-light .btn{
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
body.theme-light .btn:hover{
  background: #e6edf7;
}
body.theme-light .btn.primary{
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  border-color: transparent;
  color: #ffffff;
}
body.theme-light .btn.primary:hover{
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}
body.theme-light .btn.danger{
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.35);
  color: #b91c1c;
}
body.theme-light .btn.danger:hover{
  background: rgba(239,68,68,.18);
}
body.theme-light .card{
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
body.theme-light label{ color: var(--muted); }
body.theme-light input[type="text"],
body.theme-light input[type="email"],
body.theme-light input[type="password"],
body.theme-light input[type="url"],
body.theme-light input[type="search"],
body.theme-light select,
body.theme-light textarea{
  background: #f4f7fb;
  color: var(--text);
  border-color: var(--border);
}
body.theme-light .theme-toggle{
  background: #f4f7fb;
  border-color: var(--border);
}
body.theme-light .theme-toggle .theme-track{
  background: #e2e8f0;
  border-color: #cbd5f5;
  color: #64748b;
}
body.theme-light .theme-toggle .theme-track::before{
  background: #ffffff;
  box-shadow: 0 4px 8px rgba(15,23,42,.12);
}
body.theme-light .theme-toggle input:checked + .theme-track{
  background: #0f172a;
  border-color: #0f172a;
  color: #e2e8f0;
}
body.theme-light .theme-toggle input:checked + .theme-track::before{
  background: #f8fafc;
}

/* Light theme fixes for dark-styled components (non-email pages). */
body.theme-light:not(.email-ui) .stat,
body.theme-light:not(.email-ui) .metric-card,
body.theme-light:not(.email-ui) .metric-compact,
body.theme-light:not(.email-ui) .metrics-item,
body.theme-light:not(.email-ui) .metrics-panel,
body.theme-light:not(.email-ui) .metrics-user-row,
body.theme-light:not(.email-ui) .metrics-insight{
  background: #ffffff;
  border-color: #d5dde9;
  box-shadow: none;
}
body.theme-light:not(.email-ui) .stat .s,
body.theme-light:not(.email-ui) .metric-kpi,
body.theme-light:not(.email-ui) .metric-title,
body.theme-light:not(.email-ui) .metrics-panel h3,
body.theme-light:not(.email-ui) .metrics-user-meta,
body.theme-light:not(.email-ui) .metrics-insight span,
body.theme-light:not(.email-ui) .metrics-sub,
body.theme-light:not(.email-ui) .metrics-empty{
  color: #64748b;
}
body.theme-light:not(.email-ui) .stat .v,
body.theme-light:not(.email-ui) .metric-value,
body.theme-light:not(.email-ui) .metrics-value,
body.theme-light:not(.email-ui) .metrics-user-name,
body.theme-light:not(.email-ui) .metrics-insight strong{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .metrics-range{
  background: #f1f5f9;
  border-color: #d5dde9;
  color: #334155;
  box-shadow: none;
}
body.theme-light:not(.email-ui) .metrics-range label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .segmented{
  background: #f1f5f9;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .segmented button{
  color: #64748b;
}
body.theme-light:not(.email-ui) .segmented button:hover{
  color: #0f172a;
  background: #e2e8f0;
}
body.theme-light:not(.email-ui) .segmented button.active{
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(37,99,235,.18);
}
body.theme-light:not(.email-ui) .table-wrap{
  background: #ffffff;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) table{
  background: #ffffff;
}
body.theme-light:not(.email-ui) th{
  background: #f1f5f9;
  color: #475569;
}
body.theme-light:not(.email-ui) td{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .chart-wrap{
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light:not(.email-ui) .legend-item,
body.theme-light:not(.email-ui) .chip,
body.theme-light:not(.email-ui) .badge,
body.theme-light:not(.email-ui) .pill,
body.theme-light:not(.email-ui) .metrics-chip{
  background: #f1f5f9;
  border-color: #d5dde9;
  color: #334155;
}
body.theme-light:not(.email-ui) .chip-count{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}
body.theme-light:not(.email-ui) .pill.ok,
body.theme-light:not(.email-ui) .metrics-chip.ok,
body.theme-light:not(.email-ui) .chip.ok{
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
body.theme-light:not(.email-ui) .pill.warn{
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
body.theme-light:not(.email-ui) .pill.neutral{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light:not(.email-ui) .chip.new{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .chip.muted{
  color: #64748b;
}
body.theme-light:not(.email-ui) .tag{
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
body.theme-light:not(.email-ui) .tag.ok{
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
body.theme-light:not(.email-ui) .tag.warn{
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
body.theme-light:not(.email-ui) .tag.danger{
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
body.theme-light:not(.email-ui) .mini-stat{
  background: #f8fafc;
  border-color: #d5dde9;
  box-shadow: none;
}
body.theme-light:not(.email-ui) .mini-label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .mini-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .helper,
body.theme-light:not(.email-ui) .helper-details,
body.theme-light:not(.email-ui) .helper-note{
  background: #f1f5f9;
  border-color: #d5dde9;
  color: #475569;
}
body.theme-light:not(.email-ui) .helper-details summary{
  color: #334155;
}
body.theme-light:not(.email-ui) .helper-details summary::after{
  color: #94a3b8;
}
body.theme-light:not(.email-ui) .helper-code{
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
body.theme-light:not(.email-ui) .toggle-row{
  background: #f8fafc;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .toggle-text{
  color: #334155;
}
body.theme-light:not(.email-ui) .toggle-slider{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #94a3b8;
}
body.theme-light:not(.email-ui) .toggle-slider::before{
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15,23,42,.12);
}
body.theme-light:not(.email-ui) .toggle-switch input:checked + .toggle-slider{
  background: #bbf7d0;
  border-color: #86efac;
  color: #166534;
}
body.theme-light:not(.email-ui) .toggle-switch input:checked + .toggle-slider .toggle-on{
  color: #166534;
}
body.theme-light:not(.email-ui) .toggle-switch input:not(:checked) + .toggle-slider .toggle-off{
  color: #475569;
}
body.theme-light:not(.email-ui) .pdf-preview{
  background: #f8fafc;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) input[type="date"].date-input{
  background: #f8fafc;
  border-color: #d5dde9;
  color: #0f172a;
  box-shadow: none;
}
body.theme-light:not(.email-ui) input[type="date"].date-input::-webkit-calendar-picker-indicator{
  filter: none;
}
body.theme-light:not(.email-ui) .pager-select{
  background: #f8fafc;
  border-color: #d5dde9;
  color: #0f172a;
}

body.theme-light:not(.email-ui) .summary-tile,
body.theme-light:not(.email-ui) .summary-chart,
body.theme-light:not(.email-ui) .summary-panel,
body.theme-light:not(.email-ui) .forecast-panel,
body.theme-light:not(.email-ui) .summary-meta-card,
body.theme-light:not(.email-ui) .status-detail,
body.theme-light:not(.email-ui) .status-metric{
  background: #ffffff;
  border-color: #d5dde9;
  box-shadow: none;
}
body.theme-light:not(.email-ui) .summary-item{
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light:not(.email-ui) .summary-tile::before,
body.theme-light:not(.email-ui) .summary-chart::before,
body.theme-light:not(.email-ui) .forecast-panel::before,
body.theme-light:not(.email-ui) .summary-meta-card::before{
  background: radial-gradient(circle, rgba(37,99,235,.12), transparent 65%);
  opacity: .8;
}
body.theme-light:not(.email-ui) .summary-label,
body.theme-light:not(.email-ui) .summary-sub,
body.theme-light:not(.email-ui) .chart-stat-label,
body.theme-light:not(.email-ui) .summary-item-meta,
body.theme-light:not(.email-ui) .summary-meta-label,
body.theme-light:not(.email-ui) .status-detail-title,
body.theme-light:not(.email-ui) .status-label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .summary-value,
body.theme-light:not(.email-ui) .chart-stat-value,
body.theme-light:not(.email-ui) .summary-meta-value,
body.theme-light:not(.email-ui) .summary-item-title{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .summary-item-title a,
body.theme-light:not(.email-ui) .summary-item-link{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .summary-item-title a:hover,
body.theme-light:not(.email-ui) .summary-item-link:hover{
  color: #2563eb;
}
body.theme-light:not(.email-ui) .summary-panel h3{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .summary-divider{
  background: #e2e8f0;
}
body.theme-light:not(.email-ui) .summary-note{
  background: #f1f5f9;
  border-color: #d5dde9;
  color: #475569;
}
body.theme-light:not(.email-ui) .summary-note::before{
  color: #94a3b8;
}
body.theme-light:not(.email-ui) .summary-chip{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light:not(.email-ui) .summary-chip.to{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .summary-chip.sent{
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
body.theme-light:not(.email-ui) .summary-link-pill{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .summary-meta-card.to{
  background: #eff6ff;
  border-color: #bfdbfe;
}
body.theme-light:not(.email-ui) .summary-meta-card.sent{
  background: #ecfdf3;
  border-color: #bbf7d0;
}
body.theme-light:not(.email-ui) .status-badge{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light:not(.email-ui) .status-badge.completed{
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
body.theme-light:not(.email-ui) .status-details{
  border-top-color: #e2e8f0;
}
body.theme-light:not(.email-ui) .status-details summary{
  color: #334155;
}
body.theme-light:not(.email-ui) .status-toggle{
  background: #f1f5f9;
  border-color: #d5dde9;
  color: #334155;
}
body.theme-light:not(.email-ui) .status-value{
  color: #334155;
}
body.theme-light:not(.email-ui) .status-project-title{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .status-detail{
  background: #f8fafc;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) tr.status-detail-row.is-completed .status-detail{
  background: #ecfdf3;
  border-color: #86efac;
}
body.theme-light:not(.email-ui) .status-metric .status-label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .status-metric .status-value{
  color: #0f172a;
}

body.theme-light:not(.email-ui) .summary-chart,
body.theme-light:not(.email-ui) .forecast-item{
  background: #ffffff;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .forecast-item{
  box-shadow: none;
}
body.theme-light:not(.email-ui) .forecast-item:hover{
  border-color: #93c5fd;
  box-shadow: 0 12px 24px rgba(37,99,235,.14);
}
body.theme-light:not(.email-ui) .forecast-item.is-peak{
  border-color: #60a5fa;
  box-shadow: 0 14px 26px rgba(37,99,235,.18);
}
body.theme-light:not(.email-ui) .forecast-item::before{
  background: radial-gradient(circle, rgba(37,99,235,.12), transparent 60%);
}
body.theme-light:not(.email-ui) .forecast-label,
body.theme-light:not(.email-ui) .forecast-meta{
  color: #64748b;
}
body.theme-light:not(.email-ui) .forecast-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .forecast-bar{
  background: #e2e8f0;
}
body.theme-light:not(.email-ui) .filter-group{
  background: #f8fafc;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .filter-label{
  color: #334155;
}
body.theme-light:not(.email-ui) .filter-label.has-icon::before{
  opacity: .85;
}
body.theme-light:not(.email-ui) .filter-hint{
  color: #475569;
}
body.theme-light:not(.email-ui) .rate-fee-main{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .rate-fee-sub{
  color: #475569;
}
body.theme-light:not(.email-ui) .status-label{
  color: #334155;
}
body.theme-light:not(.email-ui) .status-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .chart-ring{
  --chart-corp: #2563eb;
  --chart-lit: #ef4444;
}
body.theme-light:not(.email-ui) .chart-dot.corp{ background: #2563eb; }
body.theme-light:not(.email-ui) .chart-dot.lit{ background: #ef4444; }
body.theme-light:not(.email-ui) .chart-dot.hourly{ background: #0ea5e9; }
body.theme-light:not(.email-ui) .chart-dot.fixed{ background: #22c55e; }
body.theme-light:not(.email-ui) .chart-dot.milestone{ background: #f59e0b; }
body.theme-light:not(.email-ui) .chart-dot.adhoc{ background: #14b8a6; }
body.theme-light:not(.email-ui) .chart-bar-fill.corp{ background: #2563eb; }
body.theme-light:not(.email-ui) .chart-bar-fill.lit{ background: #ef4444; }
body.theme-light:not(.email-ui) .chart-bar-fill.hourly{ background: #0ea5e9; }
body.theme-light:not(.email-ui) .chart-bar-fill.fixed{ background: #22c55e; }
body.theme-light:not(.email-ui) .chart-bar-fill.milestone{ background: #f59e0b; }
body.theme-light:not(.email-ui) .chart-bar-fill.adhoc{ background: #14b8a6; }
body.theme-light:not(.email-ui) .forecast-chip{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light:not(.email-ui) .forecast-chip.peak{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

body.theme-light:not(.email-ui) .chart-sub,
body.theme-light:not(.email-ui) .chart-center-label,
body.theme-light:not(.email-ui) .chart-percent{
  color: #475569;
}
body.theme-light:not(.email-ui) .chart-empty{
  color: #64748b;
}
body.theme-light:not(.email-ui) .chart-center-value,
body.theme-light:not(.email-ui) .chart-label,
body.theme-light:not(.email-ui) .chart-count{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .chart-ring .chart-center-label{
  color: #e2e8f0;
}
body.theme-light:not(.email-ui) .chart-ring .chart-center-value{
  color: #ffffff;
}
body.theme-light:not(.email-ui) .chart-ring.is-empty{
  background: #e2e8f0;
}
body.theme-light:not(.email-ui) .chart-bar{
  background: #e2e8f0;
}

body.theme-light:not(.email-ui) .payment-label{
  color: #334155;
}
body.theme-light:not(.email-ui) .payment-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .payment-sub{
  color: #475569;
}

body.theme-light:not(.email-ui) .payment-chip,
body.theme-light:not(.email-ui) .recent-chip,
body.theme-light:not(.email-ui) .milestone-chip{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light:not(.email-ui) .payment-chip.ok,
body.theme-light:not(.email-ui) .recent-chip.ok{
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
body.theme-light:not(.email-ui) .payment-chip.warn{
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}
body.theme-light:not(.email-ui) .payment-chip.info,
body.theme-light:not(.email-ui) .recent-chip.info{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

body.theme-light:not(.email-ui) .profile-card{
  background: #ffffff;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .profile-card::before,
body.theme-light:not(.email-ui) .profile-card::after{
  background: radial-gradient(circle, rgba(37,99,235,.12), transparent 60%);
}
body.theme-light:not(.email-ui) .profile-watermark{
  opacity: .16;
  filter: grayscale(1) brightness(.9) contrast(1.1) drop-shadow(0 8px 18px rgba(15,23,42,.12));
}
body.theme-light:not(.email-ui) .profile-kicker{
  color: #64748b;
}
body.theme-light:not(.email-ui) .profile-title,
body.theme-light:not(.email-ui) .profile-sub,
body.theme-light:not(.email-ui) .profile-meta{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .photo-frame{
  background: #f8fafc;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .photo-fallback{
  color: #334155;
}
body.theme-light:not(.email-ui) .profile-info{
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light:not(.email-ui) .profile-info .info-label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .profile-info .info-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .profile-actions .btn{
  background: #ffffff;
  border-color: #d5dde9;
}

body.theme-light:not(.email-ui) .calendar{
  background: #f8fafc;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .calendar-head{
  color: #334155;
}
body.theme-light:not(.email-ui) .calendar-cell{
  background: #e2e8f0;
  color: #334155;
}
body.theme-light:not(.email-ui) .calendar-cell.muted{
  background: #f1f5f9;
  color: #94a3b8;
}
body.theme-light:not(.email-ui) .calendar-cell.is-today{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .calendar-weekday{
  color: #64748b;
}

body.theme-light:not(.email-ui) .quick-item,
body.theme-light:not(.email-ui) .stat-tile{
  background: #ffffff;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .quick-label,
body.theme-light:not(.email-ui) .stat-label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .quick-value,
body.theme-light:not(.email-ui) .stat-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .quick-help,
body.theme-light:not(.email-ui) .stat-sub{
  color: #64748b;
}

body.theme-light:not(.email-ui) .progress,
body.theme-light:not(.email-ui) .bar-track{
  background: #e2e8f0;
}
body.theme-light:not(.email-ui) .bar-label{
  color: #1f2937;
}
body.theme-light:not(.email-ui) .bar-value{
  color: #475569;
}
body.theme-light:not(.email-ui) .category-bar{
  background: repeating-linear-gradient(
    90deg,
    #e2e8f0 0,
    #e2e8f0 1px,
    transparent 1px,
    transparent 10px
  );
}
body.theme-light:not(.email-ui) .category-label{
  color: #334155;
}
body.theme-light:not(.email-ui) .category-value{
  color: #1f2937;
}

body.theme-light:not(.email-ui) .list-item{
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.theme-light:not(.email-ui) .list-title{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .list-meta{
  color: #64748b;
}
body.theme-light:not(.email-ui) .invoice-alert{
  background: #ffffff;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .invoice-alert-title{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .invoice-alert-count{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
}
body.theme-light:not(.email-ui) .invoice-alert-list .list-item{
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
}
body.theme-light:not(.email-ui) .invoice-alert-list .list-meta{
  color: #64748b;
}

body.theme-light:not(.email-ui) .forecast-chip{
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}
body.theme-light:not(.email-ui) .forecast-chip.peak{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .forecast-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .forecast-meta{
  color: #64748b;
}
body.theme-light:not(.email-ui) .forecast-bar{
  background: #e2e8f0;
}

a{ color:inherit; text-decoration:none; }
small{ color:var(--muted); }

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 14px;
  border:1px solid var(--border);
  border-radius: 18px;
  background: rgba(17,26,43,.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand-badge{
  width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;
  background: rgba(34,197,94,.14);
  border:1px solid rgba(34,197,94,.25);
  font-weight:800;
}
.brand h1{
  margin:0;
  font-size: 16px;
  letter-spacing:.3px;
}
.brand p{ margin:0; color:var(--muted); font-size:12px; }

.nav-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
  white-space: nowrap;
}

.btn.icon-btn{
  padding: 4px 8px;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  justify-content: center;
}
.btn.icon-btn .btn-icon{
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.icon-btn .btn-icon svg{
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-btn{
  padding: 3px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
}
.profile-thumb{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.28);
}
.profile-thumb.is-logo{
  padding: 4px;
  object-fit: contain;
  background: rgba(148,163,184,.18);
}

.inbox-menu,
.email-menu{
  position: relative;
  display: inline-flex;
  align-items: center;
}
.inbox-btn.icon-btn{
  padding-right: 8px;
}
.chat-btn.icon-btn,
.email-btn.icon-btn{
  padding-right: 8px;
  min-width: 38px;
  width: 38px;
  flex-shrink: 0;
}

.inbox-popover{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  background: rgba(17,26,43,.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 120;
  display: none;
  overflow: hidden;
}
.inbox-popover.is-open{
  display: block;
}
.inbox-popover-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.inbox-popover-title{
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.inbox-popover-action{
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.inbox-popover-action:disabled{
  opacity: .6;
  cursor: not-allowed;
}
.inbox-popover-list{
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
}
.inbox-popover-empty{
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(148,163,184,.35);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.inbox-popover-foot{
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.inbox-popover-link{
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.inbox-popover .list-item{
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(2,6,23,.45);
  display: grid;
  gap: 6px;
}
.inbox-popover .notif-head{
  gap: 10px;
}
.inbox-popover .notif-icon{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 11px;
}
.inbox-popover .notif-title{
  font-size: 12px;
}
.inbox-popover .notif-time{
  font-size: 10px;
}
.inbox-popover .notif-desc{
  font-size: 11px;
  margin-top: 6px;
  -webkit-line-clamp: 2;
}
.email-popover-heading{
  display: grid;
  gap: 3px;
  min-width: 0;
}
.email-popover-sub{
  font-size: 11px;
  color: var(--muted);
}
.email-popover-meta{
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
  flex: 1 1 180px;
}
.email-popover-item{
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 14px;
  padding: 11px 12px;
  background: linear-gradient(150deg, rgba(2,6,23,.5), rgba(15,23,42,.34));
  display: grid;
  gap: 7px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
  min-width: 0;
  overflow: hidden;
}
.email-popover-item:hover{
  transform: translateY(-1px);
  border-color: rgba(45,212,191,.34);
  background: linear-gradient(150deg, rgba(13,148,136,.2), rgba(15,23,42,.44));
  box-shadow: 0 12px 20px rgba(2,6,23,.22);
}
.email-popover-item.is-unread{
  border-color: rgba(45,212,191,.42);
  box-shadow: 0 14px 24px rgba(13,148,136,.14);
}
.email-popover-item-head,
.email-popover-subject-row{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: start;
  column-gap: 8px;
  row-gap: 6px;
  min-width: 0;
}
.email-popover-sender,
.email-popover-subject{
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}
.email-popover-sender{
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  -webkit-line-clamp: 2;
}
.email-popover-time{
  margin-left: 0;
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  align-self: start;
}
.email-popover-subject{
  font-size: 12px;
  font-weight: 700;
  color: rgba(226,232,240,.96);
  line-height: 1.4;
  -webkit-line-clamp: 2;
}
.email-popover-thread{
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(45,212,191,.28);
  background: rgba(20,184,166,.14);
  color: #99f6e4;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  justify-self: end;
  align-self: start;
}
.email-popover-preview{
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.profile-menu{
  position: relative;
  display: inline-flex;
  align-items: center;
}
.profile-popover{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, 92vw);
  background: linear-gradient(160deg, rgba(15,23,42,.96), rgba(2,6,23,.92));
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(2,6,23,.45);
  z-index: 120;
  display: none;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(140%);
  font-family: "Sora", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
.profile-popover::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(220px 120px at 20% -10%, rgba(56,189,248,.18), transparent 70%),
    radial-gradient(240px 140px at 90% 0%, rgba(34,197,94,.16), transparent 70%);
  opacity: .85;
  pointer-events: none;
}
.profile-popover.is-open{
  display: block;
}
.profile-popover-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
  background: rgba(2,6,23,.35);
}
.profile-popover-title{
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.profile-popover-link{
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.profile-popover-body{
  padding: 14px;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.profile-summary{
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.42);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.profile-avatar{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.28);
  background: linear-gradient(135deg, rgba(148,163,184,.25), rgba(15,23,42,.55));
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(2,6,23,.35), inset 0 0 0 1px rgba(255,255,255,.08);
}
.profile-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-fallback{
  font-size: 13px;
  font-weight: 800;
  color: rgba(226,232,240,.9);
}
.profile-name{
  font-size: 13.5px;
  font-weight: 800;
  color: rgba(226,232,240,.98);
}
.profile-role,
.profile-position,
.profile-email{
  font-size: 11.5px;
  color: var(--muted);
}
.profile-popover .profile-meta-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.profile-popover .profile-meta{
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.2);
  background: linear-gradient(150deg, rgba(2,6,23,.4), rgba(15,23,42,.55));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  display: grid;
  gap: 4px;
  align-items: start;
  margin: 0;
}
.profile-popover .profile-meta span{
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: rgba(148,163,184,.85);
  margin-bottom: 4px;
}
.profile-popover .profile-meta strong{
  font-size: 12.5px;
  color: rgba(226,232,240,.95);
}
.profile-links{
  border-top: 1px solid rgba(148,163,184,.25);
  padding-top: 10px;
  display: grid;
  gap: 6px;
}
.profile-links-title{
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 0 4px;
}
.profile-link{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.2);
  background: rgba(148,163,184,.08);
  color: var(--text);
  transition: background .2s ease;
}
.profile-link svg{
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-link:hover{
  background: rgba(148,163,184,.18);
}
.profile-popover-foot{
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.profile-popover-foot .btn{
  width: 100%;
  justify-content: center;
}

body.theme-light .profile-thumb{
  border-color: #d5dde9;
  background: #f1f5f9;
}
body.theme-light .profile-thumb.is-logo{
  background: #ffffff;
}
body.theme-light .profile-popover{
  background: linear-gradient(160deg, #ffffff, #f7f9fc);
  border-color: #d5dde9;
  box-shadow: 0 20px 40px rgba(15,23,42,.12);
  backdrop-filter: blur(10px) saturate(140%);
}
body.theme-light .profile-popover::before{
  background:
    radial-gradient(240px 140px at 10% -20%, rgba(59,130,246,.12), transparent 70%),
    radial-gradient(240px 140px at 90% 0%, rgba(14,165,164,.12), transparent 70%);
}
body.theme-light .profile-popover-head{
  border-color: #e2e8f0;
  background: rgba(248,250,252,.85);
}
body.theme-light .profile-popover-link{
  color: #2563eb;
}
body.theme-light .profile-avatar{
  border-color: #d5dde9;
  background: linear-gradient(135deg, #eef2f7, #ffffff);
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
}
body.theme-light .profile-avatar-fallback{
  color: #334155;
}
body.theme-light .profile-name{
  color: #0f172a;
}
body.theme-light .profile-role,
body.theme-light .profile-position,
body.theme-light .profile-email{
  color: #64748b;
}
body.theme-light .profile-summary{
  border-color: #e2e8f0;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.03);
}
body.theme-light .profile-popover .profile-meta{
  border-color: #e2e8f0;
  background: linear-gradient(150deg, #f8fafc, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.03);
}
body.theme-light .profile-popover .profile-meta strong{
  color: #0f172a;
}
body.theme-light .profile-links{
  border-color: #e2e8f0;
}
body.theme-light .profile-link{
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #0f172a;
}
body.theme-light .profile-link:hover{
  background: #e2e8f0;
}
body.theme-light .profile-popover-foot{
  border-color: #e2e8f0;
}
body.theme-light .inbox-popover{
  background: #ffffff;
  border-color: #d5dde9;
  box-shadow: 0 18px 40px rgba(15,23,42,.12);
}
body.theme-light .inbox-popover-head{
  border-color: #e2e8f0;
}
body.theme-light .inbox-popover-action{
  color: #2563eb;
}
body.theme-light .inbox-popover-empty{
  border-color: #d5dde9;
  color: #64748b;
}
body.theme-light .inbox-popover-foot{
  border-color: #e2e8f0;
}
body.theme-light .inbox-popover-link{
  color: #2563eb;
}
body.theme-light .inbox-popover .list-item{
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light .inbox-popover .notif-title{
  color: #0f172a;
}
body.theme-light .inbox-popover .notif-time{
  color: #64748b;
}
body.theme-light .inbox-popover .notif-desc{
  border-color: #d5dde9;
  background: #f1f5f9;
  color: #334155;
}
body.theme-light .email-popover-sub,
body.theme-light .email-popover-meta,
body.theme-light .email-popover-time,
body.theme-light .email-popover-preview{
  color: #64748b;
}
body.theme-light .email-popover-item{
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}
body.theme-light .email-popover-item:hover{
  border-color: rgba(20,184,166,.35);
  background: linear-gradient(150deg, #f0fdfa, #ffffff);
  box-shadow: 0 14px 24px rgba(13,148,136,.1);
}
body.theme-light .email-popover-item.is-unread{
  border-color: rgba(20,184,166,.42);
  background: linear-gradient(150deg, #ecfeff, #f8fafc);
}
body.theme-light .email-popover-sender,
body.theme-light .email-popover-subject{
  color: #0f172a;
}
body.theme-light .email-popover-thread{
  color: #0f766e;
  background: rgba(204,251,241,.92);
  border-color: rgba(45,212,191,.42);
}
body.theme-light .inbox-badge{
  color: #475569;
  background: #e2e8f0;
  border-color: #cbd5e1;
  text-shadow: none;
  box-shadow: none;
}
body.theme-light .inbox-badge.is-empty{
  color: #64748b;
  background: #edf2f7;
  border-color: #d5dde9;
}

.theme-toggle{
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: 32px;
  padding: 3px;
  margin-top: 6px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.3);
  background: rgba(2,6,23,.25);
  color: rgba(226,232,240,.85);
  cursor: pointer;
  user-select: none;
  line-height: 1;
}
.theme-toggle input{
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-toggle .theme-track{
  position: relative;
  width: 54px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(148,163,184,.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  color: rgba(226,232,240,.6);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.theme-toggle .theme-track::before{
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 3px;
  border-radius: 999px;
  background: #e2e8f0;
  box-shadow: 0 4px 8px rgba(0,0,0,.35);
  transform: translateY(-50%);
  transition: transform .2s ease, background .2s ease;
}
.theme-toggle .theme-icon{
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  color: currentColor;
  opacity: .85;
  transition: opacity .2s ease, color .2s ease;
}
.theme-toggle .theme-icon svg{
  width: 14px;
  height: 14px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}
.theme-toggle input:checked + .theme-track{
  background: rgba(59,130,246,.55);
  border-color: rgba(59,130,246,.75);
  color: #0f172a;
}
.theme-toggle input:checked + .theme-track::before{
  transform: translate(26px, -50%);
  background: #bfdbfe;
}
.theme-toggle input:checked + .theme-track .theme-icon--sun{
  opacity: .35;
}
.theme-toggle input:not(:checked) + .theme-track .theme-icon--moon{
  opacity: .35;
}

.inbox-btn,
.chat-btn,
.email-btn{
  position: relative;
  padding-right: 30px;
  overflow: visible;
}
.inbox-badge{
  display: inline-flex;
  position: absolute;
  top: 2px;
  right: 4px;
  transform: translate(45%, -45%);
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .3px;
  color: rgba(226,232,240,.75);
  background: rgba(148,163,184,.18);
  box-shadow: none;
  border: 1px solid rgba(148,163,184,.35);
  text-shadow: none;
}
.inbox-badge.is-visible{
  color: #fff7ed;
  background: linear-gradient(135deg, #f97316 0%, #f43f5e 55%, #8b5cf6 100%);
  box-shadow: 0 12px 24px rgba(244,63,94,.35), 0 4px 10px rgba(15,23,42,.25);
  border: 1px solid rgba(255,255,255,.45);
  text-shadow: 0 1px 2px rgba(15,23,42,.35);
}
.inbox-badge.is-visible::before{
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(244,63,94,.35);
  opacity: .55;
}
.inbox-badge.is-visible::after{
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  right: 4px;
  height: 40%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0));
  opacity: .65;
  pointer-events: none;
}
.inbox-badge.is-visible::before{
  animation: inboxRing 1.8s ease-out infinite;
}
.inbox-badge.is-empty{
  color: rgba(226,232,240,.75);
  background: rgba(148,163,184,.12);
  border-color: rgba(148,163,184,.3);
}
.chat-badge.is-empty{
  color: rgba(191,219,254,.95);
  background: rgba(37,99,235,.18);
  border-color: rgba(96,165,250,.38);
}
.email-badge.is-empty{
  color: rgba(153,246,228,.98);
  background: rgba(13,148,136,.18);
  border-color: rgba(45,212,191,.36);
}
.inbox-btn.has-unread,
.chat-btn.has-unread,
.email-btn.has-unread{
  border-color: rgba(244,63,94,.45);
  background: linear-gradient(135deg, rgba(244,63,94,.16), rgba(56,189,248,.12));
  box-shadow: 0 10px 24px rgba(244,63,94,.18);
}
.inbox-btn.has-unread:hover,
.chat-btn.has-unread:hover,
.email-btn.has-unread:hover{
  background: linear-gradient(135deg, rgba(244,63,94,.24), rgba(56,189,248,.2));
}
@keyframes inboxRing{
  0%{ transform: scale(.7); opacity: .6; }
  70%{ transform: scale(1.15); opacity: 0; }
  100%{ transform: scale(1.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce){
  .inbox-badge.is-visible::before{ animation: none; }
}

.topbar.has-hamburger.nav-open .nav-toggle-icon{
  background: transparent;
}
.topbar.has-hamburger.nav-open .nav-toggle-icon::before{
  top: 0;
  transform: rotate(45deg);
}
.topbar.has-hamburger.nav-open .nav-toggle-icon::after{
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 980px){
  .topbar.has-hamburger{
    flex-wrap: wrap;
  }
  .topbar.has-hamburger .nav-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }
  .topbar.has-hamburger .nav-actions{
    width: 100%;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding: 12px 6px 6px;
    border-top: 1px solid var(--border);
  }
  .topbar.has-hamburger.nav-open .nav-actions{
    display: grid;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
  }
  .topbar.has-hamburger.nav-open .nav-actions .btn,
  .topbar.has-hamburger.nav-open .nav-actions .theme-toggle{
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 38px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .btn{
    padding: 8px 10px;
    font-size: 11px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-btn,
  .topbar.has-hamburger.nav-open .nav-actions .email-btn,
  .topbar.has-hamburger.nav-open .nav-actions .chat-btn,
  .topbar.has-hamburger.nav-open .nav-actions .profile-btn{
    flex-direction: column;
    gap: 4px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-btn::after{
    content: attr(data-inbox-label);
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .2px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .chat-btn::after{
    content: attr(data-chat-label);
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .2px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .email-btn::after{
    content: attr(data-email-label);
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .2px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .profile-btn::after{
    content: attr(aria-label);
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .2px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .theme-toggle{
    padding: 6px 8px;
    gap: 8px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .theme-toggle::after{
    content: "Theme";
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .2px;
  }
  .topbar.has-hamburger.nav-open .nav-actions{
    grid-auto-flow: row dense;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-btn,
  .topbar.has-hamburger.nav-open .nav-actions .email-btn,
  .topbar.has-hamburger.nav-open .nav-actions .chat-btn{
    padding-right: 10px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-badge{
    top: 6px;
    right: 10px;
    transform: none;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-menu.is-open,
  .topbar.has-hamburger.nav-open .nav-actions .email-menu.is-open,
  .topbar.has-hamburger.nav-open .nav-actions .profile-menu.is-open{
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    gap: 8px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-popover,
  .topbar.has-hamburger.nav-open .nav-actions .email-popover,
  .topbar.has-hamburger.nav-open .nav-actions .profile-popover{
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 4px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .profile-popover.is-open{
    max-height: 70vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .topbar.has-hamburger.nav-open .nav-actions .profile-popover.is-open .profile-popover-body{
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-popover.is-open{
    max-height: 70vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .topbar.has-hamburger.nav-open .nav-actions .email-popover.is-open{
    max-height: 70vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .topbar.has-hamburger.nav-open .nav-actions .inbox-popover.is-open .inbox-popover-list{
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar.has-hamburger.nav-open .nav-actions .email-popover.is-open .email-popover-list{
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar.has-hamburger.nav-open .nav-actions .profile-menu{
    grid-column: 1 / -1;
    width: 100%;
  }
  .topbar.has-hamburger.nav-open .nav-actions .profile-btn{
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 16px;
    border-color: rgba(56,189,248,.4);
    background: linear-gradient(135deg, rgba(56,189,248,.18), rgba(34,197,94,.16));
    box-shadow: 0 12px 22px rgba(56,189,248,.18);
  }
  .topbar.has-hamburger.nav-open .nav-actions .profile-btn::after{
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .2px;
  }
  .topbar.has-hamburger.nav-open .nav-actions .profile-thumb{
    width: 30px;
    height: 30px;
    border-color: rgba(59,130,246,.4);
    box-shadow: 0 8px 16px rgba(15,23,42,.18);
  }
}

.btn{
  border:1px solid var(--border);
  background: rgba(148,163,184,.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight: 650;
}
.btn:hover{ background: rgba(148,163,184,.14); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

body .topbar .btn{
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Sora", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  letter-spacing: .2px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.topbar .btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,.18);
}
.topbar .btn:active{
  transform: translateY(0);
}
.topbar .btn.primary{
  box-shadow: 0 12px 22px rgba(37,99,235,.25);
}
.topbar .btn.danger{
  box-shadow: 0 12px 20px rgba(239,68,68,.16);
}
.topbar .nav-actions .btn.ai-btn{
  border-color: rgba(59,130,246,.55);
  background: linear-gradient(135deg, rgba(59,130,246,.92), rgba(129,140,248,.92));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(59,130,246,.28);
}
.topbar .nav-actions .btn.ai-btn:hover{
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  box-shadow: 0 14px 26px rgba(59,130,246,.34);
}
body.theme-light .topbar .nav-actions .btn.ai-btn{
  border-color: rgba(59,130,246,.45);
  color: #ffffff;
}
body.theme-light .topbar .nav-actions .btn.ai-btn:hover{
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
}
.topbar .btn.icon-btn{
  padding: 4px 8px;
  min-width: 34px;
  height: 34px;
}
.topbar .btn.profile-btn{
  padding: 3px;
  width: 36px;
  height: 36px;
}
.topbar .btn.inbox-btn.icon-btn{
  padding-right: 8px;
}
.topbar .btn.chat-btn.icon-btn,
.topbar .btn.email-btn.icon-btn{
  padding-right: 8px;
  min-width: 38px;
  width: 38px;
}
body.theme-light .topbar .nav-actions .btn.chat-btn.icon-btn{
  color: #1d4ed8;
  border-color: rgba(96,165,250,.35);
  background: linear-gradient(135deg, rgba(239,246,255,.96), rgba(224,242,254,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 10px 18px rgba(59,130,246,.12);
}
body.theme-light .topbar .nav-actions .btn.chat-btn.icon-btn:hover{
  color: #1e40af;
  border-color: rgba(59,130,246,.44);
  background: linear-gradient(135deg, rgba(219,234,254,.98), rgba(191,219,254,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 14px 22px rgba(59,130,246,.18);
}
body.theme-light .topbar .nav-actions .btn.chat-btn.icon-btn.primary{
  color: #ffffff;
  border-color: rgba(59,130,246,.42);
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 12px 24px rgba(59,130,246,.26);
}
body.theme-light .topbar .nav-actions .btn.chat-btn.icon-btn.primary:hover{
  color: #ffffff;
  border-color: rgba(37,99,235,.48);
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  box-shadow: 0 14px 26px rgba(37,99,235,.3);
}
body.theme-light .topbar .nav-actions .btn.email-btn.icon-btn{
  color: #0f766e;
  border-color: rgba(45,212,191,.34);
  background: linear-gradient(135deg, rgba(240,253,250,.98), rgba(204,251,241,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.84), 0 10px 18px rgba(20,184,166,.14);
}
body.theme-light .topbar .nav-actions .btn.email-btn.icon-btn:hover{
  color: #115e59;
  border-color: rgba(20,184,166,.44);
  background: linear-gradient(135deg, rgba(204,251,241,.98), rgba(153,246,228,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 14px 22px rgba(20,184,166,.18);
}
body.theme-light .topbar .nav-actions .btn.email-btn.icon-btn.primary{
  color: #ffffff;
  border-color: rgba(20,184,166,.44);
  background: linear-gradient(135deg, #0f766e, #2dd4bf);
  box-shadow: 0 12px 24px rgba(20,184,166,.24);
}
body.theme-light .topbar .nav-actions .btn.email-btn.icon-btn.primary:hover{
  color: #ffffff;
  border-color: rgba(13,148,136,.5);
  background: linear-gradient(135deg, #115e59, #14b8a6);
  box-shadow: 0 14px 26px rgba(13,148,136,.28);
}
body.theme-light .chat-badge.is-empty{
  color: #1d4ed8;
  background: rgba(219,234,254,.92);
  border-color: rgba(96,165,250,.4);
}
body.theme-light .email-badge.is-empty{
  color: #0f766e;
  background: rgba(204,251,241,.94);
  border-color: rgba(45,212,191,.42);
}
.topbar .nav-toggle{
  padding: 4px 8px;
  min-width: 34px;
  height: 34px;
}
.topbar .nav-toggle-icon{
  width: 18px;
  height: 2px;
  border-radius: 999px;
  position: relative;
  display: block;
}
.topbar .nav-toggle-icon::before,
.topbar .nav-toggle-icon::after{
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  transition: transform .2s ease, top .2s ease, opacity .2s ease;
}
.topbar .nav-toggle-icon::before{
  top: -6px;
}
.topbar .nav-toggle-icon::after{
  top: 6px;
}
body.theme-light .topbar .nav-toggle{
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
}
body.theme-light .topbar .nav-toggle:hover{
  background: #eef2f7;
  border-color: #94a3b8;
}
body.theme-light .topbar .nav-toggle-icon,
body.theme-light .topbar .nav-toggle-icon::before,
body.theme-light .topbar .nav-toggle-icon::after{
  background: #475569;
}
body:not(.theme-light) .topbar .btn.nav-toggle{
  border-color: rgba(15,23,42,.2);
  background: rgba(226,232,240,.9);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
}
body:not(.theme-light) .topbar .btn.nav-toggle:hover{
  background: #e2e8f0;
  border-color: rgba(15,23,42,.3);
}
body:not(.theme-light) .topbar .nav-toggle-icon,
body:not(.theme-light) .topbar .nav-toggle-icon::before,
body:not(.theme-light) .topbar .nav-toggle-icon::after{
  background: #334155;
}

.btn.primary{
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.18);
}
.btn.primary:hover{ background: rgba(34,197,94,.24); }

.topbar .nav-actions .btn.primary[href="HUB.html"]{
  position: relative;
  overflow: hidden;
  border-color: rgba(56,189,248,.6);
  background: linear-gradient(135deg, rgba(34,197,94,.92), rgba(56,189,248,.92));
  color: #0b1120;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow: 0 10px 20px rgba(34,197,94,.22), 0 8px 16px rgba(56,189,248,.2);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.topbar .nav-actions .btn.primary[href="HUB.html"]::after{
  content: "";
  position: absolute;
  inset: -45% -10% auto auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,.55), transparent 60%);
  opacity: .6;
  pointer-events: none;
}
.topbar .nav-actions .btn.primary[href="HUB.html"]:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(34,197,94,.3), 0 10px 20px rgba(56,189,248,.28);
}
.topbar .nav-actions .btn.primary[href="HUB.html"]:active{
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(34,197,94,.2), 0 6px 12px rgba(56,189,248,.18);
}

.btn.danger{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.16);
}
.btn.danger:hover{ background: rgba(239,68,68,.22); }

.grid{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

.card{
  border:1px solid var(--border);
  background: rgba(17,26,43,.55);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.card h2{
  margin: 0 0 10px;
  font-size: 16px;
}
.card p{ margin: 8px 0; color: var(--muted); }

.form-row{ margin: 12px 0; }
label{ display:block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], select, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(2,6,23,.45);
  color: var(--text);
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(59,130,246,.45);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
textarea{ min-height: 110px; resize: vertical; }
.inline{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.inline > * { flex: 1 1 auto; }

.help{
  font-size:12px;
  color: var(--muted);
  line-height: 1.45;
}

.hr{
  height:1px;
  background: var(--border);
  margin: 14px 0;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(148,163,184,.08);
  font-size: 12px;
  color: var(--muted);
}
.badge.ok{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.16); color: #b7f7cf; }
.badge.err{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.16); color: #fecaca; }
body.theme-light .badge.ok{ background: #dcfce7; border-color: #86efac; color: #166534; }
body.theme-light .badge.err{ background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

.viewer{
  position: relative;
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  background: rgba(2,6,23,.35);
}

.viewer canvas{
  display:block;
  width:100%;
  height:auto;
}

#overlayCanvas{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.stamp{
  position:absolute;
  border: 2px dashed rgba(34,197,94,.7);
  border-radius: 10px;
  background: rgba(34,197,94,.06);
  cursor: move;
  min-width: 120px;
  min-height: 46px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 6px;
  user-select:none;
  touch-action:none;
}

.stamp .stamp-inner{
  font-size: 12px;
  color: #b7f7cf;
  text-align:center;
}

.modal-backdrop{
  position: fixed;
  inset:0;
  background: rgba(0,0,0,.62);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 50;
}
.modal{
  width: min(720px, 100%);
  border:1px solid var(--border);
  background: rgba(17,26,43,.85);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(10px);
}
.modal h3{ margin:0 0 10px; font-size: 16px; }
.modal .sig-wrap{
  border:1px solid var(--border);
  border-radius: 14px;
  overflow:hidden;
  background: rgba(2,6,23,.45);
}
#sigCanvas{
  width: 100%;
  height: 220px;
  display:block;
}
.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(17,26,43,.75);
  box-shadow: var(--shadow);
  color: var(--text);
  max-width: min(520px, calc(100% - 32px));
  display:none;
}
.toast.show{ display:block; }
.toast .title{ font-weight:800; margin-bottom:4px; }
.toast .desc{ color: var(--muted); font-size: 13px; line-height:1.4; }
body.theme-light .toast{
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #d5dde9;
  box-shadow: 0 16px 30px rgba(15,23,42,.15);
}
body.theme-light .toast .title{ color: #0f172a; }
body.theme-light .toast .desc{ color: #475569; }
body.theme-light .toast[data-type="err"],
body.theme-light .toast[data-type="error"]{
  border-left: 4px solid #ef4444;
}
body.theme-light .toast[data-type="warn"],
body.theme-light .toast[data-type="warning"]{
  border-left: 4px solid #f59e0b;
}
body.theme-light .toast[data-type="ok"],
body.theme-light .toast[data-type="success"]{
  border-left: 4px solid #22c55e;
}
body.theme-light .toast[data-type="info"]{
  border-left: 4px solid #2563eb;
}

/* Notification summary cards (HUB.html) */
#notifCard{
  position: relative;
  overflow: hidden;
}
.notif-headbar{
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.18);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.18), transparent 42%),
    linear-gradient(135deg, rgba(15,23,42,.82), rgba(15,23,42,.52) 52%, rgba(8,47,73,.38));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.notif-headbar::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background:
    linear-gradient(120deg, rgba(255,255,255,.08), rgba(255,255,255,0) 42%),
    radial-gradient(circle at 82% 18%, rgba(34,197,94,.16), transparent 28%);
  pointer-events:none;
}
.notif-headcopy{
  min-width: 0;
  display: grid;
  gap: 6px;
}
.notif-kicker{
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(125,211,252,.86);
}
.notif-heading-row{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.notif-headbar h2{
  margin: 0;
  font-size: 20px;
}
.notif-headbar .help{
  max-width: 620px;
  color: rgba(203,213,225,.82);
}
.notif-live-pill{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34,197,94,.28);
  background: rgba(34,197,94,.12);
  color: #dcfce7;
  font-size: 11px;
  font-weight: 700;
}
.notif-live-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74,222,128,.16);
}
.notif-toolbar{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.notif-counter-card{
  min-width: 112px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  display: grid;
  gap: 2px;
}
.notif-counter-label{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(148,163,184,.82);
}
.notif-counter-value{
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: rgba(248,250,252,.98);
}
.notif-toolbar .btn.slim{
  min-height: 42px;
  padding-inline: 14px;
  border-radius: 12px;
}
#notifList.list{
  gap: 8px;
}
.list-item.notif-item{
  padding: 7px 9px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15,23,42,.58), rgba(2,6,23,.2));
  border-color: rgba(148,163,184,.2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(2,6,23,.1);
}
.list-item.notif-item:hover{
  border-color: rgba(56,189,248,.3);
  background: linear-gradient(145deg, rgba(15,23,42,.68), rgba(2,6,23,.28));
}
.list-item.notif-item.is-unread{
  border-color: rgba(56,189,248,.45);
  box-shadow: 0 14px 28px rgba(15,23,42,.18);
}
.list-item.notif-item.is-unread::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:3px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(56,189,248,.95), rgba(34,197,94,.85));
}
.notif-head{
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notif-icon{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .4px;
  color: #0b1220;
  background: linear-gradient(135deg, rgba(148,163,184,.85), rgba(226,232,240,.9));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
  flex: 0 0 auto;
  margin-top: 1px;
}
.notif-icon.info{ background: linear-gradient(135deg, #22d3ee, #38bdf8); }
.notif-icon.success{ background: linear-gradient(135deg, #22c55e, #16a34a); }
.notif-icon.warning{ background: linear-gradient(135deg, #f59e0b, #f97316); }
.notif-icon.error{ background: linear-gradient(135deg, #f43f5e, #ef4444); }
.notif-icon.revision{ background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.notif-main{
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.notif-title-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.notif-title-actions{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.notif-title{
  font-size: 12px;
  font-weight: 800;
  color: rgba(226,232,240,.98);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-title-link{
  color: inherit;
  text-decoration: none;
}
.notif-title-link:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}
.notif-time{
  font-size: 10.5px;
  color: var(--muted);
}
.notif-chips,
.notif-meta-line{
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0;
}
.notif-meta-line{
  align-items: center;
  row-gap: 2px;
  font-size: 10.5px;
  color: rgba(148,163,184,.9);
}
.notif-meta-fragment{
  min-width: 0;
  line-height: 1.35;
}
.notif-meta-fragment.status,
.notif-meta-fragment.approved,
.notif-meta-fragment.pending,
.notif-meta-fragment.rejected,
.notif-meta-fragment.draft{
  font-weight: 700;
}
.notif-meta-fragment.status,
.notif-meta-fragment.approved{
  color: #bfdbfe;
}
.notif-meta-fragment.pending{
  color: #fde68a;
}
.notif-meta-fragment.rejected{
  color: #fecaca;
}
.notif-meta-fragment.draft{
  color: #cbd5e1;
}
.notif-meta-fragment.event{
  color: rgba(226,232,240,.82);
}
.notif-meta-sep{
  color: rgba(148,163,184,.5);
}
.notif-chip{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.26);
  background: rgba(148,163,184,.12);
  font-size: 10px;
  color: rgba(226,232,240,.92);
  white-space: nowrap;
}
.notif-chip.status{
  border-color: rgba(59,130,246,.4);
  background: rgba(59,130,246,.18);
  color: #bfdbfe;
}
.notif-chip-label{
  color: rgba(148,163,184,.85);
  font-weight: 700;
}
.notif-desc{
  margin-top: 0;
  padding: 6px 10px 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(56,189,248,.25);
  background: linear-gradient(135deg, rgba(56,189,248,.12), rgba(34,197,94,.08));
  color: rgba(226,232,240,.92);
  font-size: 10.8px;
  line-height: 1.4;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-desc::before{
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(56,189,248,.9), rgba(34,197,94,.9));
  opacity: .7;
}
#notifCard #notifList.list{
  gap: 6px;
}
#notifCard .list-item.notif-item{
  padding: 6px 9px;
}
#notifCard .notif-head{
  gap: 8px;
}
#notifCard .notif-icon{
  margin-top: 0;
}
#notifCard .notif-main{
  gap: 2px;
}
#notifCard .notif-topline{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: start;
}
#notifCard .notif-title-stack{
  min-width: 0;
  display: grid;
  gap: 1px;
}
#notifCard .notif-title-actions{
  margin-left: 0;
  justify-content: flex-end;
  align-items: flex-start;
  align-self: start;
}
#notifCard .notif-title{
  line-height: 1.2;
}
#notifCard .notif-meta-line{
  row-gap: 1px;
}
.notif-desc .notif-chip-label{
  color: rgba(226,232,240,.85);
}
.notif-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.notif-details{
  margin-top: 0;
  padding: 7px 9px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.notif-details summary{
  cursor: pointer;
  color: rgba(226,232,240,.86);
  font-size: 11px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-details summary::-webkit-details-marker{ display:none; }
.notif-details summary::after{
  content:"\25BE";
  margin-left: auto;
  opacity:.8;
}
.notif-details[open] summary::after{ content:"\25B4"; }
.notif-detail-body{
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.notif-detail-grid{
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.notif-detail-item{
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(2,6,23,.2);
  display: grid;
  gap: 3px;
}
.notif-detail-label{
  font-size: 10px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: rgba(148,163,184,.8);
}
.notif-detail-value{
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(226,232,240,.92);
}
.notif-detail-actions{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.notif-summary-muted{
  display: inline-block;
  max-width: min(100%, 340px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(148,163,184,.88);
  font-size: 10.5px;
  font-weight: 600;
}
.notif-task-details summary{
  flex-wrap: wrap;
}
body.theme-light:not(.email-ui) .list-item.notif-item{
  background: #ffffff;
  border-color: #d5dde9;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
body.theme-light:not(.email-ui) .notif-headbar{
  border-color: #d9e4f2;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.12), transparent 40%),
    linear-gradient(135deg, #ffffff, #f8fbff 50%, #eef6ff);
  box-shadow: 0 12px 28px rgba(15,23,42,.06), inset 0 1px 0 rgba(255,255,255,.85);
}
body.theme-light:not(.email-ui) .notif-kicker{
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .notif-headbar .help{
  color: #64748b;
}
body.theme-light:not(.email-ui) .notif-live-pill{
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
body.theme-light:not(.email-ui) .notif-live-dot{
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}
body.theme-light:not(.email-ui) .notif-counter-card{
  border-color: #d9e4f2;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 20px rgba(37,99,235,.08);
}
body.theme-light:not(.email-ui) .notif-counter-label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .notif-counter-value{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .list-item.notif-item:hover{
  border-color: #93c5fd;
  background: #f8fafc;
}
body.theme-light:not(.email-ui) .list-item.notif-item.is-unread{
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 14px 26px rgba(37,99,235,.12);
}
body.theme-light:not(.email-ui) .notif-title{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .notif-time{
  color: #64748b;
}
body.theme-light:not(.email-ui) .notif-chip{
  background: #f1f5f9;
  border-color: #d5dde9;
  color: #334155;
}
body.theme-light:not(.email-ui) .notif-meta-line{
  color: #64748b;
}
body.theme-light:not(.email-ui) .notif-meta-fragment.event{
  color: #334155;
}
body.theme-light:not(.email-ui) .notif-meta-fragment.status,
body.theme-light:not(.email-ui) .notif-meta-fragment.approved{
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .notif-meta-fragment.pending{
  color: #b45309;
}
body.theme-light:not(.email-ui) .notif-meta-fragment.rejected{
  color: #b91c1c;
}
body.theme-light:not(.email-ui) .notif-meta-fragment.draft{
  color: #475569;
}
body.theme-light:not(.email-ui) .notif-meta-sep{
  color: #cbd5e1;
}
body.theme-light:not(.email-ui) .notif-chip.status{
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) .notif-chip-label{
  color: #64748b;
}
body.theme-light:not(.email-ui) .notif-desc{
  border-color: #bae6fd;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  color: #334155;
  box-shadow: none;
}
body.theme-light:not(.email-ui) .notif-desc::before{
  background: linear-gradient(180deg, #38bdf8, #22c55e);
  opacity: .9;
}
body.theme-light:not(.email-ui) .notif-desc .notif-chip-label{
  color: #475569;
}
body.theme-light:not(.email-ui) .notif-details{
  background: #f8fafc;
  border-color: #d5dde9;
}
body.theme-light:not(.email-ui) .notif-details summary{
  color: #475569;
}
body.theme-light:not(.email-ui) .notif-summary-muted{
  color: #64748b;
}
body.theme-light:not(.email-ui) .notif-detail-item{
  background: #ffffff;
  border-color: #e2e8f0;
}
body.theme-light:not(.email-ui) .notif-detail-label{
  color: #94a3b8;
}
body.theme-light:not(.email-ui) .notif-detail-value{
  color: #334155;
}
.partner-only.is-hidden{
  display: none !important;
}
#partnerRevenueCard{
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  border-color: rgba(56,189,248,.22);
  background:
    radial-gradient(circle at top left, rgba(56,189,248,.14), transparent 34%),
    radial-gradient(circle at top right, rgba(37,99,235,.12), transparent 28%),
    linear-gradient(145deg, rgba(15,23,42,.88), rgba(15,23,42,.68) 48%, rgba(8,47,73,.54));
}
#partnerRevenueCard::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,.08), rgba(255,255,255,0) 38%),
    radial-gradient(circle at 82% 16%, rgba(34,197,94,.12), transparent 24%);
  opacity: .95;
}
.partner-revenue-head,
.partner-revenue-summary,
.partner-revenue-chart-shell,
.partner-revenue-note{
  position: relative;
  z-index: 1;
}
.partner-revenue-head{
  margin-bottom: 14px;
  align-items: flex-start;
  gap: 14px;
}
.partner-revenue-kicker{
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: none;
  color: rgba(125,211,252,.9);
}
#partnerRevenueCard h2{
  margin: 0 0 6px;
  font-size: 20px;
}
.partner-revenue-head .help{
  max-width: 640px;
  color: rgba(203,213,225,.82);
}
.partner-revenue-head-meta{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.partner-revenue-range-switch{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.24);
  background: rgba(15,23,42,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.partner-revenue-range-btn{
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(203,213,225,.78);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.partner-revenue-range-btn:hover{
  color: rgba(226,232,240,.96);
  background: rgba(255,255,255,.06);
}
.partner-revenue-range-btn.is-active{
  color: #0f172a;
  background: linear-gradient(135deg, #dbeafe, #bae6fd);
  box-shadow: 0 10px 18px rgba(56,189,248,.18);
}
#partnerRevenueCard .badge{
  background: rgba(15,23,42,.34);
  border-color: rgba(148,163,184,.26);
  color: rgba(226,232,240,.88);
}
.partner-revenue-summary{
  margin-top: 10px;
}
.partner-revenue-summary .stat-tile{
  background: rgba(2,6,23,.28);
  border-color: rgba(148,163,184,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.partner-revenue-chart-shell{
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)),
    rgba(2,6,23,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.partner-revenue-legend{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.partner-revenue-legend-item{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: rgba(203,213,225,.82);
}
.partner-revenue-swatch{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(148,163,184,.12);
}
.partner-revenue-swatch.in{
  background: #38bdf8;
}
.partner-revenue-swatch.out{
  background: #f87171;
}
.partner-revenue-swatch.net{
  background: #cbd5e1;
}
.partner-revenue-chart{
  min-height: 320px;
  width: 100%;
}
.partner-revenue-chart svg{
  display: block;
  width: 100%;
  height: auto;
}
.partner-revenue-empty{
  min-height: 280px;
  border-radius: 16px;
  border: 1px dashed rgba(148,163,184,.32);
  background: rgba(2,6,23,.2);
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: rgba(203,213,225,.84);
  font-size: 12px;
}
.partner-revenue-note{
  margin-top: 12px;
  color: rgba(203,213,225,.8);
}
body.theme-light:not(.email-ui) #partnerRevenueCard{
  border-color: #d9e4f2;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.14), transparent 34%),
    radial-gradient(circle at top right, rgba(59,130,246,.1), transparent 28%),
    linear-gradient(145deg, #ffffff, #f8fbff 48%, #eef6ff);
  box-shadow: 0 18px 34px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.85);
}
body.theme-light:not(.email-ui) .partner-revenue-kicker{
  color: #1d4ed8;
}
body.theme-light:not(.email-ui) #partnerRevenueCard h2{
  color: #0f172a;
}
body.theme-light:not(.email-ui) .partner-revenue-head .help{
  color: #64748b;
}
body.theme-light:not(.email-ui) #partnerRevenueCard .badge{
  background: rgba(255,255,255,.92);
  border-color: #d5dde9;
  color: #334155;
}
body.theme-light:not(.email-ui) .partner-revenue-range-switch{
  border-color: #d5dde9;
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
body.theme-light:not(.email-ui) .partner-revenue-range-btn{
  color: #64748b;
}
body.theme-light:not(.email-ui) .partner-revenue-range-btn:hover{
  color: #0f172a;
  background: rgba(59,130,246,.08);
}
body.theme-light:not(.email-ui) .partner-revenue-range-btn.is-active{
  color: #0f172a;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  box-shadow: 0 10px 20px rgba(59,130,246,.14);
}
body.theme-light:not(.email-ui) .partner-revenue-summary .stat-tile{
  background: rgba(255,255,255,.92);
  border-color: #d9e4f2;
  box-shadow: 0 10px 20px rgba(37,99,235,.06);
}
body.theme-light:not(.email-ui) .partner-revenue-chart-shell{
  border-color: #d9e4f2;
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.72)),
    #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}
body.theme-light:not(.email-ui) .partner-revenue-legend-item{
  color: #64748b;
}
body.theme-light:not(.email-ui) .partner-revenue-swatch.net{
  background: #475569;
}
body.theme-light:not(.email-ui) .partner-revenue-empty{
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}
body.theme-light:not(.email-ui) .partner-revenue-note{
  color: #64748b;
}
.notif-pager{
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.notif-pager-meta{
  font-size: 12px;
  color: var(--muted);
}
.btn.slim{
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}
@media (max-width: 720px){
  .notif-headbar{
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 14px;
  }
  .notif-toolbar{
    justify-content: stretch;
  }
  .notif-counter-card,
  .notif-toolbar .btn.slim{
    width: 100%;
  }
  #notifList{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 82vw);
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  #notifList .notif-item{
    scroll-snap-align: start;
  }
  #notifCard .notif-topline{
    grid-template-columns: 1fr;
    gap: 4px;
  }
  #notifCard .notif-title-actions{
    justify-content: flex-start;
  }
  .notif-chips{
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .notif-chip{
    flex: 0 0 auto;
  }
  #partnerRevenueCard{
    margin-top: 18px;
  }
  .partner-revenue-head-meta{
    width: 100%;
    justify-content: flex-start;
  }
  .partner-revenue-chart-shell{
    padding: 12px 10px;
  }
  .partner-revenue-chart{
    min-height: 240px;
  }
  .partner-revenue-empty{
    min-height: 200px;
  }
}
