/* ==========================================================================
   WA Hero — dashboard design system (client area + admin)
   Mobile first where it matters: sidebar becomes a drawer below 960px,
   tables turn into stacked cards below 720px (labels filled in by app.js).
   ========================================================================== */

:root {
  --brand: #16A34A;
  --brand-600: #15803D;
  --brand-50: #F0FDF4;
  --brand-100: #DCFCE7;
  --accent: #22C55E;
  --accent-dark: #16A34A;

  --sidebar-bg: #0A1A13;
  --sidebar-bg-2: #0E241A;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: rgba(34,197,94,.14);
  --sidebar-text: #9DB5AA;
  --sidebar-muted: #5E7A6D;

  --page-bg: #F4F6F5;
  --card-bg: #FFFFFF;
  --surface-2: #F8FAF9;
  --border: #E3E8E5;
  --border-strong: #CFD8D3;
  --text-main: #0F1F17;
  --text-2: #33443C;
  --text-muted: #66766E;
  --text-faint: #98A6A0;

  --danger: #DC2626; --danger-50: #FEF2F2; --danger-100: #FEE2E2; --danger-700: #B91C1C;
  --warning: #D97706; --warning-50: #FFFBEB; --warning-100: #FEF3C7; --warning-700: #92400E;
  --info: #2563EB; --info-50: #EFF6FF; --info-100: #DBEAFE; --info-700: #1D4ED8;
  --purple-50: #F5F3FF; --purple-700: #6D28D9;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,31,23,.05);
  --shadow: 0 1px 3px rgba(15,31,23,.06), 0 1px 2px rgba(15,31,23,.04);
  --shadow-lg: 0 12px 32px rgba(15,31,23,.14);
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--page-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn:hover, a.sidebar-link:hover, a.stat-card:hover, a.settings-card:hover, a.list-row:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 650; }
h4 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 10px; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .9em; background: #EEF2F0; color: var(--text-2); padding: 1px 6px; border-radius: 5px; word-break: break-word; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }

/* ---------- Layout shell ---------- */
.app-layout { display: flex; min-height: 100vh; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 28px 40px; width: 100%; max-width: 1280px; }
.content.narrow { max-width: 860px; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; height: var(--topbar-h);
  font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #22C55E, #15803D);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 4px 12px rgba(34,197,94,.35);
}
.brand-mark .ic { width: 18px; height: 18px; }
.sidebar-logo small { font-size: 11px; font-weight: 600; color: var(--sidebar-muted); margin-left: auto; text-transform: uppercase; letter-spacing: .06em; }
.sidebar-nav { padding: 10px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section-label {
  font-size: 11px; letter-spacing: .08em; font-weight: 600;
  color: var(--sidebar-muted); padding: 14px 12px 6px; text-transform: uppercase;
}
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--sidebar-text);
  position: relative;
}
.sidebar-link .ic { width: 18px; height: 18px; opacity: .85; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active); color: #fff; }
.sidebar-link.active .ic { color: var(--accent); opacity: 1; }
.sidebar-link.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar-link .label { flex: 1; min-width: 0; }
.nav-count {
  background: #EF4444; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-footer {
  margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--sidebar-text);
}
.sidebar-user:hover { background: var(--sidebar-hover); text-decoration: none; }
.sidebar-user .name { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .sub { color: var(--sidebar-muted); font-size: 12px; }
.sidebar-user > div { min-width: 0; flex: 1; }
.sidebar-logout { margin-top: 4px; width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }
.sidebar-close { display: none; margin-left: auto; background: none; border: 0; color: var(--sidebar-text); padding: 6px; cursor: pointer; border-radius: 8px; }
.sidebar-close:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-backdrop { display: none; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #22C55E, #0E7490); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; letter-spacing: .02em;
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

/* ---------- Topbar ---------- */
.topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
  padding: 10px 28px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 30;
}
.menu-btn {
  display: none; background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; color: var(--text-main); flex-shrink: 0;
}
.menu-btn:hover { background: var(--surface-2); }
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar-title > div { min-width: 0; }
.topbar h1 { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 13px; color: var(--text-muted); margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-link {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; background: #fff;
}
.back-link:hover { background: var(--surface-2); }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar-actions form { margin: 0; }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff;
  font-size: 13px; font-weight: 600; color: var(--text-main); white-space: nowrap; cursor: pointer; font-family: inherit;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip .ic { width: 16px; height: 16px; color: var(--brand); }
.chip.chip-danger { border-color: #FECACA; background: var(--danger-50); color: var(--danger-700); }
.chip.chip-danger .ic { color: var(--danger); }

/* user dropdown */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary:hover .avatar { box-shadow: 0 0 0 3px var(--brand-100); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 50;
}
.dropdown-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-head span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px;
  color: var(--text-main); font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown-item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-item .ic { width: 16px; height: 16px; color: var(--text-muted); }
.dropdown-item.danger { color: var(--danger-700); }
.dropdown-item.danger .ic { color: var(--danger); }
.dropdown-menu form { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  cursor: pointer; border: 1px solid transparent; background: none; color: var(--text-main);
  white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
  text-decoration: none;
}
.btn .ic { width: 16px; height: 16px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(34,197,94,.3); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary, .btn-solid-green { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(22,163,74,.3); }
.btn-primary:hover, .btn-solid-green:hover { background: var(--brand-600); color: #fff; }
.btn-secondary, .btn-outline-gray { border-color: var(--border-strong); color: var(--text-main); background: #fff; box-shadow: var(--shadow-sm); }
.btn-secondary:hover, .btn-outline-gray:hover { background: var(--surface-2); border-color: #BAC6C0; }
.btn-outline-blue { border-color: #BFDBFE; color: var(--info-700); background: #fff; }
.btn-outline-blue:hover { background: var(--info-50); }
.btn-outline-red { border-color: #FECACA; color: var(--danger-700); background: #fff; }
.btn-outline-red:hover { background: var(--danger-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-700); color: #fff; }
.btn-dark-danger { background: #7F1D1D; color: #fff; }
.btn-dark-danger:hover { background: #651515; color: #fff; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.card + .card, .card + form, form + .card, .grid + .card, .card + .grid, .section + .section, .stat-grid + .card, .alert + .card { margin-top: 18px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-header > div { min-width: 0; }
.card-title { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--brand); }
.card-sub { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 0; }
.card-footer { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-header { padding: 18px 22px 0; }
.card-danger { border-color: #FECACA; }
.card-danger .card-title, .card-danger .card-title .ic { color: var(--danger-700); }
.card.muted { background: var(--surface-2); }
.section-title { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 26px 0 12px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 18px; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px; color: inherit; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.stat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card > div:last-child { min-width: 0; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon .ic { width: 20px; height: 20px; }
.stat-number { font-size: 24px; font-weight: 750; line-height: 1.15; letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.stat-hint { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.tone-green { background: var(--brand-50); color: var(--brand); }
.tone-blue { background: var(--info-50); color: var(--info); }
.tone-purple { background: var(--purple-50); color: var(--purple-700); }
.tone-amber { background: var(--warning-50); color: var(--warning); }
.tone-orange { background: #FFF7ED; color: #EA580C; }
.tone-red { background: var(--danger-50); color: var(--danger); }
.tone-gray { background: #F1F5F3; color: var(--text-muted); }

/* key-value tiles inside a card */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kv { min-width: 0; }
.kv-k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 4px; }
.kv-v { font-size: 15px; font-weight: 650; word-break: break-word; }
.kv-v.big { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.summary-list { display: flex; flex-direction: column; }
.summary-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.summary-list > div > span:first-child { color: var(--text-muted); }
.summary-list > div > span:last-child { text-align: right; font-weight: 550; }
.summary-list > div.total { border-bottom: 0; font-size: 16px; font-weight: 700; }
.summary-list > div.total > span { color: var(--text-main) !important; font-weight: 750 !important; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card > .table-wrap:first-child { margin-top: -4px; }
.card.flush .table-wrap { padding: 0; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th {
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
table.data-table tbody tr:hover td { background: #FAFCFB; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table th:first-child, table.data-table td:first-child { padding-left: 18px; }
table.data-table th:last-child, table.data-table td:last-child { padding-right: 18px; }
.card:not(.flush) table.data-table { margin: 0 -22px; width: calc(100% + 44px); }
.card:not(.flush) .table-wrap { margin: 0 -22px; width: calc(100% + 44px); }
.card:not(.flush) .table-wrap table.data-table { margin: 0; width: 100%; }
.card:not(.flush) table.data-table th:first-child, .card:not(.flush) table.data-table td:first-child { padding-left: 22px; }
.card:not(.flush) table.data-table th:last-child, .card:not(.flush) table.data-table td:last-child { padding-right: 22px; }
.card:not(.flush) > .table-wrap:last-child, .card:not(.flush) > table.data-table:last-child { margin-bottom: -20px; }
.card:not(.flush) > .table-wrap:last-child table tr:last-child td { padding-bottom: 16px; }
td.empty, .empty-state { text-align: center; color: var(--text-faint); padding: 34px 14px !important; }
.empty-state .ic { width: 34px; height: 34px; color: #C2CEC8; display: block; margin: 0 auto 8px; }
.cell-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.cell-strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cell-actions form { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.badge-active, .badge-success { background: var(--brand-100); color: var(--brand-600); }
.badge-suspended, .badge-danger { background: var(--danger-100); color: var(--danger-700); }
.badge-unverified, .badge-warning { background: var(--warning-100); color: var(--warning-700); }
.badge-info { background: var(--info-100); color: var(--info-700); }
.badge-purple { background: #EDE9FE; color: var(--purple-700); }
.badge-pink { background: #FCE7F3; color: #BE185D; }
.badge-neutral { background: #EEF2F0; color: #4B5B53; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--brand-600); font-weight: 600; }
.status-bad { color: var(--danger-700); font-weight: 600; }
.status-warn { color: var(--warning-700); font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 14px; } .mb-3 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 10px;
  border: 1px solid; font-size: 14px; margin-bottom: 18px;
}
.alert > .ic { margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-body b, .alert-body strong { font-weight: 650; }
.alert .btn-row, .alert form { flex-shrink: 0; }
.alert-success { background: var(--brand-50); border-color: #BBF7D0; color: #14532D; }
.alert-success > .ic { color: var(--brand); }
.alert-error { background: var(--danger-50); border-color: #FECACA; color: #7F1D1D; }
.alert-error > .ic { color: var(--danger); }
.alert-warning { background: var(--warning-50); border-color: #FDE68A; color: #78350F; }
.alert-warning > .ic { color: var(--warning); }
.alert-info { background: var(--info-50); border-color: #BFDBFE; color: #1E3A8A; }
.alert-info > .ic { color: var(--info); }
.card > .alert:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; min-width: 0; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-label .opt { font-weight: 400; color: var(--text-faint); }
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.45; }
.form-control,
.content input[type=text], .content input[type=email], .content input[type=password], .content input[type=number],
.content input[type=time], .content input[type=datetime-local], .content input[type=url], .content input[type=tel],
.content input:not([type]), .content select, .content textarea {
  width: 100%; max-width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  font: inherit; font-size: 14px; color: var(--text-main);
  transition: border-color .15s, box-shadow .15s;
}
.content textarea, textarea.form-control { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 84px; }
.content select, select.form-control {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366766E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.form-control:focus, .content input:focus, .content select:focus, .content textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
.content input::placeholder, .content textarea::placeholder { color: #A7B3AD; }
.content input[type=file] {
  width: 100%; max-width: 420px; font: inherit; font-size: 13px; color: var(--text-muted);
  padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2);
}
.content input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 13px; border: 1px solid var(--border-strong); background: #fff;
  border-radius: 6px; padding: 6px 10px; margin-right: 10px; cursor: pointer; color: var(--text-main);
}
.content input[type=checkbox], .content input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; flex-shrink: 0; }
.form-control.sm, .content .input-sm { height: 32px; font-size: 13px; padding: 0 9px; }
.form-control.w-auto, .content select.w-auto { width: auto; }
.w-xs { max-width: 110px !important; } .w-sm { max-width: 180px !important; } .w-md { max-width: 420px !important; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.split-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.form-row.split-3-1 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; margin-bottom: 14px; line-height: 1.4; }
.check input { margin-top: 2px !important; }
.check b { font-weight: 600; }
.check-row { display: flex; gap: 20px; flex-wrap: wrap; }
.check-row .check { margin-bottom: 8px; }
.input-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input-group > input, .input-group > select { flex: 1; min-width: 140px; }
.input-suffix { display: flex; align-items: center; gap: 10px; }
.content .input-suffix input { max-width: 130px; }
.input-suffix span { color: var(--text-muted); font-size: 14px; }
.inline-result { font-size: 13px; font-weight: 500; }
.panel {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-top: 14px;
}
.panel > :last-child { margin-bottom: 0; }

/* Toggle switch (checkbox with .switch) */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px !important; height: 22px !important; border-radius: 999px; background: #CBD5D0; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { box-shadow: 0 0 0 3px rgba(34,197,94,.3); outline: none; }

/* code / key display */
.code-box {
  display: flex; align-items: center; gap: 10px; background: #0F1A15; color: #A7F3D0;
  border-radius: 10px; padding: 10px 10px 10px 14px; font-family: var(--mono); font-size: 13px;
}
.code-box > span, .code-box > code { flex: 1; min-width: 0; word-break: break-all; background: none; color: inherit; padding: 0; }
.code-box .btn { flex-shrink: 0; background: rgba(255,255,255,.08); color: #E2E8F0; border-color: rgba(255,255,255,.12); box-shadow: none; }
.code-box .btn:hover { background: rgba(255,255,255,.16); }
pre.code {
  background: #0F1A15; color: #D1FAE5; padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  font-size: 12.5px; line-height: 1.6; margin: 0 0 14px; white-space: pre;
}
.log-box { font-family: var(--mono); font-size: 12px; background: #0F1A15; color: #D1FAE5; border-radius: 10px; padding: 14px; max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ---------- Tabs / filters ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--text-muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--text-main); text-decoration: none; }
.tabs a.on, .tabs a.active { color: var(--brand-600); border-bottom-color: var(--accent); }
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.seg a:hover { background: var(--surface-2); text-decoration: none; }
.seg a.on { background: var(--text-main); border-color: var(--text-main); color: #fff; }

/* ---------- Settings / plan cards ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.settings-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; color: inherit; display: block; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.settings-card:hover { border-color: #A7DDBA; box-shadow: var(--shadow); transform: translateY(-1px); }
.settings-card h3 { margin: 14px 0 4px; font-size: 15px; }
.settings-card p { margin: 0; font-size: 13px; color: var(--text-muted); }
.settings-card.disabled { opacity: .65; }
.coming-soon-badge { position: absolute; top: 16px; right: 16px; background: #EEF2F0; color: var(--text-muted); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.settings-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.settings-card .go { position: absolute; top: 20px; right: 18px; color: var(--text-faint); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.plan-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: relative;
  display: flex; flex-direction: column; gap: 4px; background: #fff;
}
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.plan-card .plan-name { font-weight: 650; font-size: 15px; }
.plan-card .plan-price { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; margin: 6px 0 2px; }
.plan-card .plan-price small { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.plan-card .plan-feat { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.plan-card .plan-cta { margin-top: auto; }
.plan-card .plan-cta form { margin: 0; }
.plan-card .badge { position: absolute; top: 14px; right: 14px; }

.progress { height: 8px; background: #EEF2F0; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* list rows (conversations, tickets) */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); color: inherit; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #FAFCFB; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-row .preview { color: var(--text-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.list-row .meta { color: var(--text-muted); font-size: 12px; text-align: right; white-space: nowrap; flex-shrink: 0; }

/* support thread */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .bubble { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.msg.mine .bubble { background: var(--brand-50); border-color: #CDEFD8; }
.msg .who { font-size: 13px; font-weight: 650; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; margin-bottom: 4px; }
.msg .who time { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.msg .body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.avatar.staff { background: linear-gradient(135deg, #2563EB, #7C3AED); }

/* hero / feature blocks */
.hero-card {
  background: radial-gradient(1200px 300px at 100% 0%, rgba(34,197,94,.18), transparent 60%), linear-gradient(135deg, #0F2A1E, #0A1A13);
  color: #fff; border-radius: 14px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.hero-card + .hero-card, .card + .hero-card, .hero-card + .card { margin-top: 18px; }
.hero-card .hero-icon { width: 52px; height: 52px; border-radius: 12px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #86EFAC; }
.hero-card .hero-icon .ic { width: 26px; height: 26px; }
.hero-card h3 { color: #fff; font-size: 17px; margin-bottom: 4px; }
.hero-card p { color: #A9C4B8; font-size: 13.5px; margin: 0; }
.hero-card .hero-main { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.hero-card .pill { display: inline-flex; background: rgba(34,197,94,.18); color: #86EFAC; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-top: 8px; margin-right: 6px; }
.hero-card .pill.muted { background: rgba(255,255,255,.08); color: #C7D7CF; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.step { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--surface-2); }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); font-size: 12px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.step b { display: block; margin-bottom: 4px; }
.step span { font-size: 13px; color: var(--text-muted); }
.checklist { display: flex; flex-direction: column; }
.checklist > div { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.checklist > div:last-child { border-bottom: 0; }
.checklist .n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 750; flex-shrink: 0; background: #EEF2F0; color: var(--text-muted); }
.checklist .n.ok { background: var(--brand-100); color: var(--brand-600); }
.checklist .grow { flex: 1; min-width: 0; }

.qr-box { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 12px; background: #fff; text-align: center; max-width: 100%; }
.qr-box img { width: 220px; max-width: 100%; border-radius: 8px; }
.pair-code { font-size: 28px; font-weight: 800; letter-spacing: 5px; color: var(--brand); font-family: var(--mono); }
.conn-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.conn-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px var(--danger-100); flex-shrink: 0; }
.conn-status .dot.on { background: var(--accent); box-shadow: 0 0 0 4px var(--brand-100); }
.agent-list { display: grid; gap: 10px; margin: 10px 0 4px; }
.agent-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: grid; gap: 4px; }
.conn-status .grow { flex: 1; min-width: 0; }

/* ---------- Auth pages ---------- */
.auth-body { min-height: 100vh; display: flex; background: var(--page-bg); }
.auth-aside {
  width: 44%; max-width: 560px; padding: 44px 48px; color: #fff; display: flex; flex-direction: column;
  background: radial-gradient(900px 400px at 0% 0%, rgba(34,197,94,.22), transparent 60%), linear-gradient(160deg, #0F2A1E 0%, #0A1A13 70%);
}
.auth-aside .sidebar-logo { padding: 0; height: auto; border: 0; font-size: 19px; }
.auth-aside h2 { font-size: 32px; line-height: 1.2; margin: auto 0 14px; letter-spacing: -0.02em; }
.auth-aside p { color: #A9C4B8; font-size: 15px; max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 auto; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #D7E6DF; font-size: 14px; }
.auth-points .ic { color: #4ADE80; }
.auth-aside .foot { color: #5E7A6D; font-size: 12px; margin-top: 30px; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .mobile-logo { display: none; margin-bottom: 26px; color: var(--text-main); }
.auth-card h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .lead { color: var(--text-muted); margin-bottom: 24px; }
.auth-card .form-control { height: 44px; }
.auth-card .btn-primary { height: 44px; width: 100%; font-size: 15px; }
.auth-links { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-muted); display: flex; flex-direction: column; gap: 8px; }
.auth-links a { font-weight: 600; color: var(--brand-600); }
.auth-card .alert { font-size: 13.5px; }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.pw-toggle:hover { background: var(--surface-2); }

/* ---------- Docs page ---------- */
.doc h2 { font-size: 18px; margin: 34px 0 12px; padding-top: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; scroll-margin-top: 80px; }
.doc h2:first-child { margin-top: 0; }
.doc h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.doc p, .doc li { color: var(--text-2); }
.doc ul { padding-left: 20px; margin: 8px 0 14px; }
.doc li { margin-bottom: 6px; }
.endpoint { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-family: var(--mono); font-size: 13px; }
.endpoint code { background: none; padding: 0; flex: 1; min-width: 0; word-break: break-all; }
.method { background: var(--brand); color: #fff; font-weight: 700; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-family: var(--font); letter-spacing: .03em; flex-shrink: 0; }
.doc-toc { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-toc a { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 550; }
.doc-toc a:hover { background: var(--brand-50); border-color: #BBF7D0; text-decoration: none; }
table.simple { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 14px; }
table.simple th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
table.simple td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.simple td:first-child { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100%;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: none; width: 280px;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(5,15,10,.45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 35; }
  body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .sidebar-close { display: inline-flex; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 32px; }
  .auth-aside { display: none; }
  .auth-card .mobile-logo { display: flex; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .topbar-sub { display: none; }
  .topbar-actions { order: 5; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .topbar-user .chip .chip-text { display: none; }
  .topbar-user .chip { padding: 0 10px; }
  .grid-2, .grid-3, .form-row, .form-row.cols-2, .form-row.split-1-2, .form-row.split-3-1 { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .stat-icon { width: 34px; height: 34px; border-radius: 9px; }
  .stat-icon .ic { width: 17px; height: 17px; }
  .stat-number { font-size: 21px; }
  .stat-grid > :last-child:nth-child(odd) { grid-column: span 2; flex-direction: row; align-items: center; }
  .card { padding: 16px; border-radius: 12px; }
  .card:not(.flush) table.data-table, .card:not(.flush) .table-wrap { margin: 0 -16px; width: calc(100% + 32px); }
  .card:not(.flush) > .table-wrap:last-child, .card:not(.flush) > table.data-table:last-child { margin-bottom: -16px; }
  .card-header { margin-bottom: 12px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-card { padding: 18px; }
  .hero-card > .btn, .hero-card > span { width: 100%; }
  .btn-row-stack { flex-direction: column; align-items: stretch; }
  .btn-row-stack > *, .btn-row-stack form, .btn-row-stack form .btn { width: 100%; }
  .alert { flex-wrap: wrap; }
  .alert .btn-row, .alert > form { width: 100%; }
  .input-group > .btn, .input-group > button { width: 100%; }
  .content input[type=text], .content input[type=email], .content input[type=password], .content input[type=number], .content select, .content textarea { font-size: 16px; } /* no iOS zoom */
  .list-row .preview { max-width: 100%; }

  /* tables → stacked cards (app.js adds data-label and .stacked) */
  table.data-table.stacked thead { display: none; }
  table.data-table.stacked, table.data-table.stacked tbody, table.data-table.stacked tr, table.data-table.stacked td { display: block; width: 100%; }
  .card:not(.flush) table.data-table.stacked { margin: 0; width: 100%; }
  .card:not(.flush) .table-wrap.has-stacked { margin: 0; width: 100%; overflow: visible; }
  .card:not(.flush) > .table-wrap.has-stacked:last-child { margin-bottom: 0; }
  table.data-table.stacked tr { border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px; margin-bottom: 10px; background: #fff; }
  table.data-table.stacked tr:last-child { margin-bottom: 0; }
  table.data-table.stacked tbody tr:hover td { background: none; }
  table.data-table.stacked td { border-bottom: 1px solid #EEF2F0; padding: 9px 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; min-height: 40px; }
  table.data-table.stacked td:last-child { border-bottom: 0; }
  table.data-table.stacked td.td-empty { display: none; }
  table.data-table.stacked td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: left; flex-shrink: 0; max-width: 45%; }
  table.data-table.stacked td[data-label=""]::before { display: none; }
  table.data-table.stacked td[data-label=""] { justify-content: flex-end; }
  table.data-table.stacked td.empty, table.data-table.stacked td[colspan] { justify-content: center; text-align: center; }
  table.data-table.stacked td[colspan]::before { display: none; }
  table.data-table.stacked td > * { max-width: 100%; }
  table.data-table.stacked td.truncate { max-width: none; white-space: normal; }
  table.data-table.stacked .cell-actions, table.data-table.stacked td > .btn-row { justify-content: flex-end; }
  table.data-table.stacked td.td-block { flex-direction: column; align-items: stretch; text-align: left; }
  table.data-table.stacked td.td-block .cell-actions { justify-content: flex-start; }
  table.data-table.stacked td.td-first { font-weight: 650; font-size: 15px; text-align: left; justify-content: flex-start; }
  table.data-table.stacked td.td-first::before { display: none; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .btn { padding: 0 12px; }
}

@media print {
  .sidebar, .topbar, .menu-btn { display: none !important; }
  .content { padding: 0; }
}
.sidebar-home { display: flex; align-items: center; gap: 10px; color: #fff; }
.sidebar-home:hover { text-decoration: none; color: #fff; }
.content .pw-wrap input { padding-right: 44px; }
.grid > .card, .grid > section, .grid > form, .grid > .stack { margin-top: 0; }
.agent-rules { padding: 16px 0; border-top: 1px solid var(--border); }
.agent-rules:first-of-type { border-top: 0; }
.agent-pre { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 6px 0 0; max-height: 260px; overflow: auto; }
.op-list { display: grid; gap: 8px; }
.op-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.op-main { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 320px; min-width: 0; cursor: pointer; }
.op-main span b { display: block; }
.op-path { display: block; word-break: break-all; }
.op-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.op-opts select { width: auto; max-width: 100%; }
@media (max-width: 560px) { .op-opts, .op-opts select { width: 100%; } }
.web-add { align-items: flex-end; }
.web-add-btn { flex: 0 0 auto; }
/* AI Assistant setup (views/client/ai-setup.ejs) */
.setup-wrap { max-width: 720px; }
.setup-steps { list-style: none; display: flex; gap: 18px; margin: 0 0 14px; padding: 0; font-size: 14px; color: var(--text-muted); }
.setup-steps li { display: flex; align-items: center; gap: 8px; }
.setup-steps li span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.setup-steps li.on { color: var(--text); font-weight: 600; }
.setup-steps li.on span { background: var(--brand, #16a34a); border-color: transparent; color: #fff; }
.setup-steps li.done span { background: var(--surface-2); }
.setup-about { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: grid; gap: 4px; }
.setup-about[hidden] { display: none; }
.setup-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.setup-foot label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.card-header .btn { flex: 0 0 auto; }
/* AI page: what it has learned */
.learn-how { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; }
.learn-ex { margin: 2px 0 2px 18px; padding: 0; display: grid; gap: 4px; }
.learn-row.is-off { opacity: .65; }
.learn-detail { margin-top: 6px; }
.learn-detail summary { cursor: pointer; color: var(--text-muted); }
.learn-detail > div { margin-top: 4px; }
