:root{
  --navy:#0d2146;--navy-2:#102a58;--ink:#15213b;--muted:#69748b;
  --line:#e7e9f0;--bg:#f6f8fc;--card:#fff;
  --lavender:#9a7cf6;--lavender-soft:#eee9ff;
  --mint:#57d6bd;--mint-soft:#e4faf5;
  --sky:#64b7f4;--sky-soft:#e5f3fd;
  --coral:#ff7d6f;--coral-soft:#fff0ed;
  --amber:#ffc44d;--amber-soft:#fff7df;--green:#22b573;--red:#ea5d68;
  --shadow:0 8px 28px rgba(24,42,84,.08);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.toast{position:fixed;right:24px;top:24px;z-index:1000;max-width:380px;padding:14px 18px;border-radius:12px;background:#15213b;color:#fff;box-shadow:var(--shadow);opacity:0;transform:translateY(-8px);pointer-events:none;transition:.2s}
.toast.show{opacity:1;transform:translateY(0)}
.toast.error{background:#8e2e37}
.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(145deg,#091a38,#132d5c 60%,#20366d)}
.login-card{width:min(440px,100%);background:#fff;border-radius:28px;padding:38px;box-shadow:0 30px 80px rgba(0,0,0,.28);text-align:center}
.login-logo{width:110px;height:110px;object-fit:contain}
.eyebrow{margin-top:8px;font-size:12px;letter-spacing:.14em;color:var(--lavender);font-weight:800}
.login-card h1{font-size:32px;margin:8px 0}
.login-copy{color:var(--muted);margin:0 auto 26px;max-width:320px}
.login-form{display:grid;gap:16px;text-align:left}
.login-form label,.stack-form label{display:grid;gap:7px}
.login-form span,.stack-form span{font-size:13px;font-weight:700;color:#4b566f}
input,select,textarea{width:100%;border:1px solid #dfe3eb;border-radius:12px;background:#fff;padding:12px 14px;outline:none;color:var(--ink)}
input:focus,select:focus,textarea:focus{border-color:var(--lavender);box-shadow:0 0 0 3px rgba(154,124,246,.12)}
textarea{min-height:120px;resize:vertical}
.primary-button,.secondary-button{border:0;border-radius:12px;padding:12px 16px;font-weight:800}
.primary-button{background:linear-gradient(135deg,#9a7cf6,#765fea);color:#fff}
.secondary-button{background:#fff;color:var(--ink);border:1px solid #dfe3eb}
.login-status{min-height:24px;margin-top:14px;color:var(--red);font-size:14px}
.privacy-note{font-size:12px;color:#8b94a7;margin:16px 0 0}
.app-shell{display:grid;grid-template-columns:230px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,#0b1e40,#102a58);padding:24px 16px;color:#fff;display:flex;flex-direction:column}
.brand{display:flex;align-items:center;gap:10px;padding:0 8px 20px;border-bottom:1px solid rgba(255,255,255,.12)}
.brand img{width:48px;height:48px;object-fit:contain}
.brand-name{font-size:18px;font-weight:800}
.brand-sub{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:#aebcdb}
.nav{display:grid;gap:5px;padding:20px 0}
.nav-item{display:flex;align-items:center;gap:12px;border:0;background:transparent;color:#d8e1f5;border-radius:11px;padding:11px 13px;text-align:left;font-weight:650}
.nav-item span{width:22px;text-align:center;font-size:17px}
.nav-item:hover,.nav-item.active{background:linear-gradient(90deg,rgba(154,124,246,.35),rgba(100,183,244,.16));color:#fff}
.sidebar-spacer{flex:1}
.admin-chip{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.04)}
.avatar-initials{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--lavender),var(--sky));font-weight:800}
.admin-chip-text{display:grid;min-width:0}
.admin-chip-text strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-chip-text span{font-size:11px;color:#aebcdb}
.logout-button{margin-top:10px;background:transparent;border:1px solid rgba(255,255,255,.15);border-radius:11px;padding:10px;color:#d8e1f5}
.main{min-width:0;padding:24px 28px 40px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}
.topbar h1{font-size:28px;margin:0}
.topbar p{margin:4px 0 0;color:var(--muted)}
.topbar-actions{display:flex;gap:10px}
.topbar-actions select{width:auto;min-width:160px}
.icon-button{width:44px;height:44px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:22px;color:var(--ink)}
.section{display:none}
.section.active{display:block}
.metric-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:14px}
.compact-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.metric-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;min-width:0}
.metric-top{display:flex;align-items:flex-start;gap:11px}
.metric-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;font-size:20px}
.metric-icon.lavender{background:var(--lavender-soft);color:#765fea}.metric-icon.mint{background:var(--mint-soft);color:#27a98e}.metric-icon.sky{background:var(--sky-soft);color:#278acb}.metric-icon.coral{background:var(--coral-soft);color:#e65f52}.metric-icon.amber{background:var(--amber-soft);color:#cf9418}
.metric-label{font-size:12px;color:#59657e;font-weight:750}
.metric-value{font-size:25px;font-weight:850;margin-top:5px;letter-spacing:-.02em}
.metric-foot{font-size:11px;color:#8790a3;margin-top:8px}
.dashboard-grid{display:grid;gap:14px;margin-top:14px}
.dashboard-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.dashboard-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.span-2{grid-column:span 2}
.panel{background:#fff;border:1px solid var(--line);border-radius:17px;padding:16px;box-shadow:0 1px 2px rgba(0,0,0,.015);min-width:0}
.panel-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
.panel-head h2{font-size:15px;margin:0}
.panel-head p{font-size:11px;color:var(--muted);margin:4px 0 0}
.legend{display:flex;gap:12px;flex-wrap:wrap;color:#7a8497;font-size:10px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}.dot.lavender{background:var(--lavender)}.dot.mint{background:var(--mint)}.dot.coral{background:var(--coral)}
.chart-area{height:245px;position:relative;overflow:hidden}.chart-area.compact{height:210px}
.chart-area svg{width:100%;height:100%;display:block}
.demo-tabs{display:flex;gap:6px;margin-bottom:10px}
.demo-tab{border:0;border-radius:9px;padding:6px 9px;background:#f1f3f8;color:#738098;font-size:11px;font-weight:750}
.demo-tab.active{background:var(--lavender-soft);color:#7358e8}
.donut-layout{min-height:205px;display:grid;grid-template-columns:130px 1fr;align-items:center;gap:12px}
.donut{width:122px;height:122px;border-radius:50%;position:relative;margin:auto}
.donut::after{content:"";position:absolute;inset:28px;border-radius:50%;background:#fff}
.donut-legend{display:grid;gap:8px;font-size:11px}
.donut-legend div{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:7px;align-items:center}
.donut-legend i{width:8px;height:8px;border-radius:50%}
.funnel{display:grid;gap:7px;padding:10px 5px 4px}
.funnel-row{margin:auto;min-height:42px;border-radius:9px;display:flex;align-items:center;justify-content:space-between;padding:8px 12px;font-size:11px;font-weight:750}
.funnel-row:nth-child(1){width:100%;background:var(--coral-soft);color:#b5453b}.funnel-row:nth-child(2){width:82%;background:var(--amber-soft);color:#9a711a}.funnel-row:nth-child(3){width:66%;background:var(--sky-soft);color:#2779aa}.funnel-row:nth-child(4){width:50%;background:var(--mint-soft);color:#207c69}
.quick-actions{display:grid;gap:9px}
.quick-actions button{border:1px solid var(--line);background:#f8f9fc;padding:11px 12px;border-radius:10px;text-align:left;font-weight:700;color:#465169}
.table-wrap{width:100%;overflow:auto}
table{width:100%;border-collapse:collapse;font-size:12px}
th{text-align:left;color:#717c91;font-size:10px;text-transform:uppercase;letter-spacing:.04em;padding:10px 8px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:11px 8px;border-bottom:1px solid #eff1f5;vertical-align:middle}
tbody tr:hover{background:#fafbfe}
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}
.badge.success{background:#e6f8ef;color:#18865a}.badge.warn{background:#fff5d8;color:#9b7211}.badge.error{background:#ffebee;color:#b3424b}.badge.info{background:#eaf3ff;color:#3272b7}.badge.neutral{background:#f0f2f6;color:#657086}
.health-list{display:grid;gap:10px}
.health-item{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eff1f5;padding:8px 0}
.health-item:last-child{border:0}
.health-name{font-size:12px;font-weight:700}
.health-status{font-size:11px;font-weight:800}
.health-status.healthy{color:var(--green)}.health-status.idle{color:#ba8615}.health-status.unknown{color:#7b8497}.health-status.error{color:var(--red)}
.section-toolbar{display:flex;justify-content:space-between;gap:16px;align-items:end;margin-bottom:14px}
.section-toolbar h2{margin:0}.section-toolbar p{margin:4px 0 0;color:var(--muted);font-size:13px}
.toolbar-actions{display:flex;gap:8px}.toolbar-actions input{min-width:260px}
.pagination{display:flex;justify-content:center;align-items:center;gap:14px;padding-top:14px}
.pagination button{border:1px solid var(--line);background:#fff;padding:8px 12px;border-radius:9px}
.stack-form{display:grid;gap:12px}.announcement-list,.admin-list,.flag-list{display:grid;gap:9px}
.announcement-item,.admin-row,.flag-row{border:1px solid var(--line);border-radius:12px;padding:12px}
.announcement-item h4{margin:0 0 4px;font-size:13px}.announcement-item p{margin:0;color:#647087;font-size:12px}
.flag-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.flag-copy strong{display:block;font-size:13px}.flag-copy span{font-size:11px;color:var(--muted)}
.switch{position:relative;width:44px;height:26px;display:inline-block}.switch input{opacity:0;width:0;height:0}.switch span{position:absolute;inset:0;border-radius:999px;background:#cfd4df;transition:.2s}.switch span:after{content:"";position:absolute;width:20px;height:20px;left:3px;top:3px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 4px rgba(0,0,0,.15)}.switch input:checked+span{background:var(--lavender)}.switch input:checked+span:after{transform:translateX(18px)}
.health-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}
.health-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px}
.health-card h3{margin:0;font-size:14px}.health-card .big-status{font-size:22px;font-weight:850;margin:12px 0 4px}.health-card p{margin:0;color:var(--muted);font-size:11px}
.info-callout{border-left:4px solid var(--sky);background:var(--sky-soft);border-radius:10px;padding:14px;color:#46657b;font-size:13px;line-height:1.55}
.report-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.report-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px}.report-card>span{font-size:28px}.report-card h3{margin:12px 0 5px}.report-card p{color:var(--muted);min-height:42px}.report-card button{border:0;background:var(--navy);color:#fff;border-radius:10px;padding:10px 13px;font-weight:800}
.empty-state{display:grid;place-items:center;min-height:190px;border:1px dashed #d8dce6;border-radius:13px;color:#7f899b;text-align:center;padding:20px}
.dialog{border:0;border-radius:18px;padding:0;box-shadow:0 24px 80px rgba(0,0,0,.25);max-width:430px}.dialog::backdrop{background:rgba(10,20,40,.45)}.dialog form{padding:24px}.dialog h3{margin:0 0 8px}.dialog p{color:var(--muted);line-height:1.5}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
@media(max-width:1250px){.metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.dashboard-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}.span-2{grid-column:span 1}.report-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.app-shell{grid-template-columns:76px minmax(0,1fr)}.sidebar{padding:18px 10px}.brand div,.nav-item:not(.active){font-size:0}.brand-name,.brand-sub,.admin-chip-text,.logout-button{display:none}.brand{justify-content:center}.brand img{width:44px}.nav-item{justify-content:center;padding:11px}.nav-item span{font-size:20px}.admin-chip{justify-content:center;border:0;background:transparent;padding:5px}.main{padding:18px}.dashboard-grid-3,.dashboard-grid-2{grid-template-columns:1fr}.metric-grid,.compact-grid,.health-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.report-grid{grid-template-columns:1fr}.topbar{align-items:flex-start}.section-toolbar{align-items:stretch;flex-direction:column}.toolbar-actions{flex-wrap:wrap}.toolbar-actions input{min-width:0;flex:1}}
@media(max-width:560px){.app-shell{grid-template-columns:1fr}.sidebar{position:static;height:auto;display:block;padding:10px}.brand{border:0;padding:4px 6px}.brand div{display:block}.nav{display:flex;overflow:auto;padding:8px 0}.nav-item{flex:0 0 auto;font-size:0}.sidebar-spacer,.admin-chip,.logout-button{display:none}.main{padding:14px}.topbar{display:grid}.topbar-actions{width:100%}.topbar-actions select{flex:1}.metric-grid,.compact-grid,.health-grid{grid-template-columns:1fr}.donut-layout{grid-template-columns:1fr}.toolbar-actions{display:grid}.report-grid{grid-template-columns:1fr}}

.forgot-button{border:0;background:transparent;color:#7358e8;font-weight:800;padding:2px 8px 8px;text-align:center}
.forgot-button:hover{text-decoration:underline}


/* ============================================================
   ONEFAMILYCIRCLE ADMIN COMMAND CENTER — RESIZABLE DESKTOP v2
   ============================================================ */

:root{
  --sidebar-width:230px;
  --admin-content-pad-x:26px;
  --admin-content-pad-y:20px;
}

/* Desktop shell behaves like an email client: navigation | draggable line | work area */
.app-shell{
  grid-template-columns:var(--sidebar-width) 7px minmax(0,1fr) !important;
  min-height:100vh;
}
.sidebar{
  width:auto !important;
  min-width:0 !important;
  overflow:hidden;
  padding:20px 14px 18px !important;
}
.main{
  min-width:0 !important;
  padding:var(--admin-content-pad-y) var(--admin-content-pad-x) 38px !important;
}

/* Draggable vertical divider */
.sidebar-resizer{
  position:sticky;
  top:0;
  z-index:30;
  height:100vh;
  cursor:col-resize;
  touch-action:none;
  background:transparent;
  display:flex;
  justify-content:center;
  align-items:stretch;
  outline:none;
}
.sidebar-resizer::before{
  content:"";
  width:1px;
  background:#dfe4ed;
  transition:background .15s,width .15s;
}
.sidebar-resizer span{
  position:absolute;
  top:50%;
  left:50%;
  width:3px;
  height:54px;
  border-radius:999px;
  background:#cbd2df;
  transform:translate(-50%,-50%);
  opacity:0;
  transition:opacity .15s,background .15s;
}
.sidebar-resizer:hover::before,
.sidebar-resizer:focus-visible::before,
.sidebar-resizing .sidebar-resizer::before{
  width:2px;
  background:#7a69ae;
}
.sidebar-resizer:hover span,
.sidebar-resizer:focus-visible span,
.sidebar-resizing .sidebar-resizer span{
  opacity:1;
  background:#8d76c3;
}
.sidebar-resizer:focus-visible{
  box-shadow:inset 0 0 0 2px rgba(122,105,174,.20);
}
body.sidebar-resizing{
  cursor:col-resize !important;
  user-select:none !important;
}

/* Brand must never bleed into the work area */
.brand{
  min-width:0 !important;
  gap:9px !important;
  padding:0 4px 17px !important;
  overflow:hidden;
}
.brand img{
  width:42px !important;
  height:42px !important;
  flex:0 0 42px;
}
.brand>div{
  min-width:0;
  overflow:hidden;
}
.brand-name{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:15px !important;
  font-weight:720 !important;
  letter-spacing:-.012em;
}
.brand-sub{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:8.5px !important;
  font-weight:520 !important;
  letter-spacing:.07em !important;
}
.sidebar-compact .brand-name{
  font-size:13.5px !important;
}
.sidebar-compact .brand-sub{
  display:none;
}

/* Calmer sidebar typography */
.nav{
  gap:3px !important;
  padding:17px 0 !important;
}
.nav-item{
  min-height:40px !important;
  gap:10px !important;
  padding:9px 11px !important;
  border-radius:10px !important;
  font-size:12.5px !important;
  font-weight:570 !important;
  white-space:nowrap;
  overflow:hidden;
}
.nav-item.active{
  font-weight:675 !important;
}
.nav-item span{
  flex:0 0 21px;
  width:21px !important;
  font-size:16px !important;
}
.admin-chip{
  min-width:0;
  padding:10px !important;
  border-radius:12px !important;
}
.admin-chip-text{
  min-width:0 !important;
}
.admin-chip-text strong,
.admin-chip-text span{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-chip-text strong{font-weight:630 !important}
.admin-chip-text span{font-weight:450 !important}
.logout-button{
  font-size:11.5px !important;
  font-weight:540 !important;
}

/* Fix title/sidebar collision and improve top spacing */
.topbar{
  min-width:0;
  align-items:flex-start !important;
  margin-bottom:16px !important;
  gap:18px !important;
}
.topbar>div:first-child{
  min-width:0;
  padding-top:1px;
}
#pageTitle{
  margin:0 0 3px !important;
  font-size:24px !important;
  line-height:1.12 !important;
  font-weight:710 !important;
  letter-spacing:-.025em !important;
}
#pageSubtitle{
  margin:0 !important;
  color:#738097 !important;
  font-size:12px !important;
  line-height:1.35 !important;
  font-weight:430 !important;
}
.topbar-actions{
  flex:0 0 auto;
}
#rangeSelect{
  min-width:132px !important;
  height:40px !important;
  padding:8px 11px !important;
  border-radius:11px !important;
  font-size:11.5px !important;
  font-weight:520 !important;
}
#refreshButton{
  width:40px !important;
  height:40px !important;
  border-radius:11px !important;
  font-size:18px !important;
}

/* KPI cards: scan-friendly hierarchy */
.metric-grid{
  gap:10px !important;
  margin-bottom:12px !important;
}
.metric-card{
  min-height:92px !important;
  padding:13px 14px !important;
  border-radius:14px !important;
  box-shadow:none !important;
}
.metric-top{
  gap:10px !important;
}
.metric-icon{
  width:37px !important;
  height:37px !important;
  flex:0 0 37px;
  border-radius:11px !important;
  font-size:16px !important;
}
.metric-label{
  color:#40516c !important;
  font-size:10.5px !important;
  line-height:1.2 !important;
  font-weight:570 !important;
}
.metric-value{
  margin-top:3px !important;
  font-size:21px !important;
  line-height:1 !important;
  font-weight:700 !important;
}
.metric-foot{
  margin-top:9px !important;
  font-size:9px !important;
  line-height:1.2 !important;
  font-weight:430 !important;
}

/* Dashboard panels: more consistent rhythm */
.dashboard-grid{
  gap:12px !important;
  margin-top:12px !important;
}
.panel{
  border-radius:14px !important;
  padding:14px !important;
  box-shadow:none !important;
}
.panel-head{
  margin-bottom:9px !important;
}
.panel-head h2{
  font-size:14px !important;
  font-weight:660 !important;
  letter-spacing:-.012em;
}
.panel-head p{
  font-size:10px !important;
  font-weight:430 !important;
  line-height:1.35 !important;
}
.legend{
  gap:10px !important;
  font-size:9px !important;
}
.chart-area{
  height:225px !important;
}
.chart-area.compact{
  height:195px !important;
}
.demo-tabs{
  gap:5px !important;
  margin-bottom:8px !important;
}
.demo-tab{
  padding:5px 8px !important;
  font-size:9px !important;
  font-weight:580 !important;
}
.donut-layout{
  min-height:185px !important;
  grid-template-columns:118px 1fr !important;
}
.donut{
  width:105px !important;
  height:105px !important;
}
.donut::after{
  inset:25px !important;
}
.donut-legend{
  gap:6px !important;
  font-size:9.5px !important;
}
.funnel-row{
  min-height:35px !important;
  padding:7px 10px !important;
  font-size:9.5px !important;
  font-weight:580 !important;
}

/* Tables and secondary pages */
table{
  font-size:10.5px !important;
}
th{
  padding:9px 8px !important;
  font-size:9px !important;
  font-weight:640 !important;
}
td{
  padding:9px 8px !important;
  font-weight:430 !important;
}
td strong{
  font-weight:610 !important;
}
.badge{
  padding:4px 7px !important;
  font-size:9px !important;
  font-weight:620 !important;
}
.section-toolbar{
  margin-bottom:12px !important;
}
.section-toolbar h2{
  font-size:17px !important;
  font-weight:680 !important;
}
.section-toolbar p{
  font-size:11.5px !important;
  font-weight:430 !important;
}
.health-card .big-status{
  font-size:20px !important;
  font-weight:700 !important;
}
.report-card h3,
.health-card h3,
.announcement-item h4,
.flag-copy strong,
.admin-row strong{
  font-weight:630 !important;
}

/* Login remains polished and lighter */
.login-card h1{font-weight:710 !important}
.login-form span,.stack-form span{font-weight:600 !important}
.primary-button,.secondary-button{font-weight:680 !important}
.forgot-button{font-weight:650 !important}

/* Responsive behavior: divider is desktop-only */
@media(max-width:900px){
  .app-shell{
    grid-template-columns:76px 0 minmax(0,1fr) !important;
  }
  .sidebar-resizer{display:none !important}
  .sidebar{
    width:auto !important;
    padding:18px 10px !important;
  }
  .main{
    padding:18px !important;
  }
}
@media(max-width:560px){
  .app-shell{
    grid-template-columns:1fr !important;
  }
  .sidebar-resizer{display:none !important}
  .main{
    padding:14px !important;
  }
}
