/* ============================================================
   GOPOCKET INSURANCE SHARING STRUCTURE - PREMIUM DASHBOARD
   ============================================================ */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --secondary: #0EA5E9;
  --success: #22C55E;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --bg: #F8FAFC;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow: 0 4px 6px -1px rgba(15,23,42,.06), 0 2px 4px -2px rgba(15,23,42,.05);
  --shadow-lg: 0 20px 25px -5px rgba(15,23,42,.08), 0 8px 10px -6px rgba(15,23,42,.06);
  --shadow-xl: 0 25px 50px -12px rgba(15,23,42,.15);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --gradient: linear-gradient(135deg, #2563EB 0%, #0EA5E9 100%);
  --gradient-warm: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  --gradient-cool: linear-gradient(135deg, #22C55E 0%, #0EA5E9 100%);
  --gold: linear-gradient(135deg, #FFD700 0%, #F59E0B 100%);
  --silver: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%);
  --bronze: linear-gradient(135deg, #F59E0B 0%, #B45309 100%);
}
[data-theme="dark"] {
  --primary: #3B82F6;
  --primary-dark: #2563EB;
  --primary-light: #1E3A8A;
  --secondary: #38BDF8;
  --success: #34D399;
  --success-light: #064E3B;
  --warning: #FBBF24;
  --warning-light: #78350F;
  --danger: #F87171;
  --danger-light: #7F1D1D;
  --bg: #0B1220;
  --bg-elevated: #111827;
  --surface: #131C2E;
  --surface-2: #1B2540;
  --border: #1F2A44;
  --border-strong: #334155;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.5);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--primary); color: #fff; }
.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }

/* HEADER */
.topbar {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 40;
  background: var(--gradient);
  color: #fff;
  padding: 18px 28px;
  display: flex; align-items: center; gap: 20px;
  box-shadow: var(--shadow-lg);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(10px);
  display: grid; place-items: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px;
  border: 1px solid rgba(255,255,255,.25);
}
.title-block h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.title-block p { font-size: 12px; opacity: .85; font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 600;
  padding: 9px 16px; border-radius: 10px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .2s ease; white-space: nowrap;
}
.btn-glass {
  background: rgba(255,255,255,.15); color: #fff;
  backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.25);
}
.btn-glass:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--primary); background: var(--surface-2); }
.icon-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 10px;
  display: grid; place-items: center;
}
.hidden-file { display: none; }

/* SIDEBAR */
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 16px; overflow-y: auto;
  position: sticky; top: 82px; height: calc(100vh - 82px);
}
.side-section { margin-bottom: 22px; }
.side-heading {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-subtle); font-weight: 700;
  padding: 0 10px 10px; display: flex; align-items: center; gap: 8px;
}
.side-heading .dot { width: 8px; height: 8px; border-radius: 50%; }
.side-heading.health .dot { background: var(--danger); }
.side-heading.life .dot { background: var(--primary); }
.side-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.side-item {
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: all .15s ease;
}
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
[data-theme="dark"] .side-item.active { color: #fff; }
.side-item .count {
  margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--surface-2); color: var(--text-muted);
}
.side-item.active .count { background: var(--primary); color: #fff; }
.company-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); flex-shrink: 0;
}

/* MAIN */
.main { padding: 28px; min-width: 0; }
.hero {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px; gap: 20px; flex-wrap: wrap;
}
.hero h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
}
.hero p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* KPI CARDS */
.kpis {
  display: grid; gap: 16px; margin-bottom: 24px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient);
}
.kpi.warm::before { background: var(--gradient-warm); }
.kpi.cool::before { background: var(--gradient-cool); }
.kpi.gold::before { background: var(--gold); }
.kpi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 8px;
}
.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px; font-weight: 700; color: var(--text);
  letter-spacing: -.02em;
}
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

/* PANEL */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.panel-h {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.panel-h h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: -.01em;
}

/* SEARCH & FILTERS */
.controls { display: grid; gap: 12px; }
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-subtle);
}
.search-input {
  width: 100%; padding: 12px 16px 12px 42px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-elevated); color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 500;
  transition: all .2s ease;
}
.search-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.filter-row {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.select, .input {
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-elevated); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s ease;
}
.select:focus, .input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); transition: all .15s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* TABLE */
.table-wrap {
  overflow: auto; max-height: 640px;
  border-radius: 12px; border: 1px solid var(--border);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-2); color: var(--text);
  padding: 12px 14px; text-align: left; font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; cursor: pointer; user-select: none;
}
thead th:hover { background: var(--border); }
thead th.sticky-col, tbody td.sticky-col {
  position: sticky; left: 0; z-index: 6; background: var(--surface);
  border-right: 1px solid var(--border);
}
thead th.sticky-col { z-index: 7; background: var(--surface-2); }
tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
tbody tr:hover td { background: var(--surface-2); }
tbody tr.fav td { background: rgba(245,158,11,.06); }
tbody tr.highlight td { background: rgba(37,99,235,.06); }
.company-cell { display: flex; align-items: center; gap: 10px; }
.company-logo {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}
.badge {
  display: inline-flex; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-health { background: var(--danger-light); color: var(--danger); }
.badge-life { background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .badge-health { color: #FCA5A5; }
[data-theme="dark"] .badge-life { color: #93C5FD; }
.payout-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-weight: 700; font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
}
.p-high { background: var(--success-light); color: var(--success); }
.p-mid { background: var(--warning-light); color: var(--warning); }
.p-low { background: var(--danger-light); color: var(--danger); }
[data-theme="dark"] .p-high { color: #86EFAC; }
[data-theme="dark"] .p-mid { color: #FCD34D; }
[data-theme="dark"] .p-low { color: #FCA5A5; }
.row-actions { display: flex; gap: 4px; }
.row-btn {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; display: grid; place-items: center;
  color: var(--text-muted); transition: all .15s ease;
}
.row-btn:hover { color: var(--primary); border-color: var(--primary); }
.row-btn.active { color: var(--warning); border-color: var(--warning); background: var(--warning-light); }

/* TOP PAYOUT / PODIUM */
.podium { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rank-card {
  padding: 16px; border-radius: 14px; position: relative; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
  transition: all .2s ease;
}
.rank-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.rank-card .medal {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}
.rank-card.gold .medal { background: var(--gold); }
.rank-card.silver .medal { background: var(--silver); color: #0F172A; }
.rank-card.bronze .medal { background: var(--bronze); }
.rank-card.gold { border-color: #F59E0B; }
.rank-card .co { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.rank-card .pd { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding-right: 40px; }
.rank-card .pay {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--primary);
}

/* CHARTS */
.charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  min-height: 320px; display: flex; flex-direction: column;
}
.chart-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 700; margin-bottom: 14px;
}
.chart-container { position: relative; flex: 1; min-height: 260px; }

/* DRAWER */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px); z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  background: var(--bg-elevated); z-index: 101;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; position: sticky; top: 0;
  background: var(--bg-elevated); z-index: 2;
}
.drawer-head .company-logo { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
.drawer-head h3 { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 20px 24px; flex: 1; }
.drawer-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px;
}
.drawer-stat {
  padding: 14px; border-radius: 12px; background: var(--surface-2);
}
.drawer-stat .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.drawer-stat .val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700; margin-top: 6px;
}
.drawer-list { display: flex; flex-direction: column; gap: 8px; }
.drawer-item {
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.drawer-item .pn { font-weight: 600; font-size: 13px; }
.drawer-item .pn small { color: var(--text-muted); font-weight: 500; display: block; margin-top: 2px; }

/* TOAST */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 12px 18px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px; min-width: 240px;
  animation: slideIn .3s ease;
  font-size: 13px; font-weight: 500;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* LOADING */
.loader {
  position: fixed; inset: 0; background: rgba(15,23,42,.6);
  backdrop-filter: blur(6px);
  display: none; place-items: center; z-index: 300;
}
.loader.show { display: grid; }
.loader-box {
  background: var(--surface); padding: 28px 36px; border-radius: 16px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-xl);
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty {
  padding: 60px 20px; text-align: center; color: var(--text-muted);
}
.empty h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px; color: var(--text); margin-bottom: 8px;
}
.empty p { font-size: 13px; margin-bottom: 16px; }

/* FOOTER */
.footer {
  grid-column: 1 / -1; padding: 24px 28px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--text-muted);
  background: var(--surface);
}
.footer strong { color: var(--text); font-family: 'Space Grotesk', sans-serif; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 82px; left: 0; bottom: 0;
    width: 280px; z-index: 30;
    transform: translateX(-100%);
    transition: transform .3s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .menu-toggle { display: grid !important; }
}
.menu-toggle { display: none; }
@media (max-width: 640px) {
  .topbar { padding: 14px 16px; gap: 10px; }
  .title-block h1 { font-size: 14px; }
  .title-block p { font-size: 11px; }
  .main { padding: 18px; }
  .hero h2 { font-size: 22px; }
  .btn span.lbl { display: none; }
  .kpi-value { font-size: 22px; }
}
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Drag & drop */
.dropzone {
  position: fixed; inset: 0; z-index: 250; pointer-events: none;
  background: rgba(37,99,235,.15); backdrop-filter: blur(6px);
  border: 3px dashed var(--primary);
  opacity: 0; transition: opacity .2s ease;
  display: grid; place-items: center;
}
.dropzone.show { opacity: 1; pointer-events: auto; }
.dropzone-inner {
  background: var(--surface); padding: 32px 48px; border-radius: 20px;
  box-shadow: var(--shadow-xl); text-align: center; max-width: 480px;
}
.dropzone-inner h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; margin-bottom: 8px;
}
.dropzone-inner p { color: var(--text-muted); font-size: 13px; }
.dropzone-choice { display: flex; gap: 12px; margin-top: 20px; }
.dropzone-choice button {
  flex: 1; padding: 14px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 14px; color: var(--text);
  transition: all .15s ease;
}
.dropzone-choice button:hover {
  border-color: var(--primary); color: var(--primary);
  transform: translateY(-2px);
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  backdrop-filter: blur(6px); z-index: 150;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--bg-elevated); border-radius: 20px;
  padding: 28px; width: min(560px, 100%);
  box-shadow: var(--shadow-xl);
  max-height: 90vh; overflow-y: auto;
}
.modal h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700; margin-bottom: 4px;
}
.modal .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.modal label {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.modal input[type="text"] {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px; margin-bottom: 14px;
}
.modal input[type="text"]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
}
.modal .hint {
  background: var(--surface-2); padding: 12px 14px;
  border-radius: 10px; font-size: 12px; color: var(--text-muted);
  line-height: 1.6; margin-bottom: 16px;
}
.modal .hint code {
  background: var(--surface); padding: 2px 6px; border-radius: 4px;
  font-family: 'Source Code Pro', monospace; font-size: 11px;
}
.switch { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 13px; }
.switch input { width: 40px; height: 22px; }

/* Sync status badge */
.sync-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted);
  margin-left: 12px;
}
.sync-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  animation: pulse 1.6s ease-in-out infinite;
}
.sync-status.off .dot { background: var(--text-subtle); animation: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.4); }
}

/* ============================================================
   ROLE-BASED ACCESS CONTROL
   ============================================================
   Elements with data-role="admin" are only visible when
   <body data-role="admin"> — i.e. after successful admin login. */
body:not([data-role="admin"]) [data-role="admin"] { display: none !important; }

/* Admin login trigger — small, subtle */
.admin-trigger {
  position: fixed; bottom: 12px; left: 12px; z-index: 90;
  width: 30px; height: 30px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-subtle); cursor: pointer;
  display: grid; place-items: center;
  opacity: .5; transition: all .2s ease;
}
.admin-trigger:hover { opacity: 1; border-color: var(--primary); color: var(--primary); }
body[data-role="admin"] .admin-trigger {
  background: var(--primary); color: #fff; border-color: var(--primary); opacity: 1;
}

/* Role badge in hero */
.role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-2); color: var(--text-muted);
  margin-left: 10px;
}
body[data-role="admin"] .role-badge {
  background: var(--primary); color: #fff;
}

/* Empty / error state for missing config */
.config-empty {
  padding: 80px 24px; text-align: center;
  max-width: 640px; margin: 40px auto;
}
.config-empty svg { color: var(--text-subtle); margin-bottom: 20px; }
.config-empty h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; margin-bottom: 10px;
}
.config-empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
