@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="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{
  position: relative;
  display: inline-flex;
  align-items: center;
}
.inbox-btn.icon-btn{
  padding-right: 8px;
}

.inbox-popover{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 92vw);
  background: rgba(17,26,43,.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 120;
  display: none;
}
.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;
}
.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;
}
.inbox-popover-link{
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.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;
}

.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 .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{
  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);
}
.inbox-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{
  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 .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 .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{
    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 .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 .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 .inbox-popover.is-open .inbox-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 .nav-toggle{
  padding: 4px 8px;
  min-width: 34px;
  height: 34px;
}
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="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) */
.list-item.notif-item{
  background: linear-gradient(135deg, rgba(15,23,42,.65), rgba(2,6,23,.28));
  border-color: rgba(148,163,184,.24);
  position: relative;
  overflow: hidden;
}
.list-item.notif-item:hover{
  border-color: rgba(56,189,248,.35);
  background: linear-gradient(135deg, rgba(15,23,42,.75), rgba(2,6,23,.32));
}
.list-item.notif-item.is-unread{
  border-color: rgba(56,189,248,.45);
  box-shadow: 0 14px 28px rgba(15,23,42,.25);
}
.notif-head{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notif-icon{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  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);
}
.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;
}
.notif-title-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.notif-title-actions{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notif-title{
  font-size: 13px;
  font-weight: 800;
  color: rgba(226,232,240,.98);
}
.notif-title-link{
  color: inherit;
  text-decoration: none;
}
.notif-title-link:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}
.notif-time{
  font-size: 11px;
  color: var(--muted);
}
.notif-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.notif-chip{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.26);
  background: rgba(148,163,184,.12);
  font-size: 10.5px;
  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: 8px;
  padding: 8px 12px 8px 18px;
  border-radius: 12px;
  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: 12px;
  line-height: 1.5;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-desc::before{
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(56,189,248,.9), rgba(34,197,94,.9));
  opacity: .7;
}
.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: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  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: 12.5px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.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: 10px;
  display: grid;
  gap: 10px;
}
.notif-detail-grid{
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.notif-detail-item{
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(2,6,23,.2);
  display: grid;
  gap: 4px;
}
.notif-detail-label{
  font-size: 10.5px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: rgba(148,163,184,.8);
}
.notif-detail-value{
  font-size: 12.5px;
  color: rgba(226,232,240,.92);
}
.notif-detail-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
body.theme-light:not(.email-ui) .list-item.notif-item{
  background: #ffffff;
  border-color: #d5dde9;
  box-shadow: 0 12px 24px rgba(15,23,42,.08);
}
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-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-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;
}
.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){
  #notifList{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 88vw);
    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;
  }
  .notif-chips{
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .notif-chip{
    flex: 0 0 auto;
  }
}
