/* ════════════════════════════════════════════════
   EC2 Control Portal — styles.css
   CloudPilot-inspired light theme
   Responsive: Desktop → Tablet (≤1024px) → Mobile (≤768px) → Small (≤480px)
════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg:    #f1f5fb;
  --bg2:   #e8edf8;
  --white: #ffffff;
  --s2:    #f6f8ff;
  --bd:    #dde4f2;
  --bd2:   #c8d3e9;

  /* Sidebar */
  --navy:  #122c53;
  --navy2: #0f1e38;
  --navy3: #162448;

  /* Text */
  --ink:  #0d1b3e;
  --ink2: #2d4070;
  --ink3: #4e6cb3;
  --ink4: #8fa5cc;

  /* Accents */
  --blue:   #2460e0;
  --blue2:  #3b7fff;
  --blue3:  #93bbff;
  --bdim:   rgba(37,99,235,.08);
  --bglow:  rgba(37,99,235,.2);

  --green:  #059669;
  --green2: #10b981;
  --gdim:   rgba(5,150,105,.08);
  --gglow:  rgba(5,150,105,.18);

  --red:    #dc2626;
  --red2:   #ef4444;
  --rdim:   rgba(220,38,38,.07);

  --amber:  #d97706;
  --amber2: #f59e0b;
  --adim:   rgba(217,119,6,.09);

  --cyan:   #0891b2;
  --cyan2:  #06b6d4;
  --cdim:   rgba(8,145,178,.09);

  --violet: #7c3aed;
  --vdim:   rgba(124,58,237,.08);

  /* Fonts */
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Mono', monospace;

  /* Layout */
  --sw: 256px;
  --th: 58px;

  /* Radii */
  --r:   8px;
  --rsm: 5px;
  --rlg: 12px;
  --rxl: 18px;

  /* Shadows */
  --sh:  0 1px 3px rgba(13,27,62,.06), 0 1px 2px rgba(13,27,62,.04);
  --shm: 0 4px 16px rgba(13,27,62,.10), 0 2px 4px rgba(13,27,62,.06);
  --shl: 0 12px 40px rgba(13,27,62,.13), 0 4px 8px rgba(13,27,62,.07);
  --shb: 0 4px 18px rgba(37,99,235,.2);
  --shg: 0 4px 18px rgba(5,150,105,.18);
}

/* ════════ RESET ════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: none;
}
body.ready { display: flex; }
a { cursor: pointer; text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--blue);
}

/* ════════ APP SHELL ════════ */
.app { display: flex; width: 100vw; height: 100vh; overflow: hidden; }

/* ════════ SIDEBAR ════════ */
.sidebar {
  width: var(--sw);
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 30;
  box-shadow: 3px 0 24px rgba(10,22,40,.28);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 24px 24px;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom,
    transparent 8%, rgba(59,127,255,.3) 35%, rgba(59,127,255,.3) 65%, transparent 92%);
}

/* Logo */
.sb-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}
.logo-mark {
  width: 36px; height: 36px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue2), #1e3a8a);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px var(--bglow);
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-name {
  font-size: 15px; font-weight: 800;
  color: #fff; letter-spacing: -.3px; line-height: 1;
}
.logo-tag {
  font-family: var(--mono);
  font-size: 8.5px;
  color: rgba(255,255,255,.4);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 2px;
}
.sb-close-btn {
  display: none;
  margin-left: auto;
  background: none; border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer; padding: 4px;
}
.sb-close-btn svg { width: 18px; height: 18px; }

/* Fleet pulse */
.sb-fleet {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.fleet-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green2);
  box-shadow: 0 0 6px var(--green2);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; } 50% { opacity:.4; }
}
.fleet-label { font-size: 11px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .5px; }
.fleet-val { font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,.75); margin-left: auto; }

/* Nav */
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.nav-section {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
  letter-spacing: .9px;
  padding: 14px 20px 6px;
}
.nitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s, color .15s;
  position: relative;
  user-select: none;
}
.nitem svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nitem:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nitem.on {
  background: rgba(59,127,255,.15);
  color: #fff;
}
.nitem.on::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--blue2);
  border-radius: 0 2px 2px 0;
}
.nbadge {
  margin-left: auto;
  background: var(--blue2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.nbadge-gold { background: var(--amber); }

/* Sidebar footer */
.sb-foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.rbac-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(124,58,237,.2);
  border: 1px solid rgba(124,58,237,.3);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  width: fit-content;
}
.rbac-badge svg { width: 11px; height: 11px; stroke: var(--violet); }
.rbac-badge span { font-size: 10px; font-weight: 700; color: #b79ef5; letter-spacing: .5px; text-transform: uppercase; }
.sb-user {
  display: flex;
  align-items: center;
  gap: 9px;
}
.sb-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue2), #1e3a8a);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sb-uname { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.sb-urole { font-size: 10.5px; color: rgba(255,255,255,.35); text-transform: capitalize; }
.online-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green2);
  margin-left: auto;
  flex-shrink: 0;
}
.btn-logout {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.3);
  padding: 5px;
  border-radius: var(--rsm);
  transition: color .15s;
}
.btn-logout:hover { color: rgba(255,255,255,.7); }
.btn-logout svg { width: 14px; height: 14px; display: block; }

/* ════════ MAIN CONTENT AREA ════════ */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ════════ TOPBAR ════════ */
.topbar {
  height: var(--th);
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--bd);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 20;
  box-shadow: var(--sh);
}
.hamburger {
  display: none;
  background: none; border: none;
  color: var(--ink3);
  cursor: pointer; padding: 4px;
  align-items: center;
}
.hamburger svg { width: 20px; height: 20px; display: block; }
.tb-brand { display: flex; align-items: center; gap: 6px; }
.tb-logo-text { font-size: 14px; font-weight: 700; color: var(--navy); }
.tb-sep { color: var(--bd2); font-size: 16px; }
.tb-page { font-size: 14px; font-weight: 500; color: var(--ink3); }
.tb-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tb-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.pill-cost {
  background: var(--adim);
  color: var(--amber);
  border: 1px solid rgba(217,119,6,.2);
}
.pill-cost svg { width: 12px; height: 12px; stroke: var(--amber); fill: none; }
.pill-sess {
  background: var(--bdim);
  color: var(--blue);
  border: 1px solid rgba(37,99,235,.15);
}
.pill-sess svg { width: 12px; height: 12px; stroke: var(--blue); fill: none; }
.sess-timer { font-family: var(--mono); font-size: 11px; }
.tb-divider { width: 1px; height: 20px; background: var(--bd); }
.tb-clock { font-family: var(--mono); font-size: 12px; color: var(--ink3); }

/* ════════ PAGE CONTENT ════════ */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }

/* Page views */
.pv { display: none; }
.pv.on { display: block; }

/* Page header */
.ph { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.ph-title { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }
.ph-sub { font-size: 13px; color: var(--ink3); margin-top: 3px; }
.ph-r { display: flex; align-items: center; gap: 8px; padding-top: 4px; }

/* ════════ STAT CARDS ════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.scard {
  background: var(--white);
  border-radius: var(--rlg);
  padding: 16px 18px;
  box-shadow: var(--sh);
  border: 1px solid var(--bd);
  position: relative;
  overflow: hidden;
}
.scard-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.scard-ico {
  width: 36px; height: 36px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.scard-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scard-ico.blue   { background: var(--bdim); color: var(--blue); }
.scard-ico.green  { background: var(--gdim); color: var(--green); }
.scard-ico.red    { background: var(--rdim); color: var(--red); }
.scard-ico.amber  { background: var(--adim); color: var(--amber); }
.scard-ico.violet { background: var(--vdim); color: var(--violet); }
.scard-ico.cyan   { background: var(--cdim); color: var(--cyan); }
.scard-trend { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.scard-val { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; line-height: 1; }
.scard-val.green  { color: var(--green); }
.scard-val.red    { color: var(--red); }
.scard-val.amber  { color: var(--amber); }
.scard-val.blue   { color: var(--blue); }
.scard-val.cyan   { color: var(--cyan); }
.scard-lbl { font-size: 12px; font-weight: 600; color: var(--ink2); margin-top: 4px; }
.scard-sub { font-size: 11px; color: var(--ink4); margin-top: 2px; }
.scard-bar { height: 3px; background: var(--bg2); border-radius: 2px; margin-top: 12px; }
.scard-fill          { height: 100%; border-radius: 2px; transition: width .4s; background: var(--blue); }
.scard-fill.green    { background: var(--green); }
.scard-fill.red      { background: var(--red); }
.scard-fill.amber    { background: var(--amber); }

/* ════════ CARDS ════════ */
.card {
  background: var(--white);
  border-radius: var(--rlg);
  border: 1px solid var(--bd);
  box-shadow: var(--sh);
  overflow: hidden;
  margin-bottom: 16px;
}
.card-hd {
  display: flex;
  align-items: center;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--bg2);
  gap: 8px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.card-hint { font-size: 11.5px; color: var(--ink4); margin-left: auto; }
.cdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cdot.blue   { background: var(--blue2); }
.cdot.amber  { background: var(--amber); }
.cdot.green  { background: var(--green); }
.cdot.red    { background: var(--red); }
.cdot.violet { background: var(--violet); }
.cdot.cyan   { background: var(--cyan); }
.cdot.navy   { background: var(--navy); }
.card-body { padding: 14px 18px; }

/* ════════ BUTTONS ════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  font-family: var(--sans);
  line-height: 1;
}
.btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-blue  { background: var(--blue);  color: #fff; border-color: var(--blue);  }
.btn-blue:hover  { background: var(--blue2); border-color: var(--blue2); box-shadow: var(--shb); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: #047857; box-shadow: var(--shg); }
.btn-red   { background: var(--red);   color: #fff; border-color: var(--red);   }
.btn-red:hover   { background: var(--red2); }
.btn-out   { background: transparent; color: var(--ink2); border-color: var(--bd2); }
.btn-out:hover   { background: var(--bg2); border-color: var(--ink3); }
.btn-ghost { background: transparent; color: var(--ink3); border-color: transparent; }
.btn-ghost:hover { background: var(--bg2); }
.btn-sm    { padding: 5px 11px; font-size: 12px; }
.btn-xs    { padding: 3px 8px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.ml-auto { margin-left: auto; }

/* ════════ DASHBOARD GRID ════════ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
}
.dash-list-wrap { overflow-y: auto; max-height: 380px; }
.dash-list-wrap::-webkit-scrollbar { width: 4px; }
.dash-list-wrap::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 2px; }

/* Dash list rows */
.dl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--bg2);
  transition: background .12s;
  cursor: pointer;
}
.dl-row:last-child { border-bottom: none; }
.dl-row:hover { background: var(--s2); }
.dl-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink4);
}
.dl-dot.running { background: var(--green2); box-shadow: 0 0 0 3px var(--gdim); animation: pulse-dot 2s infinite; }
.dl-dot.stopped { background: #b0bcd4; }
.dl-dot.pending { background: var(--amber2); }
.dl-info { flex: 1; min-width: 0; }
.dl-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-meta { font-size: 10.5px; color: var(--ink3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-sep  { font-size: 13px; color: var(--ink4); flex-shrink: 0; }
.dl-btns { display: flex; gap: 5px; flex-shrink: 0; }
.dl-start-btn { display: inline-flex; align-items: center; gap: 4px; }
.dl-start-btn svg { width: 10px; height: 10px; }

/* Inline detail panel row */
.dp-inline-row td { background: var(--bg); }
.dp-inline-row .dp { margin: 0; border-radius: 0; box-shadow: none; border-top: 2px solid var(--blue2); border-bottom: 2px solid var(--blue2); }
.inst-row-selected td { background: var(--bdim) !important; }
.inst-row { cursor: pointer; }

/* State badge */
.sbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.sbadge-dot { width: 5px; height: 5px; border-radius: 50%; }
.sbadge.running  { background: var(--gdim); color: var(--green); }
.sbadge.running .sbadge-dot  { background: var(--green); animation: pulse-dot 2s infinite; }
.sbadge.stopped  { background: var(--rdim); color: var(--red); }
.sbadge.stopped .sbadge-dot  { background: var(--red); }
.sbadge.pending, .sbadge.stopping, .sbadge.starting { background: var(--adim); color: var(--amber); }
.sbadge.pending .sbadge-dot,
.sbadge.stopping .sbadge-dot,
.sbadge.starting .sbadge-dot { background: var(--amber); }

/* Activity feed */
.feed-wrap { padding: 8px 0; max-height: 380px; overflow-y: auto; }
.feed-wrap::-webkit-scrollbar { width: 3px; }
.feed-wrap::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 2px; }
.log-ul { list-style: none; }
.log-li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--bg2);
  font-size: 12px;
}
.log-li:last-child { border-bottom: none; }
.log-t { font-family: var(--mono); font-size: 10.5px; color: var(--ink4); flex-shrink: 0; }
.log-d { width: 5px; height: 5px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.log-d.ok   { background: var(--green); }
.log-d.err  { background: var(--red); }
.log-d.sys  { background: var(--ink4); }
.log-d.warn { background: var(--amber); }
.log-m { flex: 1; color: var(--ink2); line-height: 1.4; }
.lchip { font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; text-transform: uppercase; }
.lchip.ok   { background: var(--gdim); color: var(--green); }
.lchip.err  { background: var(--rdim); color: var(--red); }
.lchip.sys  { background: var(--bdim); color: var(--blue); }
.lchip.warn { background: var(--adim); color: var(--amber); }

/* ════════ INSTANCES PAGE ════════ */
.ag {
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--rlg);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}
.ag-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--s2);
  border-bottom: 1px solid var(--bg2);
  cursor: pointer;
  user-select: none;
}
.ag-hd:hover { background: var(--bg2); }
.ag-arrow { width: 14px; height: 14px; fill: none; stroke: var(--ink3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; flex-shrink: 0; }
.ag-arrow.open { transform: rotate(90deg); }
.ag-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.ag-id   { font-family: var(--mono); font-size: 10.5px; color: var(--ink4); }
.ag-count {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  background: var(--bdim); color: var(--blue);
  padding: 2px 8px; border-radius: 20px;
}
.ag-body.collapsed { display: none; }

.itbl { width: 100%; border-collapse: collapse; }
.itbl th {
  padding: 8px 14px;
  font-size: 11px; font-weight: 600;
  color: var(--ink3);
  text-align: left;
  background: var(--bg2);
  border-bottom: 1px solid var(--bd);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.itbl td {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--bg2);
  vertical-align: middle;
}
.itbl tr:last-child td { border-bottom: none; }
.itbl tr:hover td { background: var(--s2); cursor: pointer; }
.itbl .mono { font-family: var(--mono); font-size: 11.5px; }
.itbl .inst-name { font-weight: 600; }

/* Detail panel */
#dp-wrap { margin-top: 14px; }
.dp {
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--rlg);
  overflow: hidden;
  box-shadow: var(--shm);
  position: relative;
}
.dp-stripe { height: 3px; background: linear-gradient(90deg, var(--blue2), var(--cyan)); }
.dp-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--bg2);
  gap: 12px;
}
.dp-name { font-size: 17px; font-weight: 800; color: var(--ink); }
.dp-id   { font-family: var(--mono); font-size: 11px; color: var(--ink3); margin-top: 2px; }
.dp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.dp-badge.running  { background: var(--gdim); color: var(--green); }
.dp-badge.stopped  { background: var(--rdim); color: var(--red); }
.dp-badge.pending, .dp-badge.stopping, .dp-badge.starting { background: var(--adim); color: var(--amber); }
.dp-sdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dp-badge.running .dp-sdot { animation: pulse-dot 2s infinite; }
.dp-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bg2);
}
.dp-m { background: var(--white); padding: 12px 16px; }
.dp-ml { font-size: 10.5px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.dp-mv { font-size: 13px; font-weight: 600; color: var(--ink); }
.dp-mv.blue   { color: var(--blue); }
.dp-mv.amber  { color: var(--amber); }
.dp-mv.violet { color: var(--violet); }
.mono-sm { font-family: var(--mono); font-size: 11.5px; }
.dp-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--s2);
  border-bottom: 1px solid var(--bg2);
  flex-wrap: wrap;
}
.dp-ctrl-lbl { font-size: 11px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; margin-right: 4px; }
.dp-tags { padding: 12px 16px; }
.dp-tags-lbl { font-size: 10.5px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.tagchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchip {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--bg2); border: 1px solid var(--bd);
  padding: 2px 8px; border-radius: 4px;
  color: var(--ink2);
}

/* ════════ BILLING PAGE ════════ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-lbl { font-size: 10.5px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; }
.fsel {
  padding: 7px 10px;
  border: 1.5px solid var(--bd);
  border-radius: var(--rsm);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--white);
  font-family: var(--sans);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  min-width: 130px;
}
.fsel:focus { border-color: var(--blue2); }
.bill-tbl { width: 100%; border-collapse: collapse; }
.bill-tbl th {
  padding: 9px 14px;
  font-size: 10.5px; font-weight: 600;
  color: var(--ink3);
  text-align: left;
  background: var(--bg2);
  border-bottom: 1px solid var(--bd);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.bill-tbl td { padding: 11px 14px; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--bg2); vertical-align: middle; }
.bill-tbl tr:last-child td { border-bottom: none; }
.bill-tbl .mono { font-family: var(--mono); font-size: 11.5px; }
.cost-hi { font-weight: 700; color: var(--amber); }
.cost-lo { color: var(--ink3); }
.ce-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(8,145,178,.1); color: var(--cyan);
  border: 1px solid rgba(8,145,178,.25);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .3px;
}
.limited-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--adim); color: var(--amber);
  border: 1px solid rgba(217,119,6,.2);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
}
.bill-disclaimer {
  font-size: 11.5px; color: var(--ink3);
  padding: 10px 18px 14px;
  line-height: 1.6;
  border-top: 1px solid var(--bg2);
}
.bill-disclaimer strong { color: var(--ink2); }
.session-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--bg2);
}
.session-row:last-child { border-bottom: none; }
.session-name { font-weight: 600; font-size: 13px; color: var(--ink); flex: 1; min-width: 0; }
.session-type { font-family: var(--mono); font-size: 10.5px; color: var(--ink4); }
.session-cost { font-weight: 700; font-size: 14px; color: var(--amber); margin-left: auto; flex-shrink: 0; }
.session-bar-wrap { width: 80px; height: 4px; background: var(--bg2); border-radius: 2px; flex-shrink: 0; }
.session-bar-fill { height: 100%; background: var(--amber); border-radius: 2px; transition: width .4s; }

/* ════════ BILLING REPORT ════════ */

/* 4-col stat grid for billing */
.billing-stats { grid-template-columns: repeat(4, 1fr) !important; }

/* "Get Cost Update" amber button */
.btn-amber {
  background: var(--amber);
  color: #fff;
  border: none;
}
.btn-amber:hover { background: #b45309; }
.btn-amber svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2; }

/* Filter note */
.bill-filter-note {
  font-size: 11px; color: var(--ink4);
  font-style: italic; padding-bottom: 2px;
  white-space: nowrap;
}

/* Prompt / loading / error states */
.bill-prompt-state, .bill-loading-state, .bill-error-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 40px 24px; text-align: center;
}
.bill-prompt-ico { font-size: 36px; opacity: .6; }
.bill-prompt-msg { font-size: 14px; color: var(--ink2); font-weight: 500; }
.bill-prompt-sub { font-size: 12px; color: var(--ink4); max-width: 420px; line-height: 1.6; }

.bill-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bd);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.bill-loading-msg { font-size: 14px; color: var(--ink2); font-weight: 500; }
.bill-loading-sub { font-size: 11.5px; color: var(--ink4); max-width: 400px; line-height: 1.5; }

.bill-error-ico  { font-size: 30px; }
.bill-error-msg  { font-size: 14px; color: var(--red); font-weight: 600; }
.bill-error-detail { font-size: 12px; color: var(--ink3); max-width: 380px; }

/* Per-account card */
.acct-report-card {
  border-bottom: 1px solid var(--bd);
  padding: 0;
}
.acct-report-card:last-of-type { border-bottom: none; }

.acct-report-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px 10px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bd);
}
.acct-report-name {
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.acct-report-id {
  font-size: 11px; color: var(--ink4);
  font-family: var(--mono);
}

/* Mini cost summary row */
.acct-cost-summary {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--bd);
  overflow-x: auto;
}
.mini-cost-box {
  flex: 1; min-width: 110px;
  padding: 12px 16px;
  border-right: 1px solid var(--bd);
}
.mini-cost-box:last-child { border-right: none; }
.mini-cost-lbl {
  font-size: 10px; color: var(--ink4);
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 4px; font-weight: 600;
}
.mini-cost-val { font-size: 16px; font-weight: 700; font-family: var(--mono); }
.cost-amber { color: var(--amber); }
.cost-cyan  { color: var(--cyan); }
.cost-blue  { color: var(--blue); }
.cost-muted { color: var(--ink3); font-size: 14px; }
.cost-zero  { color: var(--ink4); font-weight: 400; font-size: 13px; }
.cost-num   { font-family: var(--mono); font-size: 12px; color: var(--ink); }

/* Report sections */
.acct-report-sections { padding: 0; }
.report-section {
  border-bottom: 1px solid var(--bd);
  padding: 14px 18px;
}
.report-section:last-child { border-bottom: none; }
.report-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink3);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.report-section-hint {
  font-size: 10.5px; color: var(--ink4);
  font-weight: 400; text-transform: none; letter-spacing: 0;
}
.report-empty-msg { font-size: 12.5px; color: var(--ink4); padding: 4px 0; }

/* Service breakdown bars */
.svc-breakdown { display: flex; flex-direction: column; gap: 2px; }
.svc-bar-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0;
}
.svc-bar-row:hover { background: rgba(255,255,255,.02); }
.svc-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink4); flex-shrink: 0;
}
.ec2-dot { background: var(--amber); }
.svc-bar-name {
  display: flex; align-items: center; gap: 6px;
  width: 170px; flex-shrink: 0;
  font-size: 12.5px; color: var(--ink2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.svc-bar-track {
  flex: 1; height: 7px; background: var(--bg2);
  border-radius: 4px; overflow: hidden;
  min-width: 80px;
}
.svc-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.svc-bar-pct {
  width: 38px; text-align: right; flex-shrink: 0;
  font-size: 11px; color: var(--ink4);
  font-family: var(--mono);
}
.svc-bar-cost {
  width: 80px; text-align: right; flex-shrink: 0;
}

/* EC2 usage type table */
.ut-table-wrap { overflow-x: auto; }
.ut-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.ut-table th {
  padding: 7px 12px; font-size: 10.5px; font-weight: 700;
  color: var(--ink3); text-transform: uppercase; letter-spacing: .4px;
  background: var(--bg2); border-bottom: 1px solid var(--bd); text-align: left;
}
.ut-table td { padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,.03); vertical-align: middle; }
.ut-table tr:last-child td { border-bottom: none; }
.ut-type { font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.ut-cat  { }
.ut-qty  { font-family: var(--mono); font-size: 11.5px; color: var(--ink3); }
.ut-cost { font-family: var(--mono); font-size: 12px; color: var(--amber); font-weight: 600; text-align: right; }
.ut-badge {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.ut-compute { background: rgba(217,119,6,.12); color: var(--amber); }
.ut-storage { background: rgba(8,145,178,.12); color: var(--cyan); }
.ut-network { background: rgba(79,70,229,.12); color: #818cf8; }
.ut-other   { background: var(--bg2); color: var(--ink4); }

/* Daily trend */
.daily-trend-wrap { display: flex; flex-direction: column; gap: 4px; }
.daily-trend-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.daily-trend-date {
  width: 52px; flex-shrink: 0;
  font-size: 11px; color: var(--ink3); font-family: var(--mono);
}
.daily-trend-track {
  flex: 1; height: 6px; background: var(--bg2);
  border-radius: 3px; overflow: hidden;
}
.daily-trend-fill {
  height: 100%; background: var(--amber);
  border-radius: 3px; transition: width .4s;
  opacity: .75;
}
.daily-trend-cost {
  width: 80px; text-align: right; flex-shrink: 0;
}

/* Spin animation for button loading */
.spin-icon { display: inline-block; animation: spin .6s linear infinite; }

/* ════════ ANALYTICS PAGE ════════ */
.an-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
#fleet-ring { padding: 20px; display: flex; align-items: center; justify-content: center; }
.ring-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.ring-center { position: absolute; text-align: center; }
.ring-pct { font-size: 28px; font-weight: 800; color: var(--ink); }
.ring-sub { font-size: 11px; color: var(--ink3); }
.acct-bar-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--bg2);
}
.acct-bar-row:last-child { border-bottom: none; }
.acct-bar-name { font-size: 12.5px; color: var(--ink2); width: 130px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-bar-track { flex: 1; height: 8px; background: var(--bg2); border-radius: 4px; }
.acct-bar-fill  { height: 100%; background: var(--amber); border-radius: 4px; transition: width .4s; }
.acct-bar-val { font-family: var(--mono); font-size: 11.5px; color: var(--amber); font-weight: 600; width: 70px; text-align: right; flex-shrink: 0; }
.type-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.type-chip {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 8px 14px;
  background: var(--cdim); border: 1px solid rgba(8,145,178,.2);
  border-radius: var(--r); gap: 3px;
}
.type-chip-name  { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--cyan); }
.type-chip-count { font-size: 10.5px; color: var(--ink3); }
.cproj-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--bg2);
}
.cproj-row:last-child { border-bottom: none; }
.cproj-name { font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cproj-type { font-family: var(--mono); font-size: 10.5px; color: var(--ink4); flex-shrink: 0; }
.cproj-cost { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--green); flex-shrink: 0; }
.an-act-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--bg2);
}
.an-act-row:last-child { border-bottom: none; }
.an-act-name { flex: 1; font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-act-count { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--blue); width: 30px; text-align: right; flex-shrink: 0; }
.an-act-bar-wrap { width: 80px; height: 4px; background: var(--bg2); border-radius: 2px; flex-shrink: 0; }
.an-act-bar-fill { height: 100%; background: var(--blue); border-radius: 2px; }

/* ════════ AUDIT PAGE ════════ */
.audit-card {
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--rlg);
  box-shadow: var(--sh);
  overflow: hidden;
  margin-bottom: 16px;
}
.audit-toolbar {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  gap: 12px;
  border-bottom: 1px solid var(--bd);
}
.view-toggle {
  display: flex;
  background: var(--bg2);
  border-radius: var(--rsm);
  padding: 3px;
  gap: 2px;
}
.view-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; border: none;
  background: none; color: var(--ink3);
  font-family: var(--sans);
  transition: all .15s;
}
.view-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.view-btn.active { background: var(--white); color: var(--blue); box-shadow: var(--sh); }
.audit-filters {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--bg2);
}
.audit-input {
  padding: 7px 10px;
  border: 1.5px solid var(--bd); border-radius: var(--rsm);
  font-size: 12.5px; color: var(--ink);
  background: var(--white); font-family: var(--sans);
  outline: none; transition: border-color .15s;
  min-width: 160px;
}
.audit-input:focus { border-color: var(--blue2); }
.audit-input-wide { min-width: 240px; }
.audit-select {
  padding: 7px 10px;
  border: 1.5px solid var(--bd); border-radius: var(--rsm);
  font-size: 12.5px; color: var(--ink);
  background: var(--white); font-family: var(--sans);
  outline: none; cursor: pointer;
}
.btn-search {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; background: var(--blue); color: #fff;
  border: none; border-radius: var(--rsm);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: var(--sans); transition: background .15s;
}
.btn-search:hover { background: var(--blue2); }
.btn-search svg { fill: none; stroke: currentColor; stroke-width: 2.2; }
.audit-table-wrap { overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.audit-table th {
  padding: 8px 14px;
  font-size: 10.5px; font-weight: 600; color: var(--ink3);
  text-align: left; background: var(--bg2);
  border-bottom: 1px solid var(--bd);
  text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.audit-table td {
  padding: 9px 14px; border-bottom: 1px solid var(--bg2);
  color: var(--ink); vertical-align: middle;
}
.audit-table tr:last-child td { border-bottom: none; }
.audit-cell-mono { font-family: var(--mono); font-size: 11px; }
.audit-cell-time { white-space: nowrap; color: var(--ink3); }
.audit-cell-user { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-action {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.action-start   { background: var(--gdim); color: var(--green); }
.action-stop    { background: var(--rdim); color: var(--red); }
.action-auto    { background: var(--adim); color: var(--amber); }
.action-neutral { background: var(--bdim); color: var(--blue); }
.action-linked  { background: rgba(6,182,212,.12); color: #0891b2; }
.audit-result {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 10.5px; font-weight: 600;
}
.result-ok  { background: var(--gdim); color: var(--green); }
.result-err { background: var(--rdim); color: var(--red); }
.audit-inst-name { font-weight: 600; font-size: 12.5px; color: var(--ink); }
.audit-inst-id { font-family: var(--mono); font-size: 10.5px; color: var(--ink3); margin-top: 1px; }
.audit-more-row { padding: 12px; text-align: center; }
.btn-load-more {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 16px; background: var(--bdim); color: var(--blue);
  border: 1.5px solid rgba(37,99,235,.2); border-radius: var(--r);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); transition: all .15s;
}
.btn-load-more:hover { background: var(--blue); color: #fff; }
.audit-loading, .audit-empty, .table-empty, .table-empty-block {
  padding: 32px; text-align: center; color: var(--ink4); font-size: 13px;
}
.audit-count { font-size: 11.5px; color: var(--ink3); margin-left: 4px; }

/* Daily Summary — instance picker */
.daily-filter-bar { flex-wrap: wrap; }
.daily-inst-wrap { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 320px; }
.daily-inst-select { flex: 1; min-width: 180px; max-width: 280px; }
.daily-inst-or { font-size: 11px; color: var(--ink4); white-space: nowrap; flex-shrink: 0; }

/* Audit v2 — redesigned filter bar */
.audit-filters-v2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; }
.audit-filter-input-wrap { position: relative; display: flex; align-items: center; }
.audit-filter-icon {
  position: absolute; left: 9px; pointer-events: none;
  fill: none; stroke: var(--ink4); stroke-width: 2; stroke-linecap: round;
}
.audit-filter-input-wrap .audit-input { padding-left: 28px; min-width: 180px; }
.btn-audit-clear {
  padding: 5px 13px; background: transparent; color: var(--ink3);
  border: 1.5px solid var(--bg3); border-radius: var(--r);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--sans);
  transition: all .15s; white-space: nowrap;
}
.btn-audit-clear:hover { background: var(--rdim); color: var(--red); border-color: var(--red); }
.audit-record-count { font-size: 12px; color: var(--ink3); margin-left: 4px; white-space: nowrap; }

/* Audit v2 — table cells */
.audit-cell-instance { min-width: 160px; }
.audit-cell-account  { min-width: 140px; }
.audit-cell-type     { font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.audit-cell-region   { font-family: var(--mono); font-size: 11px; color: var(--ink3); }
.audit-acct-name { font-weight: 600; font-size: 12.5px; color: var(--ink); }
.audit-acct-id   { font-family: var(--mono); font-size: 10.5px; color: var(--ink3); margin-top: 1px; }
.audit-inst-id   { color: var(--blue); }
.audit-cell-center { text-align: center; }

/* Daily summary */
.daily-summary-header { padding: 14px 18px; border-bottom: 1px solid var(--bg2); }
.daily-meta-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.daily-badge {
  padding: 3px 9px; border-radius: 4px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
}
.badge-id   { background: var(--bdim); color: var(--blue); }
.badge-type { background: var(--vdim); color: var(--violet); }
.badge-rate { background: var(--adim); color: var(--amber); }
.daily-totals-row { display: flex; gap: 24px; flex-wrap: wrap; }
.daily-total-label { font-size: 10.5px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; }
.daily-total-val   { font-size: 18px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.running-hrs { color: var(--green); }
.cost-val    { color: var(--amber); }
.daily-table td { font-size: 12.5px; }
.daily-bar-wrap { height: 6px; background: var(--bg2); border-radius: 3px; display: inline-block; width: 80px; vertical-align: middle; margin-right: 6px; }
.daily-bar-fill { height: 100%; background: var(--green); border-radius: 3px; }
.daily-hrs { font-family: var(--mono); font-size: 11px; font-weight: 600; vertical-align: middle; }
.stopped-hrs { color: var(--ink3); }
.daily-events-count { color: var(--ink3); text-align: center; }
.audit-cell-cost { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--amber); }
.audit-cell-center { text-align: center; }
.daily-disclaimer {
  padding: 10px 14px; font-size: 11px; color: var(--ink4);
  background: var(--s2); border-top: 1px solid var(--bg2); line-height: 1.6;
}

/* ════════ ACCOUNTS PAGE ════════ */
.act-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  padding-top: 2px;
}
.act-card {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--rlg); padding: 18px;
  box-shadow: var(--sh); transition: box-shadow .15s;
}
.act-card:hover { box-shadow: var(--shm); }
.act-card-hd { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.act-avatar {
  width: 40px; height: 40px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--blue2), #1e3a8a);
  display: grid; place-items: center; flex-shrink: 0;
}
.act-avatar.central { background: linear-gradient(135deg, var(--green2), #047857); }
.act-avatar svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 1.8; }
.act-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.act-id   { font-family: var(--mono); font-size: 10.5px; color: var(--ink3); margin-top: 2px; }
.act-role-arn { font-family: var(--mono); font-size: 10px; color: var(--ink4); word-break: break-all; margin-bottom: 12px; }
.act-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.act-tag { padding: 2px 8px; border-radius: 4px; font-size: 10.5px; font-weight: 600; }
.act-tag.enabled  { background: var(--gdim); color: var(--green); }
.act-tag.disabled { background: var(--rdim); color: var(--red); }
.act-tag.central  { background: var(--bdim); color: var(--blue); }
.act-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.act-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: var(--rsm);
  font-size: 11.5px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent;
  font-family: var(--sans); transition: all .15s;
}
.act-btn svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.act-btn-test:not(:disabled)    { background: var(--bdim); color: var(--blue); border-color: rgba(37,99,235,.2); }
.act-btn-test:hover:not(:disabled)   { background: var(--blue); color: #fff; }
.act-btn-enable:not(:disabled)  { background: var(--gdim); color: var(--green); border-color: rgba(5,150,105,.2); }
.act-btn-enable:hover:not(:disabled) { background: var(--green); color: #fff; }
.act-btn-disable:not(:disabled) { background: var(--adim); color: var(--amber); border-color: rgba(217,119,6,.2); }
.act-btn-disable:hover:not(:disabled) { background: var(--amber); color: #fff; }
.act-btn-remove:not(:disabled)  { background: var(--rdim); color: var(--red); border-color: rgba(220,38,38,.2); }
.act-btn-remove:hover:not(:disabled)  { background: var(--red); color: #fff; }
.act-btn:disabled { opacity: .4; cursor: not-allowed; }
.acct-toolbar {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 16px;
}
.acct-toolbar-left { display: flex; align-items: center; gap: 8px; }
.acct-toolbar-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.btn-icon-sm {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: none; border: 1.5px solid var(--bd);
  border-radius: var(--rsm); cursor: pointer; color: var(--ink3);
  transition: all .15s;
}
.btn-icon-sm:hover { background: var(--bg2); border-color: var(--ink3); }
.btn-icon-sm svg { fill: none; stroke: currentColor; stroke-width: 2.2; }
.btn-add-account {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; background: var(--blue); color: #fff;
  border: none; border-radius: var(--r);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); transition: background .15s;
}
.btn-add-account:hover { background: var(--blue2); }
.btn-add-account svg { fill: none; stroke: currentColor; stroke-width: 2.5; }
.add-account-form {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: var(--rlg); padding: 18px;
  margin-bottom: 16px; box-shadow: var(--sh);
}
.add-form-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.add-form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.add-form-field-wide { grid-column: 1 / -1; }
.add-form-label { font-size: 11px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; display: block; }
.add-form-input {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--bd); border-radius: var(--rsm);
  font-size: 13px; color: var(--ink);
  background: var(--white); font-family: var(--sans);
  outline: none; transition: border-color .15s;
}
.add-form-input.mono { font-family: var(--mono); font-size: 11.5px; }
.add-form-input:focus { border-color: var(--blue2); }
.add-form-error { font-size: 12px; color: var(--red); min-height: 16px; margin-bottom: 8px; }
.add-form-actions { display: flex; gap: 8px; }
.add-form-hint { font-size: 11.5px; color: var(--ink4); margin-top: 10px; line-height: 1.5; }
.btn-cancel-form {
  padding: 7px 14px; border: 1.5px solid var(--bd2);
  border-radius: var(--r); background: none;
  font-size: 13px; font-weight: 600; color: var(--ink3);
  cursor: pointer; font-family: var(--sans);
}
.btn-submit-form {
  padding: 7px 14px; background: var(--blue); color: #fff;
  border: none; border-radius: var(--r);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); transition: background .15s;
}
.btn-submit-form:hover { background: var(--blue2); }
.acct-loading { padding: 24px; text-align: center; color: var(--ink4); }
.rbac-info-card {
  display: flex; gap: 14px;
  background: var(--bdim); border: 1px solid rgba(37,99,235,.15);
  border-radius: var(--r); padding: 14px 18px; margin-bottom: 16px;
}
.rbac-icon { width: 24px; flex-shrink: 0; color: var(--blue); padding-top: 2px; }
.rbac-icon svg { width: 18px; height: 18px; }
.rbac-info-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.rbac-info-text { font-size: 12px; color: var(--ink2); line-height: 1.6; }
.rbac-tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700; background: var(--navy); color: #fff;
  margin: 0 3px; text-transform: uppercase;
}

/* ════════ MODAL ════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(13,27,62,.45);
  display: none; place-items: center;
  z-index: 100; backdrop-filter: blur(2px);
}
.overlay.open { display: grid; }
.modal {
  background: var(--white); border-radius: var(--rxl);
  width: 480px; max-width: 95vw;
  box-shadow: var(--shl); overflow: hidden;
}
.modal-stripe { height: 3px; background: linear-gradient(90deg, var(--blue2), var(--cyan)); }
.modal-hd { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--bg2); }
.modal-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.modal-sub { font-size: 12px; color: var(--ink3); margin-top: 3px; line-height: 1.5; }
.modal-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--ink3); padding: 4px; border-radius: var(--rsm);
  transition: color .15s; flex-shrink: 0;
}
.modal-close:hover { color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.fg { padding: 14px 20px 0; }
.fl { display: block; font-size: 11px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 5px; }
.finp {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--bd); border-radius: var(--r);
  font-size: 13.5px; color: var(--ink);
  background: var(--white); font-family: var(--sans);
  outline: none; transition: border-color .15s;
}
.finp:focus { border-color: var(--blue2); box-shadow: 0 0 0 3px rgba(59,127,255,.1); }
.fhint { font-size: 11px; color: var(--ink4); margin-top: 4px; }
.merr { min-height: 16px; font-size: 12px; color: var(--red); padding: 6px 20px 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 20px 20px; }

/* ════════ TOAST ════════ */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shl); z-index: 999;
  transform: translateY(100px); opacity: 0;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .25s;
  max-width: 360px; pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.ok   { background: var(--green); color: #fff; }
#toast.err  { background: var(--red);   color: #fff; }
#toast.info { background: var(--blue);  color: #fff; }
#toast.warn { background: var(--amber); color: #fff; }
.toast-ico { font-size: 14px; flex-shrink: 0; }

/* ════════ SIDEBAR BACKDROP ════════ */
.sb-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(13,27,62,.5); z-index: 25;
}

/* ════════ EMPTY STATES ════════ */
.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 36px 20px; gap: 8px;
}
.empty-ico { font-size: 32px; }
.empty-t { font-size: 13.5px; color: var(--ink3); text-align: center; }

/* ════════ SPINNER ════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { animation: spin 1s linear infinite; display: inline-block; }

/* ════════ RESPONSIVE — TABLET ≤1024px ════════ */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dp-metrics { grid-template-columns: repeat(3, 1fr); }
  .an-grid { grid-template-columns: 1fr; }
  .add-form-fields { grid-template-columns: 1fr; }
}

/* ════════ RESPONSIVE — MOBILE ≤768px ════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 30;
  }
  .sidebar.open { transform: translateX(0); }
  .sb-close-btn { display: flex; align-items: center; }
  .sb-backdrop.open { display: block; }
  .hamburger { display: flex; }

  .content { padding: 14px; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dp-metrics { grid-template-columns: repeat(2, 1fr); }
  .ph { flex-direction: column; gap: 10px; }
  .ph-r { align-self: flex-end; }

  .billing-stats { grid-template-columns: 1fr 1fr !important; }

  .audit-filters { flex-direction: column; align-items: stretch; }
  .audit-input, .audit-select, .audit-input-wide { min-width: unset; width: 100%; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-group { width: 100%; }
  .fsel { width: 100%; }

  .act-grid { grid-template-columns: 1fr; }

  .tb-clock { display: none; }
  .tb-divider { display: none; }

  .itbl th:nth-child(5),
  .itbl td:nth-child(5) { display: none; }
}

/* ════════ RESPONSIVE — SMALL ≤480px ════════ */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .billing-stats { grid-template-columns: 1fr !important; }
  .scard-val { font-size: 22px; }
  .pill-cost { display: none; }
  .dp-metrics { grid-template-columns: 1fr; }
  .daily-totals-row { flex-direction: column; gap: 10px; }
  .dash-grid { grid-template-columns: 1fr; }
}
