/* AssureFuture / Client Portal — Data-Dense Dashboard
   Pattern: B2B SaaS (Linear/Stripe quality)
   Brand: Navy #0B1A3B primary, Cyan #14C4D0 accent
   Font: Plus Jakarta Sans */

:root {
  --brand-primary: #0B1A3B;
  --brand-accent:  #14C4D0;

  /* Surface */
  --bg:           #F7F8FA;
  --surface:      #FFFFFF;
  --surface-alt:  #FAFBFC;

  /* Text */
  --text:         #0F172A;
  --text-soft:    #334155;
  --text-muted:   #64748B;
  --text-faint:   #94A3B8;
  --on-primary:   #FFFFFF;

  /* Border */
  --border:       #E5E9EF;
  --border-soft:  #EEF0F4;
  --divider:      #F1F3F6;

  /* Semantic */
  --success:      #10B981;
  --success-bg:   #ECFDF5;
  --warn:         #F59E0B;
  --warn-bg:      #FFFBEB;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --info:         #0284C7;
  --info-bg:      #F0F9FF;

  /* Sidebar */
  --sidebar-bg:    #0B1A3B;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(20, 196, 208, 0.12);
  --sidebar-active-fg: #5EEAF4;
  --sidebar-divider: rgba(255, 255, 255, 0.08);
  --sidebar-text:  rgba(255, 255, 255, 0.62);
  --sidebar-text-strong: rgba(255, 255, 255, 0.92);

  /* Shape */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);

  /* Type — using system stack: SF Pro on macOS/iOS, Segoe on Win, Roboto on Android, Inter if available */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  /* Spacing scale (4-pt grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Motion tokens (Emil Kowalski rules) */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press:   140ms;
  --dur-hover:   180ms;
  --dur-pop:     220ms;
  --dur-drawer:  320ms;

  /* Semantic surface extensions */
  --surface-hover: #F4F6FA;
  --surface-press: #EEF1F6;
  --accent-soft:   rgba(20, 196, 208, 0.10);
  --accent-strong: #0FA8B3;
  --ring-accent:   0 0 0 3px rgba(20, 196, 208, 0.22);

  /* Solar palette aligned to system */
  --solar-bg:     #FFFBF0;
  --solar-bg-2:   #FFF6E0;
  --solar-border: #F0E0B0;
  --solar-ink:    #6B4A00;
  --solar-ink-soft: #8A6500;
}

/* Global :active scale feedback (Emil scale rule, reduced-motion safe) */
.btn, .join-btn, .slot-mini, .icon-btn, .nav a, .logout-btn, .copy-btn, .sidebar nav a {
  transition: transform var(--dur-press) var(--ease-out),
              background var(--dur-hover) ease,
              border-color var(--dur-hover) ease,
              color var(--dur-hover) ease,
              box-shadow var(--dur-hover) ease;
}
.btn:active, .join-btn:active, .slot-mini:active, .icon-btn:active, .copy-btn:active {
  transform: scale(0.97);
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .join-btn:active, .slot-mini:active, .icon-btn:active, .copy-btn:active {
    transform: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

a { color: var(--brand-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--text);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.011em;
  line-height: 1.2;
}
h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.0625rem; }
h3 { font-size: 0.875rem; font-weight: 600; }

/* ============ App shell ============ */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* ============ Sidebar ============ */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 1.25rem 0.875rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.25rem 0.5rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-divider);
  margin-bottom: 0.875rem;
}
.sidebar .brand img { height: 26px; width: auto; opacity: 0.95; }
.sidebar .brand-block { display: flex; flex-direction: column; gap: 0.125rem; }
.sidebar .brand-name {
  font-weight: 600; font-size: 0.8125rem;
  color: var(--sidebar-text-strong); letter-spacing: -0.005em;
}
.sidebar .brand-sub {
  font-size: 0.6875rem; color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
}

.sidebar nav { display: flex; flex-direction: column; gap: 0.125rem; flex: 1; }
.sidebar .nav-section {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 0.875rem 0.625rem 0.375rem;
}
.sidebar nav a {
  color: var(--sidebar-text);
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar nav a:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-fg);
}
.sidebar nav a svg { width: 16px; height: 16px; opacity: 0.8; }
.sidebar nav a.active svg { opacity: 1; }

.sidebar .footer-area {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--sidebar-divider);
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.36);
}
.sidebar .user-card {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.625rem; margin-bottom: 0.5rem;
}
.sidebar .user-avatar {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-accent), #5EEAF4);
  color: var(--brand-primary); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem;
}
.sidebar .user-meta { line-height: 1.2; min-width: 0; flex: 1; }
.sidebar .user-name { color: var(--sidebar-text-strong); font-size: 0.8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-role { color: rgba(255,255,255,0.42); font-size: 0.6875rem; }
.sidebar .logout-btn {
  background: none; border: 1px solid var(--sidebar-divider);
  color: var(--sidebar-text);
  padding: 0.4375rem 0.625rem;
  border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
  width: 100%; text-align: left; font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar .logout-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); border-color: rgba(255,255,255,0.16); }
.sidebar .logout-btn svg { width: 14px; height: 14px; opacity: 0.8; }
.sidebar .powered {
  text-align: center; padding-top: 0.625rem;
  color: rgba(255,255,255,0.28); font-size: 0.6875rem;
}

/* ============ Main ============ */
.main { padding: 1.75rem 2rem 3rem; max-width: 1320px; }

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; gap: 1rem;
}
.page-header .titles { display: flex; flex-direction: column; gap: 0.25rem; }
.page-header .page-subtitle { color: var(--text-muted); font-size: 0.8125rem; }
.page-header .header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ============ Stat cards ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.125rem 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) ease, transform var(--dur-hover) var(--ease-out);
}
.stat:hover { border-color: #D5DBE3; box-shadow: var(--shadow-sm); }
.stat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.stat .label {
  font-size: 0.6875rem; color: var(--text-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.stat .stat-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--info-bg); color: var(--info);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat .stat-icon svg { width: 14px; height: 14px; }
.stat .stat-icon.accent { background: var(--accent-soft); color: var(--brand-primary); }
.stat .stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat .stat-icon.warn { background: var(--warn-bg); color: var(--warn); }
.stat .stat-icon.danger { background: var(--danger-bg); color: var(--danger); }
.stat .value {
  font-size: 1.75rem; font-weight: 700; color: var(--text);
  line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .sub {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem;
  display: flex; align-items: center; gap: 0.375rem;
}
.stat .trend {
  display: inline-flex; align-items: center; gap: 0.125rem;
  font-size: 0.6875rem; font-weight: 600;
  padding: 0.0625rem 0.375rem; border-radius: 4px;
}
.stat .trend.up { color: var(--success); background: var(--success-bg); }
.stat .trend.down { color: var(--danger); background: var(--danger-bg); }
.stat .trend.flat { color: var(--text-muted); background: var(--surface-alt); }
.stat .value.placeholder { color: var(--text-faint); font-weight: 500; font-size: 1.5rem; }
.stat .sub.placeholder-note {
  background: var(--surface-alt); border: 1px dashed var(--border);
  padding: 0.1875rem 0.5rem; border-radius: 4px;
  font-size: 0.6875rem; color: var(--text-muted);
}

/* ============ Card / Section ============ */
.section { margin-top: 1.5rem; }
.section-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.75rem;
}
.section-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.section-link { font-size: 0.8125rem; color: var(--brand-accent); font-weight: 500; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card.padded { padding: 1.25rem; }

/* ============ Table ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
thead th {
  text-align: left; padding: 0.625rem 1rem;
  background: var(--surface-alt); color: var(--text-muted);
  font-weight: 500; font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr {
  position: relative;
  transition: background var(--dur-hover) ease;
}
tbody tr td:first-child { position: relative; }
tbody tr td:first-child::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent;
  transition: background var(--dur-hover) ease;
}
tbody tr:hover { background: var(--surface-hover); cursor: pointer; }
tbody tr:hover td:first-child::before { background: var(--brand-accent); }
td .mono { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
td .strong { font-weight: 600; color: var(--text); }
td .muted { color: var(--text-muted); }
td .stack { display: flex; flex-direction: column; gap: 0.125rem; }
td .stack-secondary { font-size: 0.75rem; color: var(--text-muted); }

.contact-cell { display: flex; align-items: center; gap: 0.625rem; }
.contact-avatar {
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--surface-alt); color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.75rem; flex-shrink: 0;
  border: 1px solid var(--border);
}
.contact-meta { line-height: 1.25; min-width: 0; }
.contact-name { font-weight: 600; color: var(--text); font-size: 0.8125rem; }
.contact-sub { font-size: 0.75rem; color: var(--text-muted); }

.empty {
  padding: 3rem 1.5rem; text-align: center;
  color: var(--text-muted); font-size: 0.875rem;
}
.empty .empty-icon { width: 36px; height: 36px; margin: 0 auto 0.75rem; opacity: 0.4; }
.empty .empty-title { color: var(--text-soft); font-weight: 600; margin-bottom: 0.25rem; }
.empty .empty-sub { font-size: 0.8125rem; }

/* ============ Badges & Pills ============ */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.125rem 0.5rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warn    { background: var(--warn-bg);    color: var(--warn); }
.badge.danger  { background: var(--danger-bg);  color: var(--danger); }
.badge.info    { background: var(--info-bg);    color: var(--info); }
.badge.muted   { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

.source-tag {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.125rem 0.5rem; border-radius: 6px;
  background: var(--surface-alt); border: 1px solid var(--border);
  font-size: 0.6875rem; color: var(--text-soft); font-weight: 500;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4375rem;
  padding: 0.5rem 0.875rem; border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  font-family: inherit; line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--brand-primary); color: var(--on-primary); border-color: var(--brand-primary);
}
.btn-primary:hover:not(:disabled) { background: #142552; }
.btn-accent {
  background: var(--brand-accent); color: var(--brand-primary); border-color: var(--brand-accent);
}
.btn-accent:hover:not(:disabled) { background: #1ad3df; }
.btn-ghost {
  background: var(--surface); color: var(--text-soft); border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); border-color: #D5DBE3; }
.btn-link {
  background: transparent; color: var(--brand-accent); border: none; padding: 0;
  font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: 0.3125rem 0.625rem; font-size: 0.75rem; }
.btn svg { width: 14px; height: 14px; }

.join-btn {
  display: inline-flex; align-items: center; gap: 0.4375rem;
  padding: 0.3125rem 0.6875rem; border-radius: 6px;
  background: var(--brand-primary); color: var(--on-primary);
  font-size: 0.75rem; font-weight: 600;
  border: none; cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s;
}
.join-btn:hover { background: #142552; color: var(--on-primary); }
.join-btn svg { width: 12px; height: 12px; }

.pending-link {
  display: inline-flex; align-items: center; gap: 0.4375rem;
  padding: 0.3125rem 0.6875rem; border-radius: 6px;
  background: var(--surface-alt); color: var(--text-muted);
  font-size: 0.75rem; font-weight: 500; border: 1px dashed var(--border);
}

/* ============ Forms ============ */
.form-input {
  width: 100%; padding: 0.5625rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-family: inherit; font-size: 0.875rem; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  outline: none; border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(20,196,208,0.18);
}
.form-input:read-only { background: var(--surface-alt); color: var(--text-muted); }
.form-label {
  display: block; font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted); margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}
.form-row { margin-bottom: 1rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.375rem; }

.alert {
  padding: 0.625rem 0.875rem; border-radius: var(--radius-sm);
  font-size: 0.8125rem; margin-bottom: 0.875rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.alert.error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #FECACA; }
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #BBF7D0; }
.alert.info    { background: var(--info-bg);    color: var(--info);    border: 1px solid #BAE6FD; }
.alert.hidden  { display: none; }

/* ============ Auth (login / reset) ============ */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at top left, rgba(20,196,208,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(94,234,244,0.12) 0%, transparent 50%),
    linear-gradient(155deg, #0B1A3B 0%, #142552 100%);
}
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 2.25rem 2rem 2rem;
  max-width: 420px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06);
}
.auth-card .logo-area { text-align: center; margin-bottom: 1.5rem; }
.auth-card .logo-area img { height: 42px; margin: 0 auto; }
.auth-card h1 {
  font-size: 1.25rem; text-align: center; margin: 0 0 0.375rem; color: var(--text);
}
.auth-card .subtitle {
  text-align: center; color: var(--text-muted);
  font-size: 0.875rem; margin: 0 0 1.5rem;
}
.auth-card .footer-link {
  text-align: center; margin-top: 1.125rem; font-size: 0.8125rem;
}
.auth-card .footer-link button {
  background: none; border: none;
  color: var(--brand-accent); cursor: pointer;
  font-family: inherit; padding: 0; font-size: inherit; font-weight: 500;
}
.auth-card .footer-link button:hover { text-decoration: underline; }
.auth-card .btn { width: 100%; padding: 0.625rem 1rem; font-size: 0.875rem; }

/* ============ Drawer (meeting detail / edit) ============ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 520px;
  background: var(--surface);
  z-index: 51;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.drawer-header .drawer-title {
  font-weight: 700; color: var(--text); font-size: 1.0625rem;
  letter-spacing: -0.01em; line-height: 1.2;
}
.drawer-header .drawer-sub {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem;
  font-weight: 500;
}
.drawer-header button {
  background: none; border: none; cursor: pointer;
  padding: 0.5rem; color: var(--text-muted); border-radius: 6px;
}
.drawer-header button:hover { background: var(--border); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.drawer-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; flex-wrap: wrap; background: var(--surface-alt); }

.field-row { padding: 0.5rem 0; border-bottom: 1px solid var(--divider); display: grid; grid-template-columns: 110px 1fr; gap: 0.625rem; align-items: center; }
.field-row:last-child { border-bottom: none; }
.field-row .lbl { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.field-row .val { color: var(--text); font-size: 0.875rem; font-weight: 500; word-break: break-word; display: inline-flex; align-items: center; gap: 0.5rem; }
.field-row .val.mono-id {
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 0.125rem 0.4375rem; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-soft); font-weight: 500; display: inline-flex; width: fit-content;
}
.copy-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 0.25rem; color: var(--text-faint); border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.copy-btn:hover { background: var(--surface-alt); color: var(--brand-accent); }
.copy-btn svg { width: 12px; height: 12px; }

.solar-card {
  background: linear-gradient(135deg, var(--solar-bg) 0%, var(--solar-bg-2) 100%);
  border: 1px solid var(--solar-border); border-radius: var(--radius);
  padding: 1rem 1.125rem; margin: 1rem 0;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.solar-card .solar-title { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--solar-ink); font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.375rem; }
.solar-card .solar-score-row { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.75rem; }
.solar-card .solar-score { font-size: 1.75rem; font-weight: 700; color: var(--solar-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.solar-card .solar-score-label { font-size: 0.75rem; color: var(--solar-ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.solar-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; font-size: 0.8125rem; }
.solar-stats .stat-row { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px solid rgba(107, 74, 0, 0.1); }
.solar-stats .stat-row:last-child, .solar-stats .stat-row:nth-last-child(2) { border-bottom: none; }
.solar-stats .lbl { color: var(--solar-ink-soft); font-size: 0.75rem; }
.solar-stats .val { color: var(--solar-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.solar-incentives { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed rgba(107, 74, 0, 0.2); }
.solar-incentives .lbl { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--solar-ink-soft); font-weight: 600; margin-bottom: 0.25rem; }
.solar-incentives ul { margin: 0; padding-left: 1rem; font-size: 0.8125rem; color: var(--solar-ink); }
.solar-demo-tag { font-size: 0.625rem; background: rgba(107, 74, 0, 0.15); color: var(--solar-ink); padding: 0.125rem 0.375rem; border-radius: 4px; margin-left: auto; font-weight: 700; letter-spacing: 0.04em; }

.audit-log { margin-top: 1rem; }
.audit-log .lbl { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; margin-bottom: 0.5rem; }
.audit-log .entry { padding: 0.4375rem 0; border-bottom: 1px solid var(--divider); font-size: 0.75rem; color: var(--text-soft); display: flex; gap: 0.5rem; }
.audit-log .entry:last-child { border-bottom: none; }
.audit-log .entry .when { color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.audit-log .entry .what { color: var(--text); font-weight: 500; }

.slot-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.375rem; max-height: 320px; overflow-y: auto; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.slot-mini { padding: 0.4375rem 0.625rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 0.75rem; cursor: pointer; text-align: center; font-family: inherit; font-weight: 500; color: var(--text-soft); }
.slot-mini:hover { border-color: var(--brand-accent); background: rgba(20,196,208,0.05); color: var(--brand-primary); }
.slot-mini.day-header { background: transparent; border: none; color: var(--text-muted); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; grid-column: 1 / -1; padding: 0.5rem 0 0.25rem; cursor: default; text-align: left; }

/* ============ Toast notifications (Sonner-inspired) ============ */
.toaster {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 100;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none; max-width: 380px;
}
.toast {
  pointer-events: auto;
  background: var(--text); color: var(--on-primary);
  padding: 0.75rem 1rem; border-radius: var(--radius);
  font-size: 0.8125rem; min-width: 280px;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex; align-items: center; gap: 0.625rem;
  opacity: 0; transform: translateY(8px) scale(0.96);
  transition: opacity var(--dur-pop) var(--ease-out),
              transform var(--dur-pop) var(--ease-out);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.success { background: #064E3B; }
.toast.error   { background: #7F1D1D; }
.toast.info    { background: var(--text); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============ Skeleton loading shimmer ============ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-alt) 0%,
    var(--border-soft) 50%,
    var(--surface-alt) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton-line { height: 14px; margin: 0.25rem 0; }
.skeleton-line.tall { height: 28px; }
.skeleton-line.short { width: 60%; }

/* ============ Today strip TZ pill ============ */
.tz-pill {
  display: inline-flex; align-items: center;
  padding: 0.125rem 0.5rem; border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.6875rem; font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* ============ Trend chart container ============ */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem 1rem;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
}
.chart-card .chart-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.75rem;
}
.chart-card .chart-title {
  font-size: 0.9375rem; font-weight: 600; color: var(--text);
  letter-spacing: -0.005em;
}
.chart-card .chart-legend {
  display: flex; gap: 0.875rem; font-size: 0.75rem; color: var(--text-muted);
  align-items: center;
}
.chart-card .chart-legend .key {
  display: inline-flex; align-items: center; gap: 0.375rem;
}
.chart-card .chart-legend .key::before {
  content: ''; width: 10px; height: 10px; border-radius: 2px;
  background: var(--legend-color, var(--text-muted));
}
.chart-card .chart {
  width: 100%; height: 260px;
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding: 1rem; flex-direction: row; flex-wrap: wrap; }
  .sidebar nav { flex-direction: row; overflow-x: auto; gap: 0.25rem; }
  .sidebar .footer-area { width: 100%; border-top: none; padding-top: 0; }
  .sidebar .user-card { display: none; }
  .main { padding: 1.25rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
