.account-gate { max-width:1120px; margin:4vh auto 0; }
.account-gate-copy { max-width:700px; margin-bottom:24px; }
.account-gate-copy h2 { margin:7px 0 10px; font-size:clamp(32px,5vw,54px); line-height:1.02; letter-spacing:-.04em; }
.account-gate-copy > p:last-child { color:var(--muted); font-size:16px; }
.account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.account-card { min-height:330px; display:flex; flex-direction:column; align-items:stretch; gap:10px; border-radius:24px; padding:26px; text-align:left; color:var(--text); background:linear-gradient(155deg,#16242e,#0b131a 70%); box-shadow:0 28px 70px rgba(0,0,0,.28); overflow:hidden; position:relative; }
.account-card::after { content:""; position:absolute; width:240px; height:240px; right:-100px; top:-110px; border-radius:50%; background:radial-gradient(circle,rgba(67,214,197,.22),transparent 70%); pointer-events:none; }
.account-card.planned { border-color:rgba(135,120,255,.36); background:linear-gradient(155deg,#211d36,#0d121a 72%); }
.account-card.planned::after { background:radial-gradient(circle,rgba(135,120,255,.28),transparent 70%); }
.account-card:hover { transform:translateY(-3px); box-shadow:0 34px 85px rgba(0,0,0,.36); }
.account-card-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.account-avatar { width:54px; height:54px; display:grid; place-items:center; border:1px solid rgba(67,214,197,.45); border-radius:17px; background:#102b31; color:var(--cyan); font-size:15px; font-weight:950; letter-spacing:.04em; }
.account-avatar.large { width:78px; height:78px; flex:0 0 auto; border-radius:24px; font-size:22px; }
.account-card.planned .account-avatar,.planned-hero .account-avatar { border-color:rgba(135,120,255,.5); background:#25203e; color:#b7adff; }
.account-status { padding:6px 10px; border-radius:999px; font-size:10px; font-weight:900; letter-spacing:.06em; text-transform:uppercase; }
.account-status.live { color:var(--green); background:rgba(103,212,156,.12); }
.account-status.planned { color:#b7adff; background:rgba(135,120,255,.13); }
.account-card > strong { font-size:30px; letter-spacing:-.03em; }
.account-card > small { min-height:22px; color:var(--muted); font-size:13px; }
.account-card-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:14px; }
.account-card-stats > span { min-width:0; padding:12px; border:1px solid rgba(147,162,175,.12); border-radius:13px; background:rgba(5,10,14,.32); color:var(--muted); font-size:10px; text-transform:uppercase; }
.account-card-stats b { display:block; margin-bottom:4px; color:var(--text); font-size:22px; }
.account-card-action { margin-top:auto; color:var(--cyan); font-size:13px; font-weight:900; }
.account-card.planned .account-card-action { color:#b7adff; }

.account-context { position:relative; display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:14px; padding:18px 22px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(135deg,rgba(17,31,40,.96),rgba(9,16,22,.97)); }
.account-context h2 { margin:4px 0 2px; font-size:25px; }
.account-context p:last-child { margin:0; color:var(--muted); font-size:12px; }
.account-context-actions { display:flex; align-items:center; gap:10px; }
.source-health { position:relative; }
.source-health > summary { list-style:none; cursor:pointer; user-select:none; }
.source-health > summary::-webkit-details-marker { display:none; }
.source-health > summary::after { content:"⌄"; display:inline-block; margin-left:7px; transform:translateY(-1px); transition:transform .16s ease; }
.source-health[open] > summary::after { transform:rotate(180deg) translateY(1px); }
.source-health-menu { position:absolute; top:calc(100% + 9px); right:0; z-index:30; width:min(440px,calc(100vw - 32px)); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:12px; border:1px solid rgba(147,162,175,.22); border-radius:17px; background:rgba(8,14,19,.98); box-shadow:0 24px 70px rgba(0,0,0,.48); backdrop-filter:blur(20px); }
.source-health:not([open]) .source-health-menu { display:none; }
.source-health-head { grid-column:1/-1; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; padding:2px 3px 7px; }
.source-health-head strong { font-size:14px; }
.source-health-head small { color:var(--muted); font-size:10px; text-align:right; }
.source-health-item { min-width:0; min-height:82px; display:grid; grid-template-columns:9px minmax(0,1fr); align-items:start; gap:10px; padding:12px; border-color:var(--line); background:#111b24; text-align:left; }
.source-health-item > span:last-child { min-width:0; }
.source-health-item strong { display:flex; align-items:center; justify-content:space-between; gap:7px; color:var(--text); font-size:13px; }
.source-health-item em { color:var(--muted); font-size:8px; font-style:normal; letter-spacing:.06em; text-transform:uppercase; }
.source-health-item small { display:block; margin-top:7px; color:var(--muted); font-size:10px; line-height:1.4; }
.source-health-dot { width:8px; height:8px; margin-top:4px; border-radius:50%; background:#71808c; box-shadow:0 0 0 4px rgba(113,128,140,.1); }
.source-health-item.good .source-health-dot { background:var(--green); box-shadow:0 0 0 4px rgba(103,212,156,.12); }
.source-health-item.bad { border-color:rgba(255,102,115,.32); background:rgba(72,28,36,.45); }
.source-health-item.bad .source-health-dot { background:#ff6673; box-shadow:0 0 0 4px rgba(255,102,115,.12); }
.source-health-item.bad em { color:#ff9ca5; }
.workspace-tabs { position:sticky; top:10px; z-index:8; display:grid; grid-template-columns:repeat(5,1fr); gap:6px; margin-bottom:16px; padding:6px; border:1px solid rgba(147,162,175,.18); border-radius:16px; background:rgba(8,13,18,.91); box-shadow:0 12px 40px rgba(0,0,0,.25); backdrop-filter:blur(18px); }
.workspace-tabs button { min-width:0; padding:12px 10px; }
.workspace-tabs button[aria-selected="true"] { border-color:rgba(67,214,197,.45); background:#147f73; }
.workspace-tabs button[data-load-state="loading"]::after { content:""; width:7px; height:7px; display:inline-block; margin-left:7px; border-radius:50%; background:var(--cyan); box-shadow:0 0 0 4px rgba(67,214,197,.12); animation:load-pulse 1s ease-in-out infinite; }
.tab-count { min-width:19px; height:19px; display:inline-grid; place-items:center; margin-left:4px; padding:0 5px; border:1px solid rgba(67,214,197,.28); border-radius:999px; background:rgba(67,214,197,.14); color:#a9eee6; font-size:10px; font-weight:900; vertical-align:middle; }
.tab-count.good { border-color:rgba(103,212,156,.28); background:rgba(103,212,156,.13); color:#a8ebc7; }
.tab-count.warning { border-color:rgba(255,183,77,.35); background:rgba(255,183,77,.14); color:#ffd18c; }
.tab-count.alert { border-color:rgba(255,102,115,.36); background:#d83b4d; color:#fff; }
.workspace-view { animation:view-in .18s ease-out; }
@keyframes view-in { from { opacity:.35; transform:translateY(5px); } to { opacity:1; transform:none; } }
@keyframes load-pulse { 50% { opacity:.35; transform:scale(.72); } }
.view-load-state { min-height:50px; display:flex; align-items:center; gap:12px; margin-bottom:12px; padding:10px 12px; border:1px solid rgba(67,214,197,.28); border-radius:14px; background:rgba(19,52,55,.58); color:#cbece8; font-size:13px; }
.view-load-state.loading::before { content:""; width:16px; height:16px; flex:0 0 auto; border:2px solid rgba(67,214,197,.24); border-top-color:var(--cyan); border-radius:50%; animation:view-spin .8s linear infinite; }
.view-load-state.error { border-color:rgba(255,102,115,.38); background:rgba(72,28,36,.62); color:#ffd4d8; }
.view-load-state button { margin-left:auto; padding:7px 10px; white-space:nowrap; }
@keyframes view-spin { to { transform:rotate(360deg); } }
.overview-metrics { margin-bottom:14px; }
.overview-focus { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.overview-focus article { min-height:164px; display:flex; flex-direction:column; padding:19px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(145deg,rgba(20,30,40,.98),rgba(10,18,24,.98)); }
.overview-focus article.attention { border-color:rgba(255,102,115,.34); background:linear-gradient(145deg,rgba(72,28,36,.62),rgba(13,20,27,.98)); }
.overview-focus article.good { border-color:rgba(103,212,156,.3); }
.overview-focus .focus-label { color:var(--muted); font-size:10px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.overview-focus strong { margin:12px 0 4px; font-size:31px; letter-spacing:-.03em; }
.overview-focus small { color:var(--muted); line-height:1.45; }
.overview-focus button { margin-top:auto; align-self:flex-start; padding:7px 10px; }
.overview-loading { grid-column:1/-1; color:var(--muted); }
.overview-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:14px; }
.overview-actions button { min-height:82px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:5px; border-color:var(--line); background:#111b24; text-align:left; }
.overview-actions span { color:var(--cyan); font-size:10px; letter-spacing:.12em; text-transform:uppercase; }
.overview-actions strong { font-size:14px; }
.workspace-view > .panel,.workspace-view > .workspace { margin-bottom:0; }
.workspace-view .listing-analytics-panel,.workspace-view .inbox-panel { min-height:calc(100vh - 245px); }
.workspace-view .conversation-list { max-height:calc(100vh - 390px); }
.workspace-view .listing-analytics-list { max-height:calc(100vh - 520px); overflow:auto; padding-right:4px; }
.workspace-view .vehicle-list,.workspace-view .lead-list { max-height:calc(100vh - 385px); }

.planned-workspace { max-width:1120px; margin:0 auto; }
.planned-hero { display:flex; align-items:center; gap:22px; min-height:220px; padding:30px; border:1px solid rgba(135,120,255,.35); border-radius:24px; background:radial-gradient(circle at 90% 0,rgba(135,120,255,.23),transparent 34%),linear-gradient(145deg,#1d1a31,#0c131a); }
.planned-hero h2 { margin:6px 0 9px; font-size:clamp(28px,4vw,44px); }
.planned-hero p:last-child { max-width:720px; color:var(--muted); line-height:1.55; }
.planned-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:14px; }
.planned-grid article { min-height:180px; display:flex; flex-direction:column; gap:9px; padding:20px; border:1px solid var(--line); border-radius:18px; background:#111922; }
.planned-grid article > span { color:#8d80ff; font-size:12px; font-weight:950; }
.planned-grid strong { font-size:17px; }
.planned-grid small { color:var(--muted); line-height:1.45; }

@media (max-width:1000px) {
  .overview-focus,.overview-actions,.planned-grid { grid-template-columns:repeat(2,1fr); }
  .workspace-tabs { overflow:auto; grid-template-columns:repeat(5,minmax(140px,1fr)); }
}
@media (max-width:760px) {
  .top-actions { gap:6px; }
  .top-actions > button { padding:8px 10px; font-size:12px; }
  .top-actions > .badge { padding:7px 9px; font-size:11px; }
  .account-gate { margin-top:1vh; }
  .account-grid { grid-template-columns:1fr; }
  .account-card { min-height:285px; padding:20px; }
  .account-card-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .account-context { align-items:flex-start; padding:15px; }
  .account-context-actions { align-items:flex-end; flex-direction:column; }
  .source-health { position:static; }
  .source-health-menu { top:calc(100% + 8px); right:0; grid-template-columns:1fr; }
  .source-health-head { align-items:flex-start; flex-direction:column; gap:3px; }
  .source-health-head small { text-align:left; }
  .source-health-item { min-height:68px; }
  .workspace-tabs { top:6px; grid-template-columns:repeat(3,minmax(0,1fr)); overflow:visible; margin-left:-8px; margin-right:-8px; border-radius:13px; }
  .workspace-tabs button { padding:10px 5px; font-size:12px; }
  .overview-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; overflow:visible; padding-bottom:0; }
  .overview-metrics .metric { min-width:0; padding:12px 10px; }
  .overview-metrics .metric strong { font-size:23px; }
  .overview-metrics .eyebrow { font-size:8px; letter-spacing:.1em; }
  .overview-focus,.overview-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .planned-grid { grid-template-columns:1fr; }
  .overview-focus article { min-height:190px; padding:15px; }
  .overview-focus strong { font-size:24px; }
  .overview-focus button { padding:7px 8px; font-size:11px; }
  .planned-hero { align-items:flex-start; flex-direction:column; padding:22px; }
  .workspace-view .conversation-list,.workspace-view .listing-analytics-list,.workspace-view .vehicle-list,.workspace-view .lead-list { max-height:none; }
}
