/* ============================================================
   ZANA — Design System
   Clean White + ZANA Blue
   ============================================================ */

:root {
  /* Brand */
  --accent:         #2563EB;
  --accent-hover:   #1D4ED8;
  --accent-tint:    rgba(37,99,235,0.07);
  --accent-tint2:   rgba(37,99,235,0.14);

  /* Sidebar */
  --sidebar-bg:     #ffffff;
  --sidebar-text:   #6b7280;
  --sidebar-active: #2563EB;
  --sidebar-hover:  rgba(13,13,13,0.045);
  --sidebar-border: #e5e7eb;
  --sidebar-width:  220px;

  /* App surface */
  --bg:             #f9fafb;
  --surface:        #ffffff;
  --card:           #ffffff;
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;

  /* Typography */
  --text:           #111827;
  --text-muted:     #6b7280;
  --text-dim:       #9ca3af;

  /* Status */
  --green:          #16a34a;
  --green-bg:       rgba(22,163,74,0.10);
  --amber:          #d97706;
  --amber-bg:       rgba(217,119,6,0.10);
  --red:            #dc2626;
  --red-bg:         rgba(220,38,38,0.10);
  --blue:           #2563EB;
  --blue-bg:        rgba(37,99,235,0.10);
  --purple:         #7c3aed;
  --purple-bg:      rgba(124,58,237,0.10);

  /* Radius */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --radius-xl:      20px;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:         0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 28px rgba(0,0,0,0.10);
  --shadow-xl:      0 20px 60px rgba(0,0,0,0.14);
  --shadow-blue:    0 4px 20px rgba(37,99,235,0.25);

  /* Motion */
  --transition:     all 0.18s ease;

  /* Layout */
  --topbar-height:  60px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
html { overflow-y: scroll; }

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ── App Shell ──────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.22s ease, min-width 0.22s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}

.sidebar-logo-mark svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.sidebar-logo-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-section {
  padding: 10px 10px 0;
}

.sidebar-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding: 10px 8px 4px;
  opacity: 0.55;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-tint2);
  color: var(--accent);
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-label { flex: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.nav-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 8px 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-user:hover { background: var(--sidebar-hover); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.user-info { overflow: hidden; flex: 1; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Sidebar collapse ───────────────────────────────────── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover { color: var(--text); background: var(--sidebar-hover); }
.sidebar-collapse-btn .scb-icon { flex-shrink: 0; transition: transform 0.22s ease; }

.sidebar.sidebar-collapsed { width: 56px; min-width: 56px; }

.sidebar.sidebar-collapsed .sidebar-logo-name,
.sidebar.sidebar-collapsed .sidebar-logo-sub,
.sidebar.sidebar-collapsed .nav-label,
.sidebar.sidebar-collapsed .nav-badge,
.sidebar.sidebar-collapsed .nav-badge-dot,
.sidebar.sidebar-collapsed .sidebar-section-label,
.sidebar.sidebar-collapsed .user-info,
.sidebar.sidebar-collapsed #user-chevron,
.sidebar.sidebar-collapsed .scb-label,
.sidebar.sidebar-collapsed .sidebar-divider { display: none; }

.sidebar.sidebar-collapsed .sidebar-logo { justify-content: center; padding: 18px 0 14px; }
.sidebar.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; gap: 0; }
.sidebar.sidebar-collapsed .nav-item .nav-icon { opacity: 0.75; }
.sidebar.sidebar-collapsed .nav-item.active .nav-icon { opacity: 1; }
.sidebar.sidebar-collapsed .sidebar-section { padding: 8px 4px 0; }
.sidebar.sidebar-collapsed .sidebar-footer { padding: 10px 4px 14px; }
.sidebar.sidebar-collapsed .sidebar-user { justify-content: center; padding: 8px 0; }
.sidebar.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; padding: 10px 0; gap: 0; }
.sidebar.sidebar-collapsed .sidebar-collapse-btn .scb-icon { transform: rotate(180deg); }

/* ── Main area ──────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ── Top bar ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-left { display: flex; flex-direction: column; }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.topbar-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Page content ───────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-gutter: stable;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(37,99,235,0.25);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-blue); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--border-strong); }

.btn-ghost { color: var(--text-muted); padding: 8px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(220,38,38,0.15); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

.card-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 16px 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Metric cards ───────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.metric-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--accent);
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.metric-delta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-delta.up { color: var(--green); }
.metric-delta.down { color: var(--red); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green  { background: var(--green-bg);  color: #15803d; }
.badge-amber  { background: var(--amber-bg);  color: #b45309; }
.badge-red    { background: var(--red-bg);    color: #b91c1c; }
.badge-blue   { background: var(--blue-bg);   color: #1d4ed8; }
.badge-purple { background: var(--purple-bg); color: #6d28d9; }
.badge-gray   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); cursor: pointer; }

/* ── Inputs ─────────────────────────────────────────────── */
.input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.input::placeholder { color: var(--text-dim); }

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Layout grids ───────────────────────────────────────── */
.content-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── Section header ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Avatar ─────────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-tint2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 42px; height: 42px; font-size: 15px; }

/* ── Status dot ─────────────────────────────────────────── */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.status-dot.green  { background: var(--green); }
.status-dot.amber  { background: var(--amber); }
.status-dot.red    { background: var(--red); }
.status-dot.blue   { background: var(--blue); }
.status-dot.gray   { background: var(--text-dim); }

/* ── Pipeline stages bar ────────────────────────────────── */
.pipeline-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 6px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
  flex: 1;
}

.pipeline-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* ── Activity feed ──────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--accent-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}

.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-item {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.tab-item:hover { color: var(--text); }

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Search bar ─────────────────────────────────────────── */
.search-wrap {
  position: relative;
}

.search-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-wrap .input { padding-left: 34px; }

/* ── Dropdown menu ──────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  padding: 4px;
  display: none;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}

.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--red); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.22s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Toast notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toast-in 0.22s ease;
  max-width: 340px;
}

.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Client card ─────────────────────────────────────────── */
.client-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.client-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.client-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.client-name { font-size: 14.5px; font-weight: 700; color: var(--text); }
.client-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.client-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.client-stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); }
.client-stat-value { font-size: 18px; font-weight: 800; color: var(--text); margin-top: 2px; letter-spacing: -0.3px; }

/* ── Script card ─────────────────────────────────────────── */
.script-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease;
}

.script-card:hover { box-shadow: var(--shadow); }

.script-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.script-hook { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.script-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Inbox / conversation ───────────────────────────────── */
.conv-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}

.conv-item:hover { background: var(--bg); }
.conv-item.unread { background: var(--accent-tint); }

.conv-body { flex: 1; overflow: hidden; }
.conv-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.conv-preview { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* ── Progress bar ───────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.progress-fill.green { background: var(--green); }
.progress-fill.amber { background: var(--amber); }

/* ── Utility ─────────────────────────────────────────────── */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-1           { gap: 4px; }
.gap-2           { gap: 8px; }
.gap-3           { gap: 12px; }
.gap-4           { gap: 16px; }
.gap-5           { gap: 20px; }
.mt-1            { margin-top: 4px; }
.mt-2            { margin-top: 8px; }
.mt-3            { margin-top: 12px; }
.mt-4            { margin-top: 16px; }
.mt-5            { margin-top: 20px; }
.mb-2            { margin-bottom: 8px; }
.mb-3            { margin-bottom: 12px; }
.mb-4            { margin-bottom: 16px; }
.mb-5            { margin-bottom: 20px; }
.text-muted      { color: var(--text-muted); }
.text-sm         { font-size: 12px; }
.text-xs         { font-size: 11px; }
.font-bold       { font-weight: 700; }
.font-semibold   { font-weight: 600; }
.w-full          { width: 100%; }
.truncate        { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Soft-nav fade-in ───────────────────────────────────── */
@keyframes snav-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.snav-fadein {
  animation: snav-fadein 0.15s ease forwards;
}

/* ── Mobile ──────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .app-shell { height: 100dvh; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }

  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.35); }
  .sidebar-overlay.open { display: block; }
  .mobile-menu-btn { display: flex; }
  .sidebar-collapse-btn { display: none; }
  .sidebar.sidebar-collapsed { width: var(--sidebar-width); min-width: var(--sidebar-width); }

  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .metric-value { font-size: 22px; }
  .content-grid, .two-col, .three-col { grid-template-columns: 1fr !important; }
}
