/* ============================================ */
/* AgentDeck — Theme v2                         */
/* Source of truth: agentdeck-dashboard-v2.html  */
/* ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --ink:    #0b0c0f;
  --ink2:   #12141a;
  --ink3:   #1c1e27;
  --ink4:   #252833;
  --line:   rgba(255,255,255,0.06);
  --line2:  rgba(255,255,255,0.10);
  --teal:   #00d084;
  --teal2:  rgba(0,208,132,0.12);
  --teal3:  rgba(0,208,132,0.06);
  --teal-g: rgba(0,208,132,0.25);
  --amber:  #f5a623;
  --amber2: rgba(245,166,35,0.12);
  --violet: #8b7cf8;
  --violet2:rgba(139,124,248,0.12);
  --text:   #e2e4eb;
  --text2:  #9ca3b0;
  --text3:  #525a6b;
  --dim:    #3d4251;
  --mono:   'JetBrains Mono', monospace;
  --sans:   'DM Sans', system-ui, sans-serif;
  --sb-collapsed: 52px;
  --sb-expanded:  220px;
  --sb-speed:     0.22s;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
}

/* ── SHELL ── */
.shell {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ── SIDEBAR ── */
.sb {
  width: var(--sb-collapsed);
  background: var(--ink2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 0;
  flex-shrink: 0;
  overflow: hidden;
  transition: width var(--sb-speed) cubic-bezier(.4,0,.2,1);
  position: relative;
  z-index: 100;
}

.sb:hover {
  width: var(--sb-expanded);
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
}

/* Logo */
.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px 20px;
  white-space: nowrap;
  width: 100%;
}
.sb-logo-icon {
  width: 30px; height: 30px;
  background: var(--teal);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-logo-icon svg { width: 15px; height: 15px; fill: #052b1a; }
.sb-logo-text {
  font-size: 14px; font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  opacity: 0;
  transition: opacity var(--sb-speed);
}
.sb:hover .sb-logo-text { opacity: 1; }

/* Workspace pill */
.sb-ws {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 16px;
  padding: 7px 9px;
  background: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  width: calc(100% - 16px);
  transition: border-color .15s;
  overflow: hidden;
}
.sb-ws:hover { border-color: var(--line2); }
.sb-ws[data-status="none"] .sb-ws-dot {
  background: var(--line2);
  box-shadow: none;
}
.sb-ws[data-status="pending"] .sb-ws-dot {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245,166,35,0.3);
}
.sb-ws[data-status="synced"] .sb-ws-dot {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal-g);
}
.sb-ws-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal-g);
  flex-shrink: 0;
}
.sb-ws-name {
  font-size: 11px; color: var(--text2); font-weight: 500;
  opacity: 0;
  transition: opacity var(--sb-speed);
  overflow: hidden; text-overflow: ellipsis;
}
.sb:hover .sb-ws-name { opacity: 1; }
.sb-ws-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--text3);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--sb-speed), transform .15s ease;
}
.sb:hover .sb-ws-chevron { opacity: 1; }
.sb-ws[aria-expanded="true"] .sb-ws-chevron {
  transform: rotate(180deg);
}

.workspace-switcher-menu {
  position: absolute;
  top: 92px;
  left: 8px;
  width: calc(var(--sb-expanded) - 16px);
  background: var(--ink2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 160;
}

.workspace-switcher-menu.open {
  display: flex;
}

.workspace-switcher-menu .custom-dropdown-list {
  position: static;
  top: auto;
  left: auto;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.workspace-switcher-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.workspace-switcher-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}

.workspace-switcher-action:hover {
  background: var(--ink3);
  color: var(--text);
}

.workspace-switcher-action i,
.workspace-switcher-action svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.workspace-switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-switcher-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.workspace-switcher-item-name {
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-switcher-item-meta {
  font-size: 10px;
  color: var(--text3);
}

.workspace-switcher-status {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink3);
  color: var(--text3);
  flex-shrink: 0;
}

.workspace-switcher-status.synced {
  color: var(--teal);
  background: var(--teal2);
  border-color: rgba(0,208,132,0.18);
}

.workspace-switcher-status.pending {
  color: var(--amber);
  background: var(--amber2);
  border-color: rgba(245,166,35,0.18);
}

/* Section headers */
.sb-sec {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px;
  margin: 8px 0 3px;
  white-space: nowrap;
  width: 100%;
  min-height: 20px;
}
.sb-sec-line {
  width: 20px; height: 1px;
  background: var(--line2);
  flex-shrink: 0;
  transition: width var(--sb-speed);
}
.sb:hover .sb-sec-line { width: 0; }
.sb-sec-label {
  font-size: 9px; font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .09em;
  opacity: 0;
  transition: opacity var(--sb-speed);
  display: flex; align-items: center; gap: 6px;
}
.sb:hover .sb-sec-label { opacity: 1; }
.sb-sec-badge {
  background: var(--teal2);
  color: var(--teal);
  font-size: 9px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
}
.sb-sec-badge.amber { background: var(--amber2); color: var(--amber); }

/* Nav items */
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: 7px;
  margin: 1px 6px;
  cursor: pointer;
  white-space: nowrap;
  width: calc(100% - 12px);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  color: var(--dim);
  overflow: hidden;
  position: relative;
}
.sb-item:hover {
  background: var(--ink3);
  color: var(--text2);
}
.sb-item.active {
  background: linear-gradient(90deg, rgba(0,208,132,.12), rgba(0,208,132,.05));
  color: var(--teal);
  border-color: rgba(0,208,132,0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.sb-item i,
.sb-item svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  opacity: .65;
  transition: opacity .15s;
  stroke-linejoin: round;
}
.sb-item.active i,
.sb-item.active svg,
.sb-item:hover i,
.sb-item:hover svg { opacity: 1; }
.sb-item-label {
  font-size: 11px; font-weight: 500;
  opacity: 0;
  transition: opacity var(--sb-speed);
  overflow: hidden; text-overflow: ellipsis;
}
.sb:hover .sb-item-label { opacity: 1; }

/* Separator */
.sb-sep {
  width: 24px; height: 1px;
  background: var(--line);
  margin: 6px auto;
  flex-shrink: 0;
  transition: width var(--sb-speed);
}
.sb:hover .sb-sep { width: calc(100% - 24px); }

/* Avatar bottom */
.sb-foot {
  margin-top: auto;
  display: flex; align-items: center;
  gap: 10px;
  padding: 6px 10px;
  width: 100%;
  cursor: pointer;
  border-radius: 7px;
  overflow: hidden;
  transition: background .15s;
}
.sb-foot:hover { background: var(--ink3); }
.sb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: #052b1a;
  flex-shrink: 0;
}
.sb-user {
  opacity: 0;
  transition: opacity var(--sb-speed);
}
.sb:hover .sb-user { opacity: 1; }
.sb-user-name { font-size: 12px; color: var(--text); font-weight: 500; }
.sb-user-role { font-size: 10px; color: var(--text3); margin-top: 1px; }
.sb-foot[aria-expanded="true"] { background: var(--ink3); }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; width: 100%; }

/* TOPBAR */
.top {
  height: 50px;
  display: flex; align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--ink2);
  gap: 12px;
  flex-shrink: 0;
}
.top-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.top-title-icon {
  width: 18px;
  height: 18px;
  color: var(--teal);
  flex-shrink: 0;
}
.top-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.top-ws-badge {
  font-size: 10px; color: var(--text3);
  background: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--mono);
}
.top-ver {
  font-size: 10px; color: var(--teal);
  background: var(--teal2);
  border: 1px solid rgba(0,208,132,0.2);
  border-radius: 20px;
  padding: 2px 9px;
  font-family: var(--mono);
  letter-spacing: .02em;
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ink3);
}
.top-lang-btn {
  border: none;
  background: transparent;
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--mono);
  border-radius: 7px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.top-lang-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.top-lang-btn.active {
  color: #052b1a;
  background: var(--teal);
}
.top-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: background .15s ease, border-color .15s ease;
}
.top-btn:hover {
  background: var(--ink3);
  border-color: var(--line);
}
.search {
  background: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px; color: var(--text3);
  font-family: var(--sans);
  display: flex; align-items: center; gap: 7px;
  width: 190px; cursor: text;
  transition: border-color .15s;
}
.search i,
.search svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--text3);
}
.search:hover { border-color: var(--line2); }
.kbd {
  background: var(--ink4);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-family: var(--mono);
  margin-left: auto;
  color: var(--dim);
}

/* CONTENT */
.body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.body::-webkit-scrollbar { width: 3px; }
.body::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 2px; }

/* STAT TILES */
.stats {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 10px;
}
.stat {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color .2s;
}
.stat:hover { border-color: var(--line2); }
.stat.hero {
  background: var(--ink3);
  border-color: rgba(0,208,132,0.15);
  position: relative;
  overflow: hidden;
}
.stat.hero::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(0,208,132,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.stat-num {
  font-size: 26px; font-weight: 600;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1;
}
.stat-num.teal { color: var(--teal); }
.stat-lbl {
  font-size: 10px; color: var(--text3);
  margin-top: 5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .07em;
}
.stat-sub {
  font-size: 10px; color: var(--text3);
  margin-top: 3px; font-family: var(--mono);
}

/* BENTO */
.bento {
  display: grid;
  grid-template-columns: 2.2fr 1.4fr 1fr;
  gap: 14px;
}

/* CARDS */
.card {
  background: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 0%, rgba(0,208,132,0.025) 0%, transparent 55%);
  pointer-events: none;
}
.card-label {
  font-size: 9px; font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .10em;
  margin-bottom: 14px;
}

/* AGENTS */
.agent {
  display: flex; align-items: center;
  padding: 8px 10px;
  background: var(--ink3);
  border-radius: 8px;
  margin-bottom: 6px;
  gap: 10px;
  transition: background .15s;
}
.agent:last-child { margin-bottom: 0; }
.agent:hover { background: var(--ink4); }
.adot {
  width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
}
.adot.g { background: var(--teal); box-shadow: 0 0 6px var(--teal-g); }
.adot.y { background: var(--amber); box-shadow: 0 0 6px rgba(245,166,35,.4); }
.adot.d { background: var(--dim); }
.ainfo { flex: 1; min-width: 0; }
.aname { font-size: 12px; color: var(--text); font-weight: 500; }
.asub {
  font-size: 10px; color: var(--text3);
  font-family: var(--mono);
  margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.abadge {
  font-size: 10px; padding: 2px 7px;
  border-radius: 5px; font-weight: 500;
  flex-shrink: 0;
}
.abadge.ok   { background: var(--teal2);   color: var(--teal); }
.abadge.warn { background: var(--amber2);  color: var(--amber); }
.abadge.off  { background: rgba(61,66,81,.4); color: var(--dim); }

/* GAUGES */
.gauge-stack { display: flex; flex-direction: column; gap: 14px; }
.gauge-item  { display: flex; align-items: center; gap: 12px; }
.gring {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.gring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.gpct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}
.gname { font-size: 12px; color: var(--text); font-weight: 500; }
.gsub  { font-size: 10px; color: var(--text3); margin-top: 2px; }

/* CONTEXT MINI */
.presets { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.ps {
  font-size: 10px; padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  color: var(--text3);
  cursor: pointer;
  font-family: var(--mono);
  transition: all .15s;
  background: transparent;
  user-select: none;
}
.ps:hover { border-color: rgba(0,208,132,.3); color: var(--text2); }
.ps.on {
  background: var(--teal2);
  border-color: rgba(0,208,132,.35);
  color: var(--teal);
}
.cf-label {
  font-size: 9px; color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 10px 0 5px;
  font-weight: 600;
}
.cf {
  display: flex; align-items: center;
  gap: 7px; padding: 4px 0;
  font-size: 11px; color: var(--text2);
}
.cf input[type="checkbox"] { accent-color: var(--teal); width: 12px; height: 12px; cursor: pointer; }
.cf-divider { height: 1px; background: var(--line); margin: 10px 0; }
.ctx-btn {
  width: 100%; margin-top: 12px;
  padding: 9px;
  background: var(--teal);
  border: none; border-radius: 8px;
  color: #052b1a;
  font-size: 11px; font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  letter-spacing: .02em;
  box-shadow: 0 0 18px rgba(0,208,132,.18), inset 0 0 0 1px rgba(255,255,255,.1);
  transition: box-shadow .2s, transform .1s;
}
.ctx-btn:hover {
  box-shadow: 0 0 28px rgba(0,208,132,.32), inset 0 0 0 1px rgba(255,255,255,.18);
  transform: translateY(-1px);
}
.ctx-btn:active { transform: translateY(0); }

/* FEED */
.feed { display: flex; flex-direction: column; }
.fi {
  display: flex; align-items: flex-start;
  gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.fi:last-child { border-bottom: none; }
.fdot {
  width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
  margin-top: 4px;
}
.ftext { flex: 1; font-size: 11px; color: var(--text2); line-height: 1.45; }
.ftime {
  font-size: 10px; color: var(--text3);
  font-family: var(--mono);
  white-space: nowrap;
  margin-top: 2px;
}
