/* ============================================================
 * Mind Miami · Agency OS — app stylesheet
 * Extends colors_and_type.css with app-shell + module styles.
 * Dark mode canonical. Teal accent. No glassmorphism, no gradients
 * beyond the two allowed (brand wordmark, banner cards).
 * ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--mm-teal); text-decoration: none; }
a:hover { color: var(--teal-light); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* runtime accent (matches portal token names) */
:root {
  --accent: var(--mm-teal);
  --accent-strong: var(--teal-dark);
  --accent-dim: rgba(52, 206, 198, 0.16);
  --accent-border: rgba(52, 206, 198, 0.30);
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0; z-index: 90;
  height: 60px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  gap: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 800;
  text-transform: uppercase; letter-spacing: 2px; font-size: 16px;
}
.brand .bolt {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--mm-navy); border: 1.5px solid var(--mm-teal);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand .bolt img { width: 20px; height: 20px; }
.brand .dot { color: var(--mm-teal); }
.brand .product { font-size: 10.5px; letter-spacing: 1.5px; color: var(--fg-hint); font-weight: 600; }

.topbar .center {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
}
.topbar .center i { color: var(--fg-hint); font-size: 12px; }
.topbar .center input {
  background: transparent; border: none; outline: none;
  color: var(--fg-1); width: 100%;
  font-size: 13px;
}
.topbar .center kbd {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--bg-3); padding: 2px 6px; border-radius: 4px;
  color: var(--fg-hint); border: 1px solid var(--border);
}

.tb-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; position: relative; transition: all .15s;
}
.icon-btn:hover { border-color: var(--mm-teal); color: var(--mm-teal); }
.icon-btn.active { background: var(--accent-dim); color: var(--mm-teal); border-color: var(--accent-border); }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.lang-toggle {
  display: inline-flex; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px;
}
.lang-toggle button {
  background: transparent; border: none; color: var(--fg-muted);
  padding: 4px 10px; border-radius: 999px; font-size: 10.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
}
.lang-toggle button.active { background: var(--mm-teal); color: var(--mm-navy); }

.role-toggle {
  display: inline-flex; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px;
}
.role-toggle button {
  background: transparent; border: none; color: var(--fg-muted);
  padding: 5px 13px; border-radius: 999px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.role-toggle button.active { background: var(--mm-teal); color: var(--mm-navy); }

.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px; background: var(--bg-2);
  border-radius: 999px; border: 1px solid var(--border);
  font-size: 12px; cursor: pointer;
}
.user-chip:hover { border-color: var(--mm-teal); }
.user-chip .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--mm-teal); color: var(--mm-navy);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
}
.user-chip .nm { color: var(--fg-1); font-weight: 600; font-size: 12.5px; line-height: 1.2; }
.user-chip .ro { color: var(--mm-teal); font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }

/* ===== APP SHELL ===== */
.shell { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 240px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  position: sticky; top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 14px 10px 80px;
}
.sb-section {
  font-size: 10px; color: var(--fg-hint);
  text-transform: uppercase; letter-spacing: 1.2px;
  font-weight: 700; padding: 16px 14px 6px;
}
.sb-tab {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: var(--fg-muted);
  border: none; background: none;
  border-radius: 9px; border-left: 3px solid transparent;
  text-align: left; width: 100%; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.sb-tab i { font-size: 13px; width: 18px; text-align: center; color: var(--mm-teal); }
.sb-tab .count {
  margin-left: auto; font-size: 10.5px; color: var(--fg-hint);
  background: var(--bg-2); padding: 1px 8px; border-radius: 999px; font-weight: 700;
}
.sb-tab .count.danger { background: var(--danger-dim); color: var(--danger); }
.sb-tab:hover { color: var(--fg-1); background: var(--bg-2); }
.sb-tab.active {
  color: var(--mm-teal);
  background: var(--accent-dim);
  border-left-color: var(--mm-teal);
}
.sb-tab.active .count { background: var(--mm-teal); color: var(--mm-navy); }

.sb-foot {
  position: fixed; bottom: 0; left: 0; width: 240px;
  background: var(--bg-1); border-top: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 11px; color: var(--fg-hint);
  display: flex; align-items: center; gap: 8px;
}
.sb-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.sb-foot .gm { color: var(--mm-teal); font-weight: 600; font-family: var(--font-display); letter-spacing: 1px; }

.main {
  flex: 1; min-width: 0;
  padding: 22px 30px 80px;
  max-width: 1500px;
}

/* ===== PAGE HEADER ===== */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  letter-spacing: -0.4px; line-height: 1.1;
}
.page-head .sub {
  font-size: 13.5px; color: var(--fg-muted); margin-top: 6px;
  max-width: 720px;
}
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .crumbs {
  font-size: 11px; color: var(--fg-hint);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.page-head .crumbs a { color: var(--mm-teal); }
.page-head .crumbs .sep { color: var(--fg-hint); }

/* ===== CARDS ===== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.card.compact { padding: 14px 16px; }
.card.flush   { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 9px;
}
.card-head h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mm-teal); }
.card-head h3 i { color: var(--mm-teal); font-size: 13px; }
.card-head .right { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-muted); }

.eyebrow {
  font-size: 10.5px; color: var(--fg-hint);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}

/* ===== GRID ===== */
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1280px) {
  .g-5 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1080px) {
  .g-4, .g-5 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: 1fr; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; font-size: 12.5px;
  font-weight: 500; border: 1px solid var(--border-mid);
  background: var(--bg-2); color: var(--fg-1); cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: var(--mm-teal); color: var(--mm-teal); }
.btn.primary {
  background: var(--mm-teal); color: var(--mm-navy);
  border-color: var(--mm-teal); font-weight: 600;
}
.btn.primary:hover { background: var(--teal-light); color: var(--mm-navy); border-color: var(--teal-light); }
.btn.ghost { background: transparent; }
.btn.danger {
  background: transparent; border-color: rgba(224,90,90,0.4); color: var(--danger);
}
.btn.danger:hover { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.btn.icon-only { padding: 7px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover { border-color: var(--border-mid); color: var(--fg-1); }

/* ===== PILLS ===== */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  white-space: nowrap; border: 1px solid;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.teal   { background: var(--accent-dim); color: var(--mm-teal); border-color: var(--accent-border); }
.pill.warn   { background: var(--warn-dim); color: var(--warn); border-color: rgba(240,192,96,0.3); }
.pill.danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(224,90,90,0.3); }
.pill.info   { background: var(--info-dim); color: var(--info); border-color: rgba(124,198,232,0.3); }
.pill.pink   { background: rgba(237,77,138,0.16); color: #ED4D8A; border-color: rgba(237,77,138,0.3); }
.pill.gold   { background: rgba(224,181,137,0.15); color: #E0B589; border-color: rgba(224,181,137,0.3); }
.pill.purple { background: rgba(167,139,250,0.18); color: #a78bfa; border-color: rgba(167,139,250,0.3); }
.pill.success { background: var(--success-dim); color: var(--success); border-color: var(--accent-border); }
.pill.muted  { background: rgba(255,255,255,0.06); color: var(--fg-muted); border-color: var(--border-mid); }
.pill.solid  { background: var(--mm-teal); color: var(--mm-navy); border-color: var(--mm-teal); }

/* ===== KPI CARD ===== */
.kpi {
  position: relative; overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: 13px;
  padding: 16px 18px;
}
.kpi .bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--mm-teal);
}
.kpi.warn .bar  { background: var(--warn); }
.kpi.danger .bar  { background: var(--danger); }
.kpi.info .bar  { background: var(--info); }
.kpi.gold .bar  { background: #E0B589; }
.kpi.pink .bar  { background: #ED4D8A; }
.kpi .lbl {
  font-size: 10px; color: var(--fg-hint);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.kpi .val { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11.5px; margin-top: 8px; color: var(--fg-muted); display: flex; align-items: center; gap: 6px; }
.kpi .sub.up { color: var(--success); }
.kpi .sub.dn { color: var(--danger); }
.kpi .progress {
  height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 999px; margin-top: 10px; overflow: hidden;
}
.kpi .progress > div { height: 100%; background: var(--mm-teal); border-radius: 999px; }

/* ===== INPUTS — HACKING TERMINAL STYLE ===== */
.field {
  display: block; margin-bottom: 14px; position: relative;
}
.field label, .label {
  display: block;
  font-size: 10px; color: var(--mm-teal);
  text-transform: uppercase; letter-spacing: 1.4px; font-weight: 700;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  opacity: 0.85;
}
.field label::before, .label::before {
  content: "$ ";
  color: var(--mm-teal);
  opacity: 0.6;
}
.field .hint {
  font-size: 11px; color: var(--fg-hint); margin-top: 6px; font-weight: 400;
  text-transform: none; letter-spacing: 0;
  font-family: var(--font-mono);
}
.field .hint::before {
  content: "// ";
  color: var(--mm-teal);
  opacity: 0.5;
}

input[type="text"], input[type="email"], input[type="number"],
input[type="date"], input[type="password"], input[type="search"],
input[type="tel"], input[type="url"], select, textarea {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid rgba(52, 206, 198, 0.18);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--fg-1);
  font-size: 13px;
  font-family: var(--font-mono);
  transition: border-color .15s, box-shadow .15s;
}
/* Inputs inside .field get the › chevron prefix and extra left padding */
.field input[type="text"], .field input[type="email"], .field input[type="number"],
.field input[type="date"], .field input[type="password"], .field input[type="search"],
.field input[type="tel"], .field input[type="url"], .field select, .field textarea {
  padding-left: 28px;
}
input::placeholder, textarea::placeholder {
  color: var(--fg-hint);
  font-family: var(--font-mono);
  opacity: 0.7;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mm-teal);
  box-shadow: 0 0 0 3px rgba(52, 206, 198, 0.08), inset 0 0 12px rgba(52, 206, 198, 0.04);
}
input:focus + .field-prompt, textarea:focus + .field-prompt { color: var(--mm-teal); }

/* Caret / prompt prefix on inputs via field wrapper */
.field { position: relative; }
.field input, .field textarea, .field select { padding-left: 28px; }
.field::before {
  content: "›";
  position: absolute;
  left: 11px;
  bottom: 12px;
  font-family: var(--font-mono);
  color: var(--mm-teal);
  font-weight: 700;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}
.field textarea ~ ::before, .field:has(textarea)::before {
  bottom: auto; top: 38px;
}

/* if label is present push the chevron down to align with input baseline */
.field:has(label)::before {
  bottom: 12px;
}
.field:has(textarea):has(label)::before {
  bottom: auto;
  top: 38px;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

/* Compact / chrome-free input variant (used in inline filter bars) */
.card.compact input[type="search"],
.card.compact input[type="text"] {
  background: transparent;
  border: none;
  padding-left: 0;
  font-family: var(--font-body);
}

/* Checkbox styling */
.checkbox-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  font-family: var(--font-mono);
}
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--mm-teal); cursor: pointer;
}
.checkbox-row label {
  margin: 0; text-transform: none; letter-spacing: 0;
  font-size: 13px; color: var(--fg-1); font-weight: 400; cursor: pointer;
  font-family: var(--font-body);
}
.checkbox-row label::before { content: ""; }

/* Native date picker indicator — make it teal */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(72%) sepia(60%) saturate(440%) hue-rotate(126deg) brightness(95%);
  cursor: pointer;
  opacity: 0.7;
}

/* Select chevron — already overridden, restyle */
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%2334cec6' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}

/* Modal head — terminal-style frame */
.modal {
  position: relative;
}
.modal::before {
  content: "MIND_MIAMI/AGENCY_OS";
  position: absolute; top: 14px; right: 60px;
  font-family: var(--font-mono); font-size: 9.5px;
  color: var(--mm-teal); opacity: 0.4;
  letter-spacing: 1.5px;
  pointer-events: none;
}
.modal-head h2 {
  font-family: var(--font-display);
  position: relative;
  display: inline-block;
}
.modal-head h2::after {
  content: "_";
  color: var(--mm-teal);
  margin-left: 6px;
  font-weight: 400;
  animation: blink 1s steps(2, start) infinite;
  opacity: 0.7;
}
.modal-head .sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.modal-head .sub::before {
  content: "// ";
  color: var(--mm-teal);
  opacity: 0.5;
}

/* Modal footer button row — terminal hint */
.modal-foot {
  position: relative;
}
.modal-foot::before {
  content: "[ESC] cancel · [⏎] confirm";
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--fg-hint);
  letter-spacing: 1px;
  opacity: 0.5;
}

/* Buttons inside modals stay readable */
.modal-foot .btn { font-family: var(--font-body); }

/* Wizard tabs — terminal-style numbered */
.wizard-tabs button {
  font-family: var(--font-mono);
  letter-spacing: 1.2px;
}
.wizard-tabs button .n {
  font-family: var(--font-mono);
}

/* Range / focus indicator on focused field — outer ring */
.field input:focus, .field select:focus, .field textarea:focus {
  box-shadow: 0 0 0 1px var(--mm-teal), 0 0 18px rgba(52, 206, 198, 0.12), inset 0 0 6px rgba(52, 206, 198, 0.04);
}

/* ===== TABLES ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 700; color: var(--fg-hint);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.9px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.tbl td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg-2);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; cursor: default; }
.tbl tbody tr:hover td { background: var(--bg-3); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl td b { color: var(--fg-1); font-weight: 600; }
.tbl td .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-hint); }
.tbl .num { font-variant-numeric: tabular-nums; font-family: var(--font-display); font-weight: 700; color: var(--fg-1); }

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center; padding: 60px 24px;
  color: var(--fg-muted); font-size: 13px;
}
.empty i { font-size: 34px; color: var(--fg-hint); margin-bottom: 14px; display: block; }
.empty h3 { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--fg-1); margin-bottom: 6px; }
.empty p { max-width: 380px; margin: 0 auto 14px; line-height: 1.55; }

/* ===== CLIENT AVATAR ===== */
.cl-av {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--mm-navy);
  flex-shrink: 0;
}
.cl-av.sm { width: 24px; height: 24px; font-size: 10.5px; border-radius: 7px; }
.cl-av.lg { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
.cl-av.xl { width: 64px; height: 64px; font-size: 20px; border-radius: 14px; }
.cl-name { display: inline-flex; align-items: center; gap: 10px; }
.cl-name .info { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.cl-name .info b { font-size: 13px; color: var(--fg-1); font-weight: 600; }
.cl-name .info span { font-size: 10.5px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }

.member-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-dim); color: var(--mm-teal);
  border: 1px solid var(--accent-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
}
.member-av.sm { width: 22px; height: 22px; font-size: 9px; }

/* ===== SERVICE CHIP ===== */
.svc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 5px;
  background: var(--bg-3); color: var(--fg-2);
  border: 1px solid var(--border);
}
.svc-chip i { font-size: 9px; color: var(--mm-teal); }

/* ===== STATUS DOT ===== */
.s-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.s-dot.active { background: var(--success); box-shadow: 0 0 0 3px rgba(52,206,198,0.18); }
.s-dot.warn { background: var(--warn); }
.s-dot.danger { background: var(--danger); }
.s-dot.muted { background: var(--fg-hint); }

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline .step {
  position: relative;
  padding: 0 0 20px 0;
}
.timeline .step:last-child { padding-bottom: 0; }
.timeline .step::before {
  content: ""; position: absolute; left: -22px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--border-mid);
}
.timeline .step.done::before { background: var(--mm-teal); border-color: var(--mm-teal); }
.timeline .step.active::before { background: var(--bg-2); border-color: var(--mm-teal); box-shadow: 0 0 0 3px var(--accent-dim); }
.timeline .step.warn::before { background: var(--warn); border-color: var(--warn); }
.timeline .step .when { font-size: 10.5px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.timeline .step .title { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin: 2px 0 4px; }
.timeline .step .body { font-size: 12.5px; color: var(--fg-muted); line-height: 1.55; }

/* ===== KANBAN ===== */
.kanban {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  align-items: start;
}
@media (max-width: 1080px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
.kan-col {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 13px; padding: 12px; min-height: 240px;
}
.kan-col.drag-over { border-color: var(--mm-teal); background: var(--accent-dim); }
.kan-col header {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  margin-bottom: 10px; padding: 0 4px;
}
.kan-col header .left { display: flex; align-items: center; gap: 9px; }
.kan-col header .count {
  background: var(--bg-3); color: var(--fg-muted);
  font-size: 11px; font-weight: 700; padding: 1px 8px;
  border-radius: 999px; font-family: var(--font-body);
}
.kan-col header .dot { width: 8px; height: 8px; border-radius: 50%; }
.kan-col.todo header .dot { background: var(--fg-muted); }
.kan-col.doing header .dot { background: var(--info); }
.kan-col.review header .dot { background: var(--warn); }
.kan-col.done header .dot { background: var(--mm-teal); }

.kan-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; margin-bottom: 8px;
  cursor: grab; transition: all .15s;
}
.kan-card:hover { border-color: var(--mm-teal); transform: translateY(-1px); }
.kan-card:active { cursor: grabbing; }
.kan-card .title { font-size: 13px; color: var(--fg-1); line-height: 1.4; margin-bottom: 8px; }
.kan-card .row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--fg-muted); gap: 6px; }
.kan-card .row .l { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow: hidden; }
.kan-card .row .l .cltag { font-family: var(--font-display); font-weight: 700; color: var(--fg-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.kan-card .row .r { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.kan-card .prio { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.kan-card .prio.high { background: var(--danger); }
.kan-card .prio.med  { background: var(--warn); }
.kan-card .prio.low  { background: var(--fg-muted); }
.kan-card .due.overdue { color: var(--danger); font-weight: 600; }

/* ===== CONTRACT ROW ===== */
.con-row {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 13px; padding: 16px 18px; margin-bottom: 10px;
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  align-items: center; cursor: pointer; transition: all .15s;
}
.con-row:hover { border-color: var(--mm-teal); background: var(--bg-3); }
.con-row .head { display: flex; align-items: flex-start; gap: 14px; }
.con-row .doc {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-dim); color: var(--mm-teal);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.con-row .nm { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.con-row .meta {
  font-size: 11.5px; color: var(--fg-muted);
  margin-top: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.con-row .meta .id { font-family: var(--font-mono); color: var(--fg-hint); font-size: 11px; }
.con-row .services { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.con-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.con-row .amt { font-family: var(--font-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.con-row .amt-lbl { font-size: 10.5px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
.con-row .progress-wrap { width: 200px; }
.con-row .progress-bar {
  height: 5px; background: rgba(255,255,255,0.06);
  border-radius: 999px; overflow: hidden;
}
.con-row .progress-bar > div { height: 100%; background: var(--mm-teal); border-radius: 999px; }
.con-row .progress-info { display: flex; justify-content: space-between; margin-top: 5px; font-size: 10.5px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }

/* ===== CLIENT CARD ===== */
.client-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; cursor: pointer;
  transition: all .15s;
}
.client-card:hover { border-color: var(--mm-teal); }
.client-card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.client-card .nm { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.client-card .ind { font-size: 10.5px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; margin-top: 2px; }
.client-card .health {
  margin-left: auto; text-align: right;
}
.client-card .health .v { font-family: var(--font-display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.client-card .health .lbl { font-size: 9.5px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.client-card .stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 10px 0;
}
.client-card .stat .l { font-size: 9px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.client-card .stat .v { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--fg-1); margin-top: 4px; font-variant-numeric: tabular-nums; }
.client-card .stat .v.sm { font-size: 13px; }
.client-card .svc-row { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }

/* ===== DASHBOARD WIDGETS ===== */
.risk-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.risk-row:last-child { border-bottom: none; }
.risk-row .icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.risk-row .icon.danger { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(224,90,90,0.3); }
.risk-row .icon.warn { background: var(--warn-dim); color: var(--warn); border: 1px solid rgba(240,192,96,0.3); }
.risk-row .icon.info { background: var(--info-dim); color: var(--info); border: 1px solid rgba(124,198,232,0.3); }
.risk-row .body .t { font-size: 13px; color: var(--fg-1); font-weight: 600; }
.risk-row .body .s { font-size: 11.5px; color: var(--fg-muted); margin-top: 2px; }
.risk-row .body .s b { color: var(--fg-1); font-weight: 600; }

.activity-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.activity-row:last-child { border-bottom: none; }
.activity-row .body { color: var(--fg-2); line-height: 1.5; }
.activity-row .body b { color: var(--fg-1); font-weight: 600; }
.activity-row .when { font-size: 10.5px; color: var(--fg-hint); white-space: nowrap; }

/* ===== STRATEGIST / CMO CALLOUT ===== */
.cmo-note {
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--teal-deep) 100%);
  border: 1px solid var(--accent-border);
  border-radius: 13px; padding: 16px 18px;
  margin-bottom: 14px; display: flex; gap: 14px;
}
.cmo-note .av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--mm-teal); color: var(--mm-navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
  font-family: var(--font-display); font-size: 12px;
}
.cmo-note .quote { font-size: 13px; color: var(--fg-2); line-height: 1.6; }
.cmo-note .quote b { color: var(--mm-teal); font-weight: 600; }

/* ===== MODAL & DRAWER ===== */
.modal-back {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  animation: fade .15s ease;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 760px;
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal.sm { max-width: 440px; }
.modal.lg { max-width: 980px; }
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
}
.modal-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.modal-head .sub { font-size: 12.5px; color: var(--fg-muted); margin-top: 4px; }
.modal-head .close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--fg-muted); display: flex; align-items: center; justify-content: center;
}
.modal-head .close:hover { color: var(--danger); border-color: var(--danger); }
.modal-body {
  padding: 20px 24px; overflow-y: auto; flex: 1;
}
.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  display: flex; justify-content: flex-end; gap: 10px;
}

.drawer-back { animation: fade .15s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1000;
  width: 100%; max-width: 720px;
  background: var(--bg-1);
  border-left: 1px solid var(--border-mid);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== AI ASSISTANT ===== */
.fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--mm-teal); color: var(--mm-navy);
  border: none; cursor: pointer;
  box-shadow: var(--shadow-glow-teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; transition: transform .15s;
}
.fab:hover { transform: scale(1.08); }
.fab .badge {
  position: absolute; top: -2px; right: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--mm-navy); color: var(--mm-teal);
  border: 2px solid var(--mm-teal);
  font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.ai-panel {
  position: fixed; bottom: 92px; right: 24px; z-index: 81;
  width: 400px;
  max-height: calc(100vh - 120px);
  background: var(--bg-1);
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ai-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
}
.ai-head .av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); border: 1.5px solid var(--mm-teal);
  display: flex; align-items: center; justify-content: center;
  color: var(--mm-teal); font-size: 14px;
}
.ai-head .nm { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.ai-head .st { font-size: 10.5px; color: var(--success); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.ai-head .st .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.ai-head .close {
  margin-left: auto;
  width: 28px; height: 28px; border-radius: 7px;
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-muted); display: flex; align-items: center; justify-content: center;
}
.ai-head .close:hover { color: var(--danger); border-color: var(--danger); }

.ai-body { padding: 14px 18px; overflow-y: auto; flex: 1; }
.ai-msg { margin-bottom: 14px; }
.ai-msg .who { font-size: 10px; color: var(--fg-hint); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; margin-bottom: 4px; }
.ai-msg .bubble {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 13px;
  color: var(--fg-1);
  line-height: 1.55;
  white-space: pre-wrap;
}
.ai-msg.me .who { text-align: right; }
.ai-msg.me .bubble { background: var(--accent-dim); border-color: var(--accent-border); margin-left: 30px; }
.ai-msg.assistant .bubble { margin-right: 30px; }
.ai-msg.thinking .bubble { display: inline-flex; gap: 4px; align-items: center; padding: 12px 16px; }
.ai-msg.thinking .bubble span { width: 6px; height: 6px; border-radius: 50%; background: var(--mm-teal); opacity: 0.4; animation: pulse 1s infinite; }
.ai-msg.thinking .bubble span:nth-child(2) { animation-delay: 0.2s; }
.ai-msg.thinking .bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 100% { opacity: 0.3; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }

.ai-chips { padding: 0 18px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.ai-chips button {
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--fg-2); border-radius: 999px;
  padding: 5px 11px; font-size: 11px;
}
.ai-chips button:hover { border-color: var(--mm-teal); color: var(--mm-teal); }

.ai-input {
  padding: 12px 14px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
}
.ai-input textarea {
  flex: 1; min-height: 38px; max-height: 120px;
  background: var(--bg-0); border: 1px solid var(--border-mid);
  border-radius: 10px; padding: 10px 12px; font-size: 13px;
  color: var(--fg-1); resize: none;
}
.ai-input textarea:focus { outline: none; border-color: var(--mm-teal); }
.ai-input .send {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--mm-teal); color: var(--mm-navy);
  border: none; display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.ai-input .send:hover { background: var(--teal-light); }
.ai-input .send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== WIZARD STEPS ===== */
.wizard-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.wizard-tabs button {
  background: transparent; border: none;
  padding: 12px 18px;
  font-size: 12px; font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
}
.wizard-tabs button.active { color: var(--mm-teal); border-bottom-color: var(--mm-teal); }
.wizard-tabs button .n {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-3); color: var(--fg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.wizard-tabs button.active .n { background: var(--mm-teal); color: var(--mm-navy); }
.wizard-tabs button.done .n { background: var(--accent-dim); color: var(--mm-teal); }
.wizard-tabs button.done .n::before { content: "✓"; }
.wizard-tabs button.done .n span { display: none; }

.method-card {
  background: var(--bg-2); border: 2px solid var(--border);
  border-radius: 14px; padding: 20px;
  cursor: pointer; transition: all .15s;
  text-align: left;
  display: flex; align-items: flex-start; gap: 14px;
}
.method-card:hover { border-color: var(--border-mid); }
.method-card.selected { border-color: var(--mm-teal); background: var(--accent-dim); }
.method-card .ico {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--accent-dim); color: var(--mm-teal);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.method-card .t { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.method-card .d { font-size: 12.5px; color: var(--fg-muted); line-height: 1.5; }

.upload-zone {
  border: 2px dashed var(--border-mid); border-radius: 12px;
  padding: 32px 20px; text-align: center;
  cursor: pointer; transition: all .15s;
  background: var(--bg-0);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--mm-teal); background: var(--accent-dim); }
.upload-zone i { font-size: 28px; color: var(--mm-teal); margin-bottom: 10px; }
.upload-zone .t { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.upload-zone .d { font-size: 12px; color: var(--fg-muted); margin-top: 6px; }

/* ===== CALENDAR ===== */
.cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal .dow {
  font-size: 10px; color: var(--fg-hint);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
  text-align: center; padding: 6px 0;
}
.cal .day {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 88px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
}
.cal .day.muted { opacity: 0.35; }
.cal .day.today { border-color: var(--mm-teal); background: var(--accent-dim); }
.cal .day .n { font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.cal .ev {
  font-size: 10.5px; padding: 3px 6px; border-radius: 5px;
  background: var(--bg-3);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal .ev .pdot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ===== TASK ROW ===== */
.task-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto auto auto;
  gap: 14px; align-items: center;
  padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 6px;
  cursor: pointer; transition: all .12s;
}
.task-row:hover { border-color: var(--mm-teal); background: var(--bg-3); }
.task-row .check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-mid);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--mm-navy);
}
.task-row .check.done { background: var(--mm-teal); border-color: var(--mm-teal); }
.task-row .ttl { font-size: 13px; color: var(--fg-1); }
.task-row .ttl.done { text-decoration: line-through; color: var(--fg-muted); }
.task-row .meta { font-size: 11px; color: var(--fg-muted); display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.task-row .due { font-size: 11.5px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.task-row .due.overdue { color: var(--danger); font-weight: 600; }

/* ===== UTILITY ===== */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.muted { color: var(--fg-muted); }
.hint { color: var(--fg-hint); }
.tnums { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.dim-table-empty { padding: 28px 16px; text-align: center; color: var(--fg-hint); font-size: 12px; }

/* responsive */
@media (max-width: 980px) {
  .sidebar { display: none; }
  .sb-foot { display: none; }
  .main { padding: 16px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .center { display: none; }
  .brand .product { display: none; }
}

/* fade-in for views — keep visible always (animation paused when iframe loses focus) */
.fade-in { opacity: 1; }

/* ===== VOICE ASSISTANT ===== */
.fab .voice-pulse {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--danger);
  animation: voicePulse 1.2s infinite;
  pointer-events: none;
}
@keyframes voicePulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.voice-panel {
  position: fixed; bottom: 92px; right: 24px; z-index: 81;
  width: 420px;
  max-height: calc(100vh - 120px);
  background: #050808;
  border: 1px solid var(--mm-teal);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(52, 206, 198, 0.2), 0 20px 60px rgba(0,0,0,0.6), 0 0 80px rgba(52, 206, 198, 0.12);
  display: flex; flex-direction: column;
  font-family: var(--font-mono);
  overflow: hidden;
  animation: slideUp .25s ease;
}

.voice-head {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(52, 206, 198, 0.18);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(52,206,198,0.06) 0%, transparent 100%);
}
.voice-led {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}
.voice-head .close {
  width: 26px; height: 26px; border-radius: 6px;
  background: transparent; border: 1px solid rgba(52,206,198,0.2);
  color: var(--fg-muted); display: flex; align-items: center; justify-content: center;
}
.voice-head .close:hover { color: var(--danger); border-color: var(--danger); }

.voice-screen {
  position: relative;
  padding: 16px;
  min-height: 280px;
  max-height: 440px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(52,206,198,0.06), transparent 60%),
    #050808;
}
.voice-screen::-webkit-scrollbar { width: 6px; }
.voice-screen::-webkit-scrollbar-thumb { background: rgba(52,206,198,0.3); border-radius: 3px; }

.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(52, 206, 198, 0.03) 0px,
    rgba(52, 206, 198, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 0;
}

.voice-wave {
  display: flex; gap: 3px; align-items: center; justify-content: center;
  height: 60px; padding: 10px 0; position: relative; z-index: 1;
}
.voice-wave .bar {
  width: 4px;
  background: linear-gradient(180deg, var(--mm-teal), var(--teal-light));
  border-radius: 2px;
  transition: height 0.05s ease, opacity 0.1s ease;
  box-shadow: 0 0 8px var(--mm-teal);
}

.voice-log { position: relative; z-index: 1; font-size: 12.5px; line-height: 1.55; }
.voice-msg { padding: 6px 0; border-bottom: 1px dashed rgba(52,206,198,0.1); }
.voice-msg:last-child { border-bottom: none; }
.voice-msg .who {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--mm-teal);
  letter-spacing: 1px;
  margin-right: 8px;
  text-transform: uppercase;
  font-weight: 600;
}
.voice-msg.user .msg { color: #B8E8E4; }
.voice-msg.assistant .msg { color: #fff; }
.voice-msg.partial .msg { opacity: 0.7; }

.voice-hint { padding: 8px 0; }

.cursor-blink {
  display: inline-block;
  animation: blink 1s steps(2, start) infinite;
  color: var(--mm-teal);
  font-weight: 700;
  margin-left: 2px;
}
@keyframes blink { to { visibility: hidden; } }

.dots { display: inline-flex; gap: 3px; margin-left: 6px; }
.dots span {
  width: 4px; height: 4px; border-radius: 50%; background: var(--mm-teal);
  animation: dotPulse 1.2s infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.voice-actions {
  padding: 10px 14px;
  border-top: 1px solid rgba(52,206,198,0.18);
  display: flex; gap: 8px; align-items: center;
  background: linear-gradient(0deg, rgba(52,206,198,0.04) 0%, transparent 100%);
}
.voice-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  background: transparent; color: var(--mm-teal);
  border: 1px solid var(--mm-teal); cursor: pointer;
  transition: all .15s;
}
.voice-btn:hover { background: rgba(52, 206, 198, 0.12); box-shadow: 0 0 12px rgba(52, 206, 198, 0.4); }
.voice-btn.active { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: 0 0 12px rgba(224, 90, 90, 0.5); }

/* ===== HACK · subtle terminal flourishes (LEVE) ===== */

/* KPI value tickers — glow on render */
.kpi .val {
  text-shadow: 0 0 18px rgba(52, 206, 198, 0.18);
  animation: kpiGlow 0.7s ease-out;
}
@keyframes kpiGlow {
  from { text-shadow: 0 0 40px rgba(52, 206, 198, 0.5), 0 0 60px rgba(52, 206, 198, 0.25); }
  to   { text-shadow: 0 0 18px rgba(52, 206, 198, 0.18); }
}

/* Page title with subtle cursor */
.page-head h1::after {
  content: "_";
  color: var(--mm-teal);
  margin-left: 6px;
  font-weight: 400;
  animation: blink 1s steps(2, start) infinite;
  opacity: 0.7;
}

/* Brand bolt subtle glow + flicker */
.brand .bolt {
  box-shadow: 0 0 0 2px var(--mm-navy), 0 0 18px rgba(52, 206, 198, 0.3);
  animation: boltFlicker 8s infinite;
}
@keyframes boltFlicker {
  0%, 100% { box-shadow: 0 0 0 2px var(--mm-navy), 0 0 18px rgba(52, 206, 198, 0.3); }
  47%      { box-shadow: 0 0 0 2px var(--mm-navy), 0 0 25px rgba(52, 206, 198, 0.5); }
  48%      { box-shadow: 0 0 0 2px var(--mm-navy), 0 0 10px rgba(52, 206, 198, 0.15); }
  49%      { box-shadow: 0 0 0 2px var(--mm-navy), 0 0 25px rgba(52, 206, 198, 0.5); }
  50%      { box-shadow: 0 0 0 2px var(--mm-navy), 0 0 18px rgba(52, 206, 198, 0.3); }
}

/* Status dots — pulse */
.s-dot.active, .pill.success .pdot, .sb-foot .dot {
  animation: dotBreath 2.4s ease-in-out infinite;
}
@keyframes dotBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 206, 198, 0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(52, 206, 198, 0); }
}

/* Mono-styled labels — subtle terminal underscore prefix */
.eyebrow::before, .kpi .lbl::before {
  content: "› ";
  color: var(--mm-teal);
  opacity: 0.5;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Counter ticker on numbers in KPIs (subtle digital feel)
   Keep tabular-nums (already set) — add slight letter-spacing for digital look */
.kpi .val, .tnums { letter-spacing: -0.5px; }

/* Card hover — subtle teal border glow */
.card:hover, .kpi:hover, .client-card:hover, .con-row:hover, .kan-card:hover {
  transition: border-color .2s, box-shadow .2s;
}
.kpi:hover { box-shadow: 0 0 0 1px rgba(52, 206, 198, 0.2), 0 4px 20px rgba(52, 206, 198, 0.08); }

/* Faint scanline background on sidebar foot */
.sb-foot {
  background-image:
    var(--bg-1) linear-gradient(0deg, transparent 0%, rgba(52,206,198,0.04) 100%),
    repeating-linear-gradient(180deg, transparent 0px, transparent 2px, rgba(52,206,198,0.02) 2px, rgba(52,206,198,0.02) 3px);
}

/* CMO note — subtle scanlines overlay */
.cmo-note {
  position: relative; overflow: hidden;
}
.cmo-note::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0px, transparent 2px, rgba(52,206,198,0.025) 2px, rgba(52,206,198,0.025) 3px);
}

/* Section dividers — terminal feel */
.sb-section {
  position: relative; padding-left: 28px;
}
.sb-section::before {
  content: "//"; position: absolute; left: 12px; top: 14px;
  font-family: var(--font-mono); color: var(--mm-teal); opacity: 0.5;
  font-size: 10px;
}

/* Topbar — faint bottom glow line */
.topbar {
  box-shadow: 0 1px 0 0 rgba(52, 206, 198, 0.08), 0 4px 12px rgba(0,0,0,0.2);
}

/* Counter animation — used by KpiValue component */
.kpi-count {
  display: inline-block;
}

/* ===== LIGHT THEME OVERRIDES ===== */
:root[data-theme="light"] {
  --accent: #1AA29A;
  --accent-strong: #128580;
  --accent-dim: rgba(26, 162, 154, 0.10);
  --accent-border: rgba(26, 162, 154, 0.30);
}
:root[data-theme="light"] body, :root[data-theme="light"] html {
  background: var(--bg-0);
  color: var(--fg-1);
}
:root[data-theme="light"] .topbar,
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .sb-foot { background: var(--bg-1); }
:root[data-theme="light"] .card,
:root[data-theme="light"] .kpi,
:root[data-theme="light"] .kan-col,
:root[data-theme="light"] .modal,
:root[data-theme="light"] .ai-panel { background: var(--bg-2); border-color: var(--border); }
:root[data-theme="light"] .kan-card,
:root[data-theme="light"] .con-row,
:root[data-theme="light"] .client-card,
:root[data-theme="light"] .task-row,
:root[data-theme="light"] .upload-zone { background: var(--bg-1); }
:root[data-theme="light"] input, :root[data-theme="light"] textarea, :root[data-theme="light"] select {
  background: var(--bg-0); color: var(--fg-1); border-color: var(--border-mid);
}
:root[data-theme="light"] .tbl th { background: var(--bg-2); }
:root[data-theme="light"] .tbl tbody tr:hover td { background: var(--bg-3); }
:root[data-theme="light"] .btn { background: var(--bg-1); }
:root[data-theme="light"] .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-theme="light"] .btn.primary:hover { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
:root[data-theme="light"] .user-chip .av,
:root[data-theme="light"] .brand .bolt { color: #fff; }
:root[data-theme="light"] .brand .bolt { background: var(--mm-navy); }
:root[data-theme="light"] .lang-toggle button.active,
:root[data-theme="light"] .role-toggle button.active { background: var(--accent); color: #fff; }
:root[data-theme="light"] .kpi .progress,
:root[data-theme="light"] .con-row .progress-bar { background: rgba(29, 35, 45, 0.08); }
:root[data-theme="light"] .cmo-note {
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--teal-deep) 100%);
}
