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

:root {
  --bg: #f8f8f6;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f4f3f0;
  --bg-elevated: #ffffff;
  --bg-subtle: #f0efec;

  --accent: #cf8e25;
  --accent-soft: rgba(207,142,37,0.08);
  --accent-border: rgba(207,142,37,0.2);
  --accent-glow: 0 0 20px rgba(207,142,37,0.1);
  --accent-gradient: linear-gradient(135deg, #cf8e25, #a87020);
  --accent-2: #2b6b96;
  --accent-2-soft: rgba(43,107,150,0.08);

  --text: #1e2a36;
  --text-dim: #4a5462;
  --text-muted: #5e6975;

  --border: #e4e2de;
  --border-light: #eeedea;

  --shadow-sm: 0 1px 3px rgba(30,20,10,0.05);
  --shadow-md: 0 4px 12px rgba(30,20,10,0.07);
  --shadow-lg: 0 12px 32px rgba(30,20,10,0.09);

  --glass: rgba(255,255,254,0.8);
  --glass-border: rgba(30,20,10,0.06);
  --glass-blur: blur(12px);

  --green: #2f8a50; --green-soft: rgba(47,138,80,0.08);
  --red: #c04537; --red-soft: rgba(192,69,55,0.08);
  --yellow: #b88a18; --yellow-soft: rgba(184,138,24,0.08);
  --blue: #2b6b96; --blue-soft: rgba(43,107,150,0.07);
  --purple: #7650b8; --purple-soft: rgba(118,80,184,0.07);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-theme="dark"] {
  --bg: #111a2e;
  --bg-surface: #0f1627;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-elevated: rgba(255,255,255,0.06);
  --bg-subtle: rgba(255,255,255,0.03);

  --text: rgba(255,255,255,0.92);
  --text-dim: rgba(255,255,255,0.7);
  --text-muted: rgba(255,255,255,0.55);

  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.05);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);

  --glass: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.07);

  --accent-soft: rgba(207,142,37,0.1);
  --accent-border: rgba(207,142,37,0.25);
  --accent-2-soft: rgba(34,89,133,0.12);

  --green: #5ec98a; --green-soft: rgba(94,201,138,0.14);
  --red: #e07d72; --red-soft: rgba(224,125,114,0.14);
  --yellow: #e0b44a; --yellow-soft: rgba(224,180,74,0.14);
  --blue: #6aaddb; --blue-soft: rgba(106,173,219,0.14);
  --purple: #a48bd6; --purple-soft: rgba(164,139,214,0.14);
}

body { min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, system-ui, sans-serif; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; letter-spacing: -0.01em; }
[data-theme="dark"] body { font-weight: 500; -webkit-font-smoothing: auto; }
[data-theme="dark"] .sidebar { font-weight: 400; }
.mono { font-family: 'Fira Code', 'JetBrains Mono', monospace; font-feature-settings: "tnum" 1; }
.glow, .glow-left { display: none; }
body::after { display: none; }

/* ── Login ── */
.login-overlay { position: fixed; inset: 0; background: #111a2e; display: flex; align-items: center; justify-content: center; z-index: 9999; }
.login-overlay::before { content: ''; position: absolute; top: 50%; left: 50%; width: 700px; height: 700px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(207,142,37,0.12) 0%, transparent 55%); pointer-events: none; }
.login-box { background: #0f1627; border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); padding: 44px 40px; width: 380px; text-align: center; box-shadow: 0 12px 32px rgba(0,0,0,0.45); position: relative; }
.login-logo { margin-bottom: 24px; }
.login-logo img { height: 36px; }
.login-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 6px; letter-spacing: -0.02em; font-family: 'Inter Tight', 'Inter', sans-serif; }
.login-sub { font-size: 11px; color: rgba(255,255,255,0.55); margin-bottom: 28px; }
.login-input { width: 100%; padding: 11px 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-xs); color: #fff; font-family: 'Fira Code', 'JetBrains Mono', monospace; font-size: 14px; outline: none; margin-bottom: 14px; transition: all var(--transition); }
.login-input:focus { border-color: var(--accent); }
.login-input::placeholder { color: rgba(255,255,255,0.45); }
.login-btn { width: 100%; padding: 12px; background: var(--accent); border: none; border-radius: var(--radius-xs); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit; transition: all var(--transition); box-shadow: 0 1px 4px rgba(207,142,37,0.25); }
.login-btn:hover { box-shadow: 0 2px 8px rgba(207,142,37,0.3); }
.login-btn:active { transform: translateY(0); }
.login-error { color: var(--red); font-size: 12px; margin-top: 12px; display: none; }
.login-success { color: var(--green, #48c774); font-size: 12px; margin-top: 12px; display: none; line-height: 1.5; }
.login-forgot { display: inline-block; margin-top: 16px; color: rgba(255,255,255,0.5); font-size: 12px; text-decoration: none; transition: color 0.15s; }
.login-forgot:hover { color: #cf8e25; }

/* ── Layout Shell ── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar { width: 240px; min-width: 240px; height: 100vh; background: #1a2744; border-right: 1px solid rgba(34,89,133,0.15); display: flex; flex-direction: column; position: sticky; top: 0; z-index: 100; }
.sidebar::before { display: none; }
.sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid rgba(34,89,133,0.15); display: flex; align-items: center; gap: 12px; }
.sidebar-header .logo img { height: 28px; }
.sidebar-header .header-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -0.02em; font-family: 'Inter Tight', 'Inter', sans-serif; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(34,89,133,0.15); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Header (top bar) ── */
.main-area::before { display: none; }
.header { border-bottom: 1px solid var(--border); padding: 0 24px; height: 48px; display: flex; align-items: center; justify-content: space-between; background: var(--glass); backdrop-filter: var(--glass-blur); z-index: 99; flex-shrink: 0; }
.header-left { display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; }
.logo img { height: 28px; }
.header-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.header-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 0.02em; }
.header-right { display: flex; align-items: center; gap: 16px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 4px var(--green); }
.status-dot.degraded { background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 4px var(--red); }
@keyframes pulse-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 71, 58, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(196, 71, 58, 0); } }

/* ── Main area (right of sidebar) ── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.main-scroll { flex: 1; overflow-y: auto; }

/* ── Nav items (sidebar) ── */
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.6); cursor: pointer; border-radius: var(--radius-xs); transition: all var(--transition); white-space: nowrap; letter-spacing: -0.01em; margin-bottom: 2px; position: relative; }
.nav-item:hover { color: rgba(255,255,255,0.87); background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(34,89,133,0.2) 0%, rgba(34,89,133,0.05) 100%); font-weight: 600; border: none; border-left: 3px solid #225985; border-radius: 0 var(--radius-xs) var(--radius-xs) 0; margin-left: -14px; padding-left: 25px; }
.nav-icon { width: 18px; height: 18px; opacity: 0.45; flex-shrink: 0; }
.nav-item:hover .nav-icon { opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 0.9; color: var(--accent); }
.nav-section { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.06em; padding: 18px 14px 6px; }
.nav-section:first-child { padding-top: 4px; }

/* ── Sidebar toggle (mobile) ── */
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 6px; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; transition: left 0.25s ease; z-index: 200; box-shadow: 4px 0 20px rgba(0,0,0,0.5); }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: block; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; }
  .sidebar.open + .sidebar-overlay { display: block; }
}

/* ── Tabs (hidden, replaced by sidebar nav) ── */
.tab-bar { display: none; }
.tab { display: none; }

/* ── Sub-tabs (for platforms) ── */
.sub-tab-bar { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.sub-tab { padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.sub-tab:hover { color: var(--text-dim); }
.sub-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.sub-content { display: none; }
.sub-content.active { display: block; }

/* ── Content ── */
.content { padding: 24px 28px; max-width: 1400px; position: relative; z-index: 1; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Cards / Grids ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: box-shadow 200ms ease, background 200ms ease; position: relative; }
.card::before { display: none; }
.card:hover { box-shadow: var(--shadow-md); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 1100px) { .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 750px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

/* ── KPI ── */
.kpi-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); transition: box-shadow 200ms ease; }
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-val { font-size: 28px; font-weight: 700; color: var(--text); font-family: 'Fira Code', 'JetBrains Mono', monospace; line-height: 1; letter-spacing: -0.02em; }
.kpi-label { font-size: 10px; color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }

/* ── Service Cards ── */
.svc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; transition: box-shadow 200ms ease; box-shadow: var(--shadow-sm); border-left: 3px solid transparent; }
.svc-card:hover { box-shadow: var(--shadow-md); }
.svc-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.svc-dot.ok { background: var(--green); box-shadow: 0 0 4px var(--green); }
.svc-dot.degraded { background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }
.svc-dot.offline { background: var(--red); box-shadow: 0 0 4px var(--red); }
.svc-name { font-size: 14px; font-weight: 600; color: var(--text); }
.svc-meta { font-size: 10px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

/* ── Table ── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-surface); z-index: 2; }
.tbl td { font-size: 14px; padding: 10px 14px; border-bottom: 1px solid var(--border-light); color: var(--text-dim); vertical-align: top; }
.tbl tbody tr { transition: background var(--transition); }
.tbl tbody tr:hover td { background: var(--bg-subtle); }
.tbl-wrap { overflow-x: auto; max-height: 600px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.tbl tbody tr:nth-child(even) { background: var(--bg-subtle); }
.tbl tbody tr:hover { background: var(--bg-subtle); }

/* ── Badge ── */
.badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-green { background: var(--green-soft); color: var(--green); border: 1px solid rgba(58,154,92,0.2); }
.badge-red { background: var(--red-soft); color: var(--red); border: 1px solid rgba(196,71,58,0.2); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(192,139,26,0.2); }
.badge-blue { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(96,165,250,0.2); }
.badge-purple { background: var(--purple-soft); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }
.badge-muted { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Scribe Summary (force dark theme on LLM-generated HTML) ── */
.scribe-summary { background: var(--bg-subtle); border-radius: 8px; padding: 16px; line-height: 1.6; color: var(--text); }
.scribe-summary * { color: inherit !important; background: transparent !important; background-color: transparent !important; border-color: var(--border) !important; }
.scribe-summary h1, .scribe-summary h2, .scribe-summary h3, .scribe-summary h4 { color: var(--text) !important; margin: 16px 0 8px 0; font-size: 15px; }
.scribe-summary h1:first-child, .scribe-summary h2:first-child { margin-top: 0; }
.scribe-summary p { margin: 6px 0; }
.scribe-summary ul, .scribe-summary ol { margin: 6px 0; padding-left: 20px; }
.scribe-summary li { margin: 3px 0; }
.scribe-summary table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.scribe-summary th { text-align: left; padding: 8px 10px; background: var(--bg-card) !important; color: var(--accent) !important; font-weight: 600; border-bottom: 1px solid var(--border) !important; }
.scribe-summary td { padding: 6px 10px; border-bottom: 1px solid var(--border-light) !important; }
.scribe-summary tr:hover td { background: var(--bg-card-hover) !important; }
.scribe-summary a { color: var(--accent) !important; }
.scribe-summary strong, .scribe-summary b { color: var(--text) !important; }
.scribe-summary hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ── Buttons ── */
.btn-sm { font-size: 13px; color: var(--text-dim); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 20px; padding: 5px 14px; cursor: pointer; font-family: inherit; transition: all var(--transition); font-weight: 500; }
.btn-sm:hover { background: var(--bg-card-hover); border-color: var(--accent-border); color: var(--text); }
.btn-accent { font-size: 13px; color: #fff; background: var(--accent); border: none; border-radius: 20px; padding: 6px 16px; cursor: pointer; font-family: inherit; transition: all var(--transition); font-weight: 600; letter-spacing: 0.01em; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-danger { font-size: 13px; color: var(--red); background: var(--red-soft); border: 1px solid rgba(196,71,58,0.2); border-radius: var(--radius-xs); padding: 6px 14px; cursor: pointer; font-family: inherit; transition: all var(--transition); font-weight: 500; }
.btn-danger:hover { background: rgba(196,71,58,0.2); }
.btn-green { font-size: 13px; color: var(--green); background: var(--green-soft); border: 1px solid rgba(58,154,92,0.2); border-radius: var(--radius-xs); padding: 6px 14px; cursor: pointer; font-family: inherit; transition: all var(--transition); font-weight: 500; }
.btn-green:hover { background: rgba(58,154,92,0.2); }
.btn-outline { font-size: 13px; color: var(--text-dim); background: transparent; border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 6px 14px; cursor: pointer; font-family: inherit; transition: all var(--transition); font-weight: 500; }
.btn-outline:hover { background: var(--bg-subtle); border-color: var(--accent-border); color: var(--text); }
.btn-xs { font-size: 10px; padding: 4px 10px; color: var(--text-dim); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xs); cursor: pointer; font-family: inherit; transition: all var(--transition); }
.btn-xs:hover { background: var(--bg-card-hover); border-color: var(--accent-border); color: var(--text); }
.input-sm { padding: 7px 12px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: all var(--transition); }
.input-sm:focus { border-color: var(--accent); }

/* ── Agent Cards ── */
.agent-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0; overflow: hidden; transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.agent-card:hover { box-shadow: var(--shadow-md); }
.agent-card-header {
  padding: 20px 20px 16px; display: flex; align-items: flex-start; gap: 14px;
  border-bottom: 1px solid var(--border-light);
}
.agent-avatar {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex-shrink: 0; position: relative;
}
.agent-avatar .pulse {
  position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--bg); box-shadow: 0 0 8px var(--green);
}
.agent-avatar .pulse.idle { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.agent-role { font-size: 13px; color: var(--accent); font-weight: 500; }
.agent-card-body { padding: 14px 20px; }
.agent-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-bottom: 4px; }
.agent-stat { font-size: 13px; color: var(--text-muted); }
.agent-stat strong { color: var(--text-dim); }
.agent-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; padding: 8px 0; border-top: 1px solid var(--border-light); margin-top: 8px; }
.agent-msg-section { padding: 0 20px 16px; }
.agent-msg-wrap { display: flex; gap: 8px; }
.agent-msg-input {
  flex: 1; padding: 10px 14px; background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 12px; font-family: inherit; outline: none;
}
.agent-msg-input:focus { border-color: var(--accent); }
.agent-msg-input::placeholder { color: var(--text-muted); }
.agent-response {
  margin: 8px 20px 16px; padding: 12px 14px; background: rgba(207,142,37,0.04); border: 1px solid rgba(207,142,37,0.1);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-dim); font-family: 'Fira Code', 'JetBrains Mono', monospace;
  max-height: 300px; overflow-y: auto; white-space: pre-wrap; display: none; line-height: 1.6;
}

/* ── Section Title ── */
.section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 16px; margin-top: 28px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.section-title::before { content: ''; display: inline-block; width: 4px; height: 16px; background: var(--accent); border-radius: 2px; }
.section-title:first-child { margin-top: 0; }

/* ── Pipeline Bar ── */
.pipeline-bar { display: flex; gap: 2px; height: 28px; border-radius: var(--radius-xs); overflow: hidden; margin-bottom: 14px; }
.pipeline-segment { display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; min-width: 30px; transition: flex 0.3s; }

/* ── Feed ── */
.feed-item { padding: 8px 0; border-bottom: 1px solid var(--border-light); display: flex; align-items: flex-start; gap: 10px; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.feed-msg { font-size: 14px; color: var(--text-dim); }
.feed-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Action Cards ── */
.action-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: box-shadow 200ms ease; }
.action-card:hover { box-shadow: var(--shadow-md); }
.action-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.action-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.action-last { font-size: 10px; color: var(--text-muted); margin-top: 10px; }

/* ── Client Cards ── */
/* ── Client Health Dashboard ── */
.clients-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-card); }
.clients-list { border-right: 1px solid var(--border); overflow-y: auto; height: calc(100vh - 64px); background: var(--bg-subtle); }
.clients-detail { overflow-y: auto; height: calc(100vh - 64px); padding: 0; }
.clients-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 300px; color: var(--text-muted); font-size: 14px; }
.client-list-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border-light); transition: all var(--transition); }
.client-list-item:hover { background: var(--bg-card-hover); }
.client-list-item.active { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.client-list-item.needs-attention { border-left: 3px solid var(--red); }
.client-list-item .cl-row-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.client-list-item .cl-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.client-list-item .cl-industry { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-list-item .cl-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.cl-score-pill { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; letter-spacing: 0.02em; flex-shrink: 0; }
.cl-score-good { background: var(--green-soft); color: var(--green); }
.cl-score-ok   { background: var(--yellow-soft); color: var(--yellow); }
.cl-score-low  { background: var(--red-soft); color: var(--red); }
.cl-alert-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: pulse 1.8s infinite; flex-shrink: 0; }
/* Add/archive client modal inputs */
.modal-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-input { width: 100%; padding: 7px 10px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 15px; outline: none; box-sizing: border-box; }
.modal-input:focus { border-color: var(--accent); }
.btn-accent-outline { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-xs); font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(207,142,37,0.3); text-decoration: none; cursor: pointer; transition: all var(--transition); }
.btn-accent-outline:hover { background: rgba(207,142,37,0.2); }
.btn-danger-outline { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-xs); font-size: 11px; font-weight: 600; color: var(--red); background: var(--red-soft); border: 1px solid rgba(196,71,58,0.3); cursor: pointer; transition: all var(--transition); }
.btn-danger-outline:hover { background: rgba(196,71,58,0.2); }
.client-list-search { padding: 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--glass); backdrop-filter: blur(8px); z-index: 1; }
.client-list-search input { width: 100%; padding: 7px 10px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 14px; outline: none; }
.client-list-search input:focus { border-color: var(--accent); }
/* Health detail panel */
.ch-header { padding: 24px; border-bottom: 1px solid var(--border); }
.ch-header-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ch-name { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.ch-meta { font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.ch-meta a { color: var(--accent); text-decoration: none; }
.ch-score { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.ch-score.good { background: var(--green-soft); color: var(--green); }
.ch-score.ok { background: var(--yellow-soft); color: var(--yellow); }
.ch-score.low { background: var(--red-soft); color: var(--red); }
.ch-sections { padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.ch-section { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; }
.ch-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.ch-section-title .dot { width: 6px; height: 6px; border-radius: 50%; }
.ch-section-title .dot.on { background: var(--green); }
.ch-section-title .dot.off { background: var(--text-muted); }
.ch-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.ch-metric { text-align: center; }
.ch-metric-val { font-size: 20px; font-weight: 700; color: var(--text); font-family: 'Fira Code', 'JetBrains Mono', monospace; }
.ch-metric-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.ch-campaign-list { margin-top: 12px; }
.ch-campaign { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.ch-campaign:last-child { border-bottom: none; }
.ch-campaign-name { color: var(--text-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-campaign-stat { color: var(--text-muted); margin-left: 12px; white-space: nowrap; }
.ch-campaign-stat.active-status { color: var(--green); }
.ch-campaign-stat.paused-status { color: var(--yellow); }
.ch-content-list { margin-top: 12px; }
.ch-content-item { padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.ch-content-item:last-child { border-bottom: none; }
.ch-content-title { color: var(--text-dim); }
.ch-content-meta { color: var(--text-muted); font-size: 11px; }
.ch-info-grid { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; }
.ch-info-label { color: var(--text-muted); }
.ch-info-value { color: var(--text-dim); }
.ch-loading { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--text-muted); }
@media (max-width: 768px) {
  .clients-layout { grid-template-columns: 1fr; }
  .clients-list { max-height: 250px; border-right: none; border-bottom: 1px solid var(--border); }
}
/* ── Memory Explorer ── */
.mem-explorer-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; min-height: 400px; }
.mem-file-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 65vh; background: var(--bg-subtle); }
.mem-file-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border-light); transition: all var(--transition); }
.mem-file-item:hover { background: var(--bg-card-hover); }
.mem-file-item.active { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.mem-file-viewer { overflow-y: auto; max-height: 65vh; background: var(--bg-card); }
@media (max-width: 768px) { .mem-explorer-layout { grid-template-columns: 1fr; } .mem-file-list { max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); } }

/* Legacy (keep for compat) */
.client-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: all var(--transition); box-shadow: var(--shadow-sm); }
.client-card:hover { box-shadow: var(--shadow-md); }
.client-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.client-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.client-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.client-details { margin-top: 12px; display: none; font-size: 14px; color: var(--text-dim); line-height: 1.8; }
.client-details.open { display: block; }

/* ── Logs ── */
.log-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.log-select { padding: 6px 12px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 14px; font-family: inherit; }
.log-filter { padding: 6px 12px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 14px; font-family: inherit; outline: none; flex: 1; max-width: 300px; }
.log-filter:focus { border-color: var(--accent); }
.log-output { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; font-family: 'Fira Code', 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); height: 500px; overflow-y: auto; white-space: pre-wrap; line-height: 1.6; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 200; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: 440px; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.modal-text { font-size: 14px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Helpers ── */
.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.text-right { text-align: right; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4cdd8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0aab6; }
* { scrollbar-width: thin; scrollbar-color: #c4cdd8 transparent; }

/* ── Alerts ── */
.alert-bar { padding: 8px 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; border-radius: var(--radius-xs); margin-bottom: 12px; }
.alert-bar.warn { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(192,139,26,0.2); }
.alert-bar.error { background: var(--red-soft); color: var(--red); border: 1px solid rgba(196,71,58,0.2); }

/* ── Content Preview ── */
.content-preview { max-height: 200px; overflow-y: auto; padding: 12px; background: var(--bg-subtle); border-radius: var(--radius-xs); font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-top: 8px; }

/* ── Slide-out Drawer ── */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 580px; max-width: 90vw; background: var(--bg-surface); border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(0,0,0,0.15); z-index: 301; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1); display: flex; flex-direction: column; }
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.drawer-title { font-size: 16px; font-weight: 700; color: var(--text); }
.drawer-close { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); cursor: pointer; padding: 4px 10px; font-size: 14px; transition: all var(--transition); }
.drawer-close:hover { color: var(--text); border-color: var(--text-muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

/* ── Content Cards (for article list) ── */
.content-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: all var(--transition); cursor: pointer; }
.content-card:hover { border-color: rgba(207,142,37,0.2); background: var(--bg-card-hover); }
.content-card + .content-card { margin-top: 10px; }
.content-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.content-card-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.content-card-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.content-card-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ── Outreach Cards ── */
.outreach-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all var(--transition); }
.outreach-card:hover { border-color: rgba(96,165,250,0.2); }
.outreach-card + .outreach-card { margin-top: 12px; }
.outreach-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.outreach-biz { font-size: 14px; font-weight: 600; color: var(--text); }
.outreach-details { display: flex; gap: 16px; font-size: 11px; color: var(--text-muted); margin-bottom: 12px; flex-wrap: wrap; }
.outreach-email-preview { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; }
.outreach-subject { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.outreach-body { font-size: 13px; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; max-height: 120px; overflow-y: auto; }

/* ── Card entrance animation ── */
@keyframes cardEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card-enter { animation: cardEnter 0.3s ease forwards; }

/* ── Markdown rendered content ── */
.rendered-md h1 { font-size: 22px; font-weight: 700; color: var(--text); margin: 20px 0 12px; line-height: 1.3; }
.rendered-md h2 { font-size: 18px; font-weight: 600; color: var(--text); margin: 18px 0 10px; line-height: 1.3; }
.rendered-md h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 16px 0 8px; }
.rendered-md p { margin: 0 0 12px; line-height: 1.7; color: var(--text-dim); font-size: 14px; }
.rendered-md ul, .rendered-md ol { margin: 0 0 12px 20px; color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.rendered-md li { margin-bottom: 4px; }
.rendered-md strong { color: var(--text); }
.rendered-md a { color: var(--accent); }
.rendered-md blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-muted); margin: 12px 0; font-style: italic; }
.rendered-md hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.rendered-md code { background: var(--bg-subtle); padding: 2px 6px; border-radius: 4px; font-family: 'Fira Code', 'JetBrains Mono', monospace; font-size: 14px; }
.rendered-md pre { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 14px; overflow-x: auto; margin: 12px 0; }
.rendered-md pre code { background: none; padding: 0; }

/* ── Generation toolbar ── */
.gen-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gen-toolbar .btn-accent { font-size: 13px; padding: 6px 12px; }
/* ── Social Section Toggle ── */
.social-section-toggle { display: flex; gap: 2px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; width: fit-content; margin-bottom: 18px; }
.social-section-btn { padding: 7px 18px; font-size: 14px; font-weight: 500; border-radius: var(--radius-xs); border: none; background: transparent; color: var(--text-muted); cursor: pointer; transition: all var(--transition); font-family: inherit; }
.social-section-btn:hover { color: var(--text-dim); }
.social-section-btn.active { background: var(--accent); color: #000; font-weight: 600; box-shadow: 0 1px 4px rgba(207,142,37,0.3); }

/* ── Posting Cards ── */
.posting-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; transition: all var(--transition); box-shadow: var(--shadow-sm); }
.posting-card:hover { background: var(--bg-card-hover); border-color: var(--accent-border); }
.posting-card .pc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.posting-card .pc-channel { font-size: 10px; font-weight: 600; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.posting-card .pc-channel.linkedin { background: rgba(10,102,194,0.15); color: #60A5FA; border: 1px solid rgba(10,102,194,0.25); }
.posting-card .pc-channel.facebook { background: rgba(24,119,242,0.12); color: #93C5FD; border: 1px solid rgba(24,119,242,0.25); }
.posting-card .pc-content { font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: var(--text-dim); }
.posting-card .pc-actions { display: flex; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); flex-wrap: wrap; }
.posting-media-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border); cursor: pointer; transition: opacity var(--transition); }
.posting-media-thumb:hover { opacity: 0.8; }
.media-placeholder { width: 72px; height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.15); border-radius: var(--radius-xs); color: var(--text-muted); font-size: 9px; cursor: default; }
.media-placeholder svg { width: 22px; height: 22px; opacity: 0.4; }
/* ── Image Studio spinner ── */
.studio-spinner { width:36px;height:36px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:studio-spin 0.8s linear infinite; }
@keyframes studio-spin { to { transform:rotate(360deg); } }
.studio-gallery-item { position:relative;border-radius:var(--radius-xs);overflow:hidden;cursor:pointer;border:1px solid var(--border-light);transition:all var(--transition);aspect-ratio:16/9; }
.studio-gallery-item:hover { border-color:var(--accent-border);box-shadow:var(--shadow-md); }
.studio-gallery-item img { width:100%;height:100%;object-fit:cover; }
.studio-gallery-item .sg-overlay { position:absolute;inset:0;background:linear-gradient(transparent 50%,rgba(0,0,0,0.7));opacity:0;transition:opacity 200ms; }
.studio-gallery-item:hover .sg-overlay { opacity:1; }
.studio-gallery-item .sg-meta { position:absolute;bottom:0;left:0;right:0;padding:8px 10px;font-size:10px;color:rgba(255,255,255,0.85);opacity:0;transition:opacity 200ms; }
.studio-gallery-item:hover .sg-meta { opacity:1; }
.studio-gallery-item .sg-delete { position:absolute;top:6px;right:6px;background:rgba(0,0,0,0.6);border:none;color:var(--red);font-size:12px;width:22px;height:22px;border-radius:50%;cursor:pointer;opacity:0;transition:opacity 200ms;display:flex;align-items:center;justify-content:center; }
.studio-gallery-item:hover .sg-delete { opacity:1; }
.lightbox-overlay { display:none; position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,0.88); align-items:center; justify-content:center; cursor:zoom-out; backdrop-filter:blur(4px); }
.lightbox-overlay.active { display:flex; }
.lightbox-overlay img { max-width:90vw; max-height:90vh; object-fit:contain; border-radius:var(--radius-sm); box-shadow:0 8px 40px rgba(0,0,0,0.6); }

/* ── Posting Form ── */
.posting-form-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; display: block; margin-bottom: 6px; }
.posting-mode-toggle { display: flex; gap: 2px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 2px; width: fit-content; margin-bottom: 14px; }
.posting-mode-btn { padding: 5px 14px; font-size: 11px; font-weight: 500; border-radius: 4px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; transition: all var(--transition); font-family: inherit; }
.posting-mode-btn:hover { color: var(--text-dim); }
.posting-mode-btn.active { background: var(--bg-elevated); color: var(--text); }
.posting-schedule-btn { padding: 7px 16px; font-size: 11px; font-weight: 500; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); cursor: pointer; transition: all var(--transition); font-family: inherit; }
.posting-schedule-btn:hover { border-color: var(--accent-border); color: var(--text-dim); }
.posting-schedule-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; box-shadow: 0 1px 4px rgba(207,142,37,0.25); }
.posting-media-zone { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 24px; text-align: center; cursor: pointer; color: var(--text-muted); font-size: 14px; transition: all var(--transition); }
.posting-media-zone:hover { border-color: var(--accent-border); color: var(--text-dim); background: rgba(207,142,37,0.02); }
.posting-channels-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.posting-ch-label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-xs); transition: all var(--transition); color: var(--text-dim); }
.posting-ch-label:hover { border-color: var(--accent-border); background: var(--bg-subtle); }
.posting-ch-label input[type="checkbox"] { accent-color: var(--accent); }
.posting-feedback { margin-top: 10px; font-size: 11px; color: var(--yellow); background: var(--yellow-soft); padding: 8px 12px; border-radius: var(--radius-xs); border: 1px solid rgba(192,139,26,0.15); }
.posting-empty { color: var(--text-muted); font-size: 14px; padding: 40px 20px; text-align: center; }
.global-run-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 500; font-size: 14px; animation: cardEnter 0.2s ease; flex-direction: column; }
.global-run-bar .grb-header { display: flex; align-items: center; gap: 12px; padding: 10px 20px; cursor: pointer; }
.global-run-bar.running { background: var(--yellow-soft); border-top: 1px solid rgba(192,139,26,0.3); color: var(--yellow); }
.global-run-bar.done { background: var(--green-soft); border-top: 1px solid rgba(22,163,74,0.3); color: var(--green); }
.global-run-bar.error { background: var(--red-soft); border-top: 1px solid rgba(196,71,58,0.3); color: var(--red); }
.grb-log { max-height: 300px; overflow-y: auto; padding: 8px 20px 12px; font-family: 'Fira Code', 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; color: var(--text-dim); border-top: 1px solid var(--border); display: none; }
.grb-log.open { display: block; }
.grb-log .log-line-ok { color: var(--green); }
.grb-log .log-line-warn { color: var(--yellow); }
.grb-log .log-line-err { color: var(--red); }
.grb-log .log-line-info { color: var(--text-dim); }
.run-log-modal { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; animation: cardEnter 0.2s ease; }
.run-log-modal .rlm-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; width: 90%; max-width: 700px; max-height: 80vh; display: flex; flex-direction: column; }
.run-log-modal .rlm-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.run-log-modal .rlm-body { flex: 1; overflow-y: auto; padding: 16px 20px; font-family: 'Fira Code', 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: var(--text-dim); }
.run-log-modal .rlm-body .log-line-ok { color: var(--green); }
.run-log-modal .rlm-body .log-line-warn { color: var(--yellow); }
.run-log-modal .rlm-body .log-line-err { color: var(--red); }
.gen-status { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 14px; display: flex; align-items: center; gap: 12px; animation: cardEnter 0.2s ease; }
.gen-status.running { background: rgba(192,139,26,0.06); border-color: rgba(192,139,26,0.2); color: var(--yellow); }
.gen-status.done { background: var(--green-soft); border-color: rgba(58,154,92,0.2); color: var(--green); }
.gen-status.error { background: var(--red-soft); border-color: rgba(196,71,58,0.2); color: var(--red); }
.gen-spinner { width: 16px; height: 16px; border: 2px solid rgba(192,139,26,0.2); border-top-color: var(--yellow); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-status .gen-elapsed { margin-left: auto; font-size: 11px; color: var(--text-muted); font-family: 'Fira Code', 'JetBrains Mono', monospace; }

/* ── ECTC Detail ── */
.tbl tbody tr[style*="cursor:pointer"]:hover td { background: var(--bg-subtle); }
#ectcDetailBody > div > div:nth-child(odd) { padding: 5px 0; border-bottom: 1px solid var(--border-light); }
#ectcDetailBody > div > div:nth-child(even) { padding: 5px 0; border-bottom: 1px solid var(--border-light); }

/* ── Toast Notifications ── */
.toast-container { position: fixed; top: 68px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 420px; animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1); transition: all 0.3s ease; }
.toast.removing { animation: toast-out 0.25s ease forwards; }
.toast-success { background: var(--green-soft); border: 1px solid rgba(22,163,74,0.2); color: var(--green); }
.toast-error { background: var(--red-soft); border: 1px solid rgba(196,71,58,0.2); color: var(--red); }
.toast-info { background: var(--blue-soft); border: 1px solid rgba(34,89,133,0.2); color: var(--blue); }
.toast-warn { background: var(--yellow-soft); border: 1px solid rgba(192,139,26,0.2); color: var(--yellow); }
.toast-icon { font-size: 14px; flex-shrink: 0; }
.toast-close { margin-left: auto; cursor: pointer; opacity: 0.6; font-size: 14px; padding: 0 4px; }
.toast-close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ── Loading Skeleton ── */
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); min-height: 20px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 80px; border-radius: var(--radius-sm); }
.skeleton-row { height: 40px; margin-bottom: 4px; }
.skeleton-kpi { height: 90px; border-radius: var(--radius); }

/* ── Freshness Indicator ── */
.freshness { font-size: 10px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.freshness.stale { color: var(--yellow); }
.freshness-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.freshness.stale .freshness-dot { background: var(--yellow); }

/* ── Log Level Colors ── */
.log-error { color: var(--red); }
.log-warn { color: var(--yellow); }
.log-info { color: var(--blue); }
.log-debug { color: var(--text-muted); }
.log-line { display: flex; gap: 0; }
.log-line-num { color: var(--text-muted); min-width: 40px; text-align: right; padding-right: 8px; user-select: none; opacity: 0.5; }

/* ── Clickable Rows ── */
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: rgba(207,142,37,0.05); }

/* ── Agent Detail View ── */
.agent-detail-overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 150;
  display: none; flex-direction: column;
}
.agent-detail-overlay.open { display: flex; }
.agent-detail-header {
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
  background: var(--glass); backdrop-filter: blur(12px);
}
.agent-detail-body { flex: 1; display: flex; overflow: hidden; }
.agent-detail-sidebar {
  width: 300px; border-right: 1px solid var(--border); padding: 20px;
  overflow-y: auto; flex-shrink: 0;
}
.agent-detail-chat { flex: 1; display: flex; flex-direction: column; }
.chat-messages {
  flex: 1; padding: 10px 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.chat-msg-wrap { display: flex; flex-direction: column; max-width: 75%; }
.chat-msg-wrap.user { align-self: flex-end; align-items: flex-end; }
.chat-msg-wrap.agent { align-self: flex-start; align-items: flex-start; }
.chat-msg {
  padding: 7px 12px; border-radius: 18px;
  font-size: 14px; line-height: 1.4; white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg-wrap.user .chat-msg {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-msg-wrap.agent .chat-msg {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); border-bottom-left-radius: 6px;
}
.chat-msg-wrap.agent.streaming .chat-msg { border-color: rgba(207,142,37,0.3); }
.chat-meta {
  font-size: 8px; color: var(--text-muted); margin-top: 2px; padding: 0 8px;
}
.chat-input-bar {
  padding: 10px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; flex-shrink: 0;
  background: var(--glass);
}
.chat-input {
  flex: 1; padding: 8px 12px; background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  resize: none; min-height: 36px; max-height: 100px;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send-btn {
  padding: 8px 18px; background: var(--accent); border: none;
  border-radius: var(--radius-sm); color: #fff; font-weight: 600;
  font-size: 14px; cursor: pointer; font-family: inherit;
  transition: all var(--transition); align-self: flex-end;
}
.chat-send-btn:hover { background: #a87020; }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--text-muted); gap: 12px;
}
.sidebar-section { margin-bottom: 20px; }
.sidebar-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 8px;
}
.sidebar-stat {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 12px; border-bottom: 1px solid var(--border-light);
}
.sidebar-stat:last-child { border-bottom: none; }
.sidebar-stat-label { color: var(--text-muted); }
.sidebar-stat-val { color: var(--text); font-weight: 500; }
/* ── Themed Modal ── */
.mc-modal-overlay { position:fixed;inset:0;background:rgba(0,0,0,0.55);backdrop-filter:blur(3px);z-index:400;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity 0.2s ease; }
.mc-modal-overlay.open { opacity:1;pointer-events:auto; }
.mc-modal { background:var(--bg-surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-lg);width:420px;max-width:90vw;padding:24px;transform:scale(0.95);transition:transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1); }
.mc-modal-overlay.open .mc-modal { transform:scale(1); }
.mc-modal-title { font-size:15px;font-weight:600;color:var(--text);margin-bottom:6px; }
.mc-modal-desc { font-size:14px;color:var(--text-muted);line-height:1.5;margin-bottom:16px; }
.mc-modal-input { width:100%;margin-bottom:16px; }
.mc-modal-actions { display:flex;gap:8px;justify-content:flex-end; }
/* Calendar */
.calendar-grid { display:grid; gap:1px; background:var(--border-light); border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.calendar-grid.week-view { grid-template-columns: repeat(7, 1fr); }
.calendar-grid.month-view { grid-template-columns: repeat(7, 1fr); }
.calendar-header { background:var(--bg-surface); padding:8px 6px; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); text-align:center; }
.calendar-day { background:var(--bg-card); min-height:80px; padding:6px; cursor:pointer; transition:background var(--transition); position:relative; }
.calendar-day:hover { background:var(--bg-card-hover); }
.calendar-day.today { border-left:2px solid var(--accent); }
.calendar-day.other-month { opacity:0.4; }
.calendar-day-num { font-size:11px; font-weight:600; margin-bottom:4px; }
.calendar-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin:1px; }
.calendar-dot.facebook { background:#1877F2; }
.calendar-dot.instagram { background:#E4405F; }
.calendar-dot.linkedin { background:#0A66C2; }
.calendar-dot.twitter { background:#1DA1F2; }
.calendar-dot.gbp { background:#4285F4; }
.calendar-pill { font-size:9px; padding:1px 5px; border-radius:4px; margin:1px 0; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calendar-pill.draft { background:var(--bg-surface); color:var(--text-muted); }
.calendar-pill.scheduled { background:var(--yellow-soft); color:var(--yellow); }
.calendar-pill.published { background:var(--green-soft); color:var(--green); }
.calendar-pill.approved { background:var(--blue-soft); color:var(--blue); }

/* ── Client Filter Chips ── */
.client-chip-bar { display:flex; gap:4px; margin-bottom:12px; }
.client-chip { padding:6px 16px; font-size:14px; font-weight:600; border-radius:20px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-muted); cursor:pointer; transition:all var(--transition); font-family:inherit; }
.client-chip:hover { border-color:var(--accent-border); color:var(--text-dim); }
.client-chip.active { background:var(--accent); color:#000; border-color:var(--accent); box-shadow:0 1px 4px rgba(207,142,37,0.3); }
.client-summary-row { display:flex; gap:12px; margin-bottom:16px; font-size:11px; color:var(--text-muted); flex-wrap:wrap; }
.client-summary-item { display:flex; align-items:center; gap:6px; padding:4px 10px; background:var(--bg-card); border:1px solid var(--border-light); border-radius:var(--radius-xs); }
.client-summary-item .cs-label { color:var(--text-muted); }
.client-summary-item .cs-val { font-weight:600; color:var(--text); font-family:'Fira Code','JetBrains Mono',monospace; }

/* ── Pipeline Columns ── */
.pipeline-columns { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; min-height:300px; }
@media (max-width:900px) { .pipeline-columns { grid-template-columns:1fr; } }
.pipeline-col { background:var(--bg-subtle); border:1px solid var(--border-light); border-radius:var(--radius-sm); display:flex; flex-direction:column; min-height:200px; }
.pipeline-col-header { padding:10px 14px; font-size:13px; font-weight:600; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--border-light); border-radius:var(--radius-sm) var(--radius-sm) 0 0; }
.pipeline-col-header.needs-review { background:rgba(192,139,26,0.08); color:var(--yellow); border-bottom-color:rgba(192,139,26,0.15); }
.pipeline-col-header.approved { background:rgba(58,154,92,0.08); color:var(--green); border-bottom-color:rgba(58,154,92,0.15); }
.pipeline-col-header.scheduled { background:rgba(96,165,250,0.08); color:var(--blue); border-bottom-color:rgba(96,165,250,0.15); }
.pipeline-count { font-size:11px; font-weight:700; min-width:22px; height:22px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:rgba(255,255,255,0.08); }
.pipeline-col-actions { display:flex; align-items:center; gap:6px; padding:6px 10px; border-bottom:1px solid var(--border-light); }
.pipeline-col-body { flex:1; padding:8px; overflow-y:auto; max-height:600px; display:flex; flex-direction:column; gap:8px; }
.pipeline-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-xs); padding:10px 12px; cursor:pointer; transition:all var(--transition); position:relative; }
.pipeline-card:hover { border-color:var(--accent-border); background:var(--bg-card-hover); }
.pipeline-card .pipe-platform { font-size:9px; font-weight:600; padding:2px 6px; border-radius:8px; text-transform:uppercase; letter-spacing:0.04em; }
.pipeline-card .pipe-platform.linkedin { background:rgba(10,102,194,0.15); color:#60A5FA; }
.pipeline-card .pipe-platform.facebook { background:rgba(24,119,242,0.12); color:#93C5FD; }
.pipeline-card .pipe-platform.instagram { background:rgba(225,48,108,0.12); color:#F472B6; }
.pipeline-card .pipe-platform.twitter { background:rgba(29,161,242,0.12); color:#60A5FA; }
.pipeline-card .pipe-platform.gbp { background:rgba(66,133,244,0.12); color:#60A5FA; }
.pipeline-card .pipe-preview { font-size:13px; color:var(--text-dim); line-height:1.4; margin-top:6px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pipeline-card .pipe-meta { display:flex; gap:6px; align-items:center; margin-top:8px; flex-wrap:wrap; }
.pipeline-card .pipe-actions { display:flex; gap:4px; margin-top:8px; }
.pipe-client-badge { font-size:9px; font-weight:700; padding:1px 6px; border-radius:4px; background:var(--bg-elevated); color:var(--text-muted); letter-spacing:0.04em; }
.pipe-elara-badge { font-size:9px; font-weight:600; padding:1px 6px; border-radius:4px; }
.pipe-elara-badge.approved { background:rgba(58,154,92,0.12); color:var(--green); }
.pipe-elara-badge.needs_edit { background:rgba(192,139,26,0.12); color:var(--yellow); }
.pipe-elara-badge.rewritten { background:rgba(167,139,250,0.12); color:var(--purple,#a78bfa); }
.pipeline-empty { text-align:center; padding:30px 12px; color:var(--text-muted); font-size:11px; }

/* ── Settings Accordion ── */
.settings-accordion { border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:8px; overflow:hidden; }
.settings-accordion-header { padding:14px 18px; font-size:13px; font-weight:600; color:var(--text); cursor:pointer; display:flex; justify-content:space-between; align-items:center; background:var(--bg-card); transition:background var(--transition); user-select:none; }
.settings-accordion-header:hover { background:var(--bg-card-hover); }
.settings-accordion-header.active { border-bottom:1px solid var(--border-light); }
.settings-accordion-arrow { font-size:10px; color:var(--text-muted); transition:transform 0.2s ease; }
.settings-accordion-header.active .settings-accordion-arrow { transform:rotate(180deg); }
.settings-accordion-body { padding:18px; background:var(--bg-subtle); }

/* ── Published KPIs ── */
.published-kpi-row { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px; }
.published-kpi { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-sm); padding:14px; text-align:center; }
.published-kpi .pk-val { font-size:20px; font-weight:700; color:var(--text); font-family:'Fira Code','JetBrains Mono',monospace; }
.published-kpi .pk-label { font-size:10px; color:var(--text-muted); margin-top:2px; text-transform:uppercase; letter-spacing:0.04em; }

/* ── Page Transitions ── */
.page { animation: fadeIn 200ms ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Status Dot Animation ── */
.status-dot { position: relative; }
.svc-status.online, .badge-green { position: relative; }
@keyframes pulse-green { 0%, 100% { box-shadow: 0 0 0 0 rgba(58, 154, 92, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(58, 154, 92, 0); } }

/* ── Mobile Bottom Navigation ── */
.mobile-bottom-nav { display: none; }
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    height: 60px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(20px);
  }
  .mob-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    font-family: inherit;
  }
  .mob-nav-btn:hover, .mob-nav-btn.active {
    color: var(--accent);
    background: var(--accent-soft);
  }
  .main-scroll { padding-bottom: 76px !important; }
}

/* ── Responsive Table Improvements ── */
@media (max-width: 768px) {
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 600px; }
  .mc-modal-content { width: 95vw !important; max-width: 95vw !important; max-height: 90vh !important; margin: 5vh auto !important; }
  input, select, textarea { font-size: 16px !important; }
}

/* ── Touch-Friendly Targets ── */
@media (max-width: 768px) {
  .btn-sm, .btn-xs { min-height: 44px; min-width: 44px; padding: 8px 16px; }
  .nav-item { min-height: 44px; display: flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
/* Skills page */
.skill-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; flex-direction:column; gap:8px; transition:all .15s; }
.skill-card:hover { border-color:rgba(207,142,37,.3); }
.skill-card.disabled { opacity:.45; }
.skill-card .sk-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.skill-card .sk-name { font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.skill-card .sk-desc { font-size:13px; color:var(--text-muted); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:30px; }
.skill-card .sk-meta { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:auto; }
.sk-toggle { position:relative; width:34px; height:18px; background:var(--border); border-radius:9px; cursor:pointer; flex-shrink:0; transition:background .15s; }
.sk-toggle.on { background:var(--green); }
.sk-toggle::after { content:''; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; transition:left .15s; }
.sk-toggle.on::after { left:18px; }
.cat-badge { font-size:9px; padding:2px 7px; border-radius:4px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.cat-Business { background:rgba(58,154,92,.12); color:var(--green); }
.cat-Infrastructure { background:rgba(96,165,250,.12); color:#60A5FA; }
.cat-Personal { background:rgba(167,139,250,.12); color:#A78BFA; }
.cat-Dev { background:rgba(192,139,26,.12); color:var(--yellow); }
.cat-Other { background:rgba(255,255,255,.08); color:var(--text-muted); }
.sk-agent-badge { font-size:9px; padding:1px 6px; border-radius:3px; background:rgba(207,142,37,.12); color:var(--accent); }
.sk-env-warn { font-size:9px; padding:1px 6px; border-radius:3px; background:rgba(196,71,58,.12); color:var(--red); }
.sk-size { font-size:9px; color:var(--text-muted); margin-left:auto; }
.matrix-wrap { overflow-x:auto; }
.matrix-tbl { border-collapse:collapse; font-size:12px; width:100%; }
.matrix-tbl th, .matrix-tbl td { padding:6px 10px; border:1px solid var(--border); text-align:center; }
.matrix-tbl th { background:var(--bg-subtle); font-weight:600; position:sticky; top:0; white-space:nowrap; }
.matrix-tbl td:first-child { text-align:left; font-weight:500; white-space:nowrap; }
.matrix-tbl input[type=checkbox] { cursor:pointer; accent-color:var(--accent); }
.sub-tabs { display:flex; gap:8px; }
.sub-tab { background:var(--bg-card); border:1px solid var(--border); border-radius:8px; padding:6px 16px; font-size:12px; font-weight:600; color:var(--text-muted); cursor:pointer; transition:all .15s; }
.sub-tab:hover { border-color:rgba(207,142,37,.3); color:var(--text); }
.sub-tab.active { background:rgba(207,142,37,.1); border-color:var(--accent); color:var(--accent); }

/* ── IC Brand Typography ── */
.section-title, .kpi-label, h1, h2, h3,
.modal-title, .drawer-title, .agent-name,
.ch-name, .content-card-title, .header-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
}
.kpi-val {
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 30px;
}

/* ── Nav Groups (collapsible) ── */
.nav-group-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.nav-group-header:hover { color: var(--text-dim); }
.nav-group-chevron { transition: transform var(--transition); flex-shrink: 0; opacity: 0.5; }
.nav-group-collapsed .nav-group-chevron { transform: rotate(-90deg); }
.nav-group-items { overflow: hidden; }

/* ── Nav Badges ── */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: 'Inter', sans-serif;
}
.nav-badge.visible { display: flex; }

/* ── BDM Kanban ── */
.kanban-col {
  flex: 0 0 230px;
  min-width: 230px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 700px;
}
.kanban-col-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  font-family: 'Inter Tight', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.kanban-col-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
}
.kanban-cards {
  overflow-y: auto;
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: default;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.kanban-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
}
.kanban-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Inter Tight', sans-serif;
}
.kanban-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.kanban-score-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Theme Toggle ── */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-subtle); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); padding: 0;
}
.theme-toggle:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; color: var(--text-dim); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }

/* ── Dark-mode specific overrides ── */
[data-theme="dark"] .card { backdrop-filter: var(--glass-blur) saturate(1.3); }
[data-theme="dark"] .header { backdrop-filter: blur(16px) saturate(1.4); }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.6); }
[data-theme="dark"] .drawer { backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); }
[data-theme="dark"] .mc-modal { backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); }

[data-theme="dark"] .glow { background: radial-gradient(ellipse at 85% 15%, rgba(207,142,37,0.06), transparent 55%); }
[data-theme="dark"] .glow-left { background: radial-gradient(ellipse at 15% 85%, rgba(34,89,133,0.06), transparent 55%); }

[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
[data-theme="dark"] * { scrollbar-color: rgba(255,255,255,0.1) transparent; }

[data-theme="dark"] body::after { opacity: 0.03; }

/* Dark mode toast backgrounds */
[data-theme="dark"] .toast-success { background: #0d2818; }
[data-theme="dark"] .toast-error { background: #2d0f0f; }
[data-theme="dark"] .toast-info { background: #0f1a2d; }
[data-theme="dark"] .toast-warn { background: #2d2200; }

/* Dark mode global run bar */
[data-theme="dark"] .global-run-bar.running { background: #1a1700; }
[data-theme="dark"] .global-run-bar.done { background: #0d2818; }
[data-theme="dark"] .global-run-bar.error { background: #2d0f0f; }

/* Dark mode scribe summary */
[data-theme="dark"] .scribe-summary { background: rgba(0,0,0,0.3); }

/* ── Phase 3b: Mobile sub-tab horizontal scroll ── */
@media (max-width: 768px) {
  .sub-tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; }
  .sub-tab-bar::-webkit-scrollbar { display: none; }
  .sub-tab-bar .sub-tab { white-space: nowrap; flex-shrink: 0; }
  .gen-toolbar { flex-wrap: wrap; }
}

/* ── Unified Client Selector ── */
.mc-client-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.mc-client-bar label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
.mc-client-select {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Cpath stroke='%237f8ea1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition);
  min-width: 180px;
}
.mc-client-select:hover, .mc-client-select:focus {
  border-color: var(--accent);
  outline: none;
}

/* ── Social Overview ── */
.soc-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.soc-channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.soc-channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  transition: border-color var(--transition);
}
.soc-channel-card:hover { border-color: var(--accent); }
.soc-channel-icon { font-size: 20px; margin-bottom: 5px; }
.soc-channel-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.soc-channel-stat {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text);
}
.soc-channel-sublabel { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.soc-top-post {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.soc-top-post:last-child { border-bottom: none; }
.soc-top-post-rank {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 22px;
  line-height: 1.4;
}
.soc-top-post-body { flex: 1; min-width: 0; }
.soc-top-post-text {
  font-size: 13px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
  line-height: 1.4;
}
.soc-top-post-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .soc-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Brand Audit Professional Styles ── */
.ba-section { margin-bottom: 20px; }
.ba-section-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.ba-report-text { font-size: 15px; line-height: 1.8; color: var(--text-dim); }
.ba-report-text strong { color: var(--text); font-weight: 600; }
.ba-report-text ul, .ba-report-text ol { margin: 8px 0; padding-left: 20px; }
.ba-report-text li { margin-bottom: 4px; line-height: 1.6; }
.ba-report-text .ba-heading { font-size: 13px; font-weight: 700; color: var(--text); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.ba-report-text .ba-heading-lg { font-size: 14px; }
.ba-action-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.ba-rewrite-block { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ba-rewrite-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.ba-rewrite-current { background: var(--red-soft); padding: 12px; border-radius: 8px; border-left: 3px solid var(--red); }
.ba-rewrite-current .ba-rewrite-label { color: var(--red); }
.ba-rewrite-suggested { background: var(--green-soft); padding: 12px; border-radius: 8px; border-left: 3px solid var(--green); }
.ba-rewrite-suggested .ba-rewrite-label { color: var(--green); }
.ba-screenshot-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ba-screenshot-thumb { position: relative; width: 80px; height: 80px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.ba-screenshot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ba-screenshot-thumb .ba-screenshot-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 50%;
  font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ba-score-glow { box-shadow: 0 0 16px rgba(22,163,74,0.15); }
[data-theme="dark"] .ba-score-glow { box-shadow: 0 0 16px rgba(58,154,92,0.2); }
.ba-platform-score-card { padding: 20px; text-align: center; cursor: pointer; transition: border-color 200ms, box-shadow 200ms; }
.ba-platform-score-card:hover { box-shadow: var(--shadow-md); }
@media (max-width: 768px) {
  .ba-rewrite-block { grid-template-columns: 1fr; }
}

/* ── Global font-size floor — override inline styles that are too small ──── */
/* Applies to main content areas only. Badges/labels/timestamps stay small. */
.tab-content [style*="font-size:10px"],
.tab-content [style*="font-size: 10px"] { font-size: 12px !important; }
.tab-content [style*="font-size:11px"],
.tab-content [style*="font-size: 11px"] { font-size: 13px !important; }
.tab-content [style*="font-size:12px"],
.tab-content [style*="font-size: 12px"] { font-size: 14px !important; }
.tab-content [style*="font-size:13px"],
.tab-content [style*="font-size: 13px"] { font-size: 15px !important; }

/* ── Accessibility: keyboard focus indicator ─────────────────────────────── */
/* Show a visible accent outline on any keyboard-focused interactive element. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Remove default mouse-focus outline (keyboard-only) */
:focus:not(:focus-visible) { outline: none; }

/* Screen-reader-only utility — visually hidden but accessible to assistive tech */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
