/* Operator app. Tokens follow the reference notes in reference/highlevel/live/00-shell-dashboard.md. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --side-w: 224px; --side-bg: #2D3748; --side-active: #1A202C; --side-text: #fff; --side-mute: #A0AEC0;
  --top-h: 53px; --bg: #F2F7FA; --card: #fff; --text: #101828; --text-2: #344054; --mute: #667085; --mute-2: #98A2B3;
  --line: #EAECF0; --line-2: #D0D5DD; --primary: #155EEF; --primary-700: #004EEB; --primary-50: #EFF4FF; --primary-100: #D1E0FF;
  --green: #12B76A; --green-50: #ECFDF3; --green-700: #027A48; --red: #F04438; --red-50: #FEF3F2; --red-700: #B42318;
  --orange: #F79009; --orange-50: #FFFAEB; --orange-700: #B54708; --purple: #7A5AF8; --purple-50: #F4F3FF;
  --gray-50: #F9FAFB; --gray-100: #F2F4F7; --gray-200: #EAECF0;
  --r: 4px; --r-lg: 8px; --shadow-xs: 0 1px 2px rgba(16,24,40,.05); --shadow: 0 1px 3px rgba(16,24,40,.1), 0 1px 2px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 16px -4px rgba(16,24,40,.08), 0 4px 6px -2px rgba(16,24,40,.03);
  --font: 'Inter', Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text-2); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
h1, h2, h3, h4 { color: var(--text); margin: 0; font-weight: 600; }
h1 { font-size: 24px; line-height: 32px; } h2 { font-size: 18px; line-height: 28px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
.ic { flex: none; vertical-align: middle; }
.mute { color: var(--mute); } .small { font-size: 12px; } .strong { font-weight: 600; color: var(--text); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; } .col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .end { justify-content: flex-end; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; z-index: 30; transition: width .15s; }
.side .brand { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.side .brand .logo { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #2E90FA, #7A5AF8); display: grid; place-items: center; font-size: 13px; }
.side .acct { margin: 0 12px 10px; padding: 8px 10px; border-radius: 6px; background: rgba(255,255,255,.08); display: flex; align-items: center; gap: 8px; }
.side .acct b { display: block; font-size: 13px; } .side .acct span { font-size: 11px; color: var(--side-mute); }
.side .search { margin: 0 12px 10px; display: flex; gap: 6px; }
.side .search button.box { flex: 1; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 6px; background: rgba(255,255,255,.08); color: var(--side-mute); border: 0; text-align: left; font-size: 13px; }
.side .search kbd { margin-left: auto; font: 11px var(--font); background: rgba(255,255,255,.12); border-radius: 4px; padding: 1px 5px; color: #CBD5E0; }
.side .search .bolt { width: 32px; height: 32px; border-radius: 6px; border: 0; background: #12B76A; color: #fff; display: grid; place-items: center; }
.side nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.side nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; margin-bottom: 2px; border-radius: 6px; color: var(--side-text); font-weight: 500; text-decoration: none; }
.side nav a:hover { background: rgba(255,255,255,.06); }
.side nav a.on { background: var(--side-active); }
.side nav a .ic { color: #CBD5E0; }
.side nav hr { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 10px 4px; }
.side .foot { padding: 8px 12px 14px; border-top: 1px solid rgba(255,255,255,.1); }
.side .toggle { position: absolute; top: 64px; right: -12px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); }
.side .back { display: inline-flex; align-items: center; gap: 6px; margin: 16px 16px 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-weight: 500; text-decoration: none; }
.side .back:hover { background: rgba(255,255,255,.16); text-decoration: none; }
.side .set-title { padding: 6px 16px 10px; font-size: 18px; font-weight: 600; }
.side .grp { padding: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--side-mute); display: flex; align-items: center; gap: 8px; }
.side .grp::after { content: ''; flex: 1; border-top: 1px solid rgba(255,255,255,.14); }
.app.collapsed .side { width: 64px; }
.app.collapsed .side .brand span, .app.collapsed .side .acct, .app.collapsed .side .search, .app.collapsed .side nav a span, .app.collapsed .side .grp, .app.collapsed .side .set-title, .app.collapsed .side .back span { display: none; }
.app.collapsed .main { margin-left: 64px; }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; transition: margin .15s; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); background: #fff; box-shadow: 0 2px 3px rgba(0,0,0,.11); display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.top .title { font-size: 16px; font-weight: 600; color: var(--text); }
.top .icons { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top .rb { width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; } .avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.subnav { background: #fff; border-bottom: 1px solid var(--line); display: flex; gap: 4px; padding: 0 20px; overflow-x: auto; }
.subnav a { padding: 14px 12px 12px; color: var(--mute); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.subnav a:hover { color: var(--text); }
.subnav a.on { color: var(--primary); border-bottom-color: var(--primary); }
/* HighLevel's two-row header: icons row (50px) + section title and tabs row (40px), one shadow under both */
.main:has(> .subnav.hl) > .top { height: 50px; box-shadow: none; }
.main:has(> .subnav.hl) > .top .title { display: none; }
.subnav.hl { position: sticky; top: 50px; z-index: 19; height: 40px; align-items: center; gap: 0; padding: 0 0 0 8px; border-bottom: 0; box-shadow: 0 2px 3px rgba(0,0,0,.11); overflow: visible; }
.subnav.hl .subnav-t { font-size: 18px; font-weight: 500; line-height: 28px; color: #1F2937; margin-right: 12px; white-space: nowrap; }
.subnav.hl a { margin: 0 4px; padding: 0 8px 8px; margin-top: 8px; line-height: 25.6px; font-size: 14px; font-weight: 500; color: #4B5563; border-bottom-width: 2px; }
.subnav.hl a:hover { color: #1F2937; text-decoration: none; }
.subnav.hl a.on { color: #38A0DB; border-bottom-color: #38A0DB; }
.page { padding: 24px; flex: 1; min-width: 0; }
.page.flush { padding: 0; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .t { flex: 1; min-width: 240px; } .page-head p { margin: 4px 0 0; color: var(--mute); }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.full { position: fixed; inset: 0; background: var(--bg); z-index: 40; display: flex; flex-direction: column; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: #fff; color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; box-shadow: var(--shadow-xs); text-decoration: none; }
.btn:hover { background: var(--gray-50); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-700); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-outline { color: var(--red-700); border-color: #FDA29B; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--gray-100); }
.btn.link { border: 0; background: none; box-shadow: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon { width: 40px; padding: 0; } .btn.icon.sm { width: 32px; } .btn.icon.xs { width: 26px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; } .btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.btn-group .btn.on { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); z-index: 1; }
.dot-dirty { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); display: inline-block; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .lbl { font-size: 14px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--mute); }
.field .err { font-size: 12px; color: var(--red-700); }
.req::after { content: ' *'; color: var(--red); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; box-shadow: var(--shadow-xs); outline: none; }
.input.sm, .select.sm { height: 32px; font-size: 13px; }
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: #84ADFF; box-shadow: 0 0 0 4px rgba(21,94,239,.12); }
.input.bad { border-color: #FDA29B; }
.select { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.searchbox { position: relative; } .searchbox .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--mute-2); }
.searchbox .input { padding-left: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.toggle { position: relative; width: 36px; height: 20px; flex: none; border-radius: 999px; background: var(--gray-200); border: 0; padding: 0; transition: background .15s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: left .15s; }
.toggle.on { background: var(--primary); } .toggle.on::after { left: 18px; }
.toggle:disabled { opacity: .5; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.radio-card { border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px; background: #fff; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.radio-card.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-50); }
.radio-card b { color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--gray-100); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip button { border: 0; background: none; padding: 0; color: var(--mute); display: grid; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--gray-100); color: var(--text-2); }
.pill.green { background: var(--green-50); color: var(--green-700); } .pill.red { background: var(--red-50); color: var(--red-700); }
.pill.orange { background: var(--orange-50); color: var(--orange-700); } .pill.blue { background: var(--primary-50); color: var(--primary); }
.pill.purple { background: var(--purple-50); color: #5925DC; }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { flex: 1; } .card-b { padding: 20px; } .card-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.kpi { padding: 16px 20px; } .kpi .l { color: var(--mute); font-size: 13px; font-weight: 500; } .kpi .v { font-size: 28px; font-weight: 600; color: var(--text); margin-top: 6px; } .kpi .s { font-size: 12px; color: var(--mute); }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; color: var(--mute); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs.pills { border: 0; gap: 4px; } .tabs.pills button { border: 0; border-radius: 6px; padding: 6px 12px; margin: 0; } .tabs.pills button.on { background: var(--primary-50); }
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 13px; }
.breadcrumb a { color: var(--mute); } .breadcrumb b { color: var(--text); font-weight: 500; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 500; color: var(--mute); background: var(--gray-50); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
table.t th.sortable { cursor: pointer; } table.t th.sortable:hover { color: var(--text); }
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--gray-50); }
table.t tr.click { cursor: pointer; }
table.t td.w1, table.t th.w1 { width: 1%; white-space: nowrap; }
table.t td .strong { color: var(--text); }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--mute); font-size: 13px; flex-wrap: wrap; }
.pager .grow { flex: 1; }
.pager button.pg { min-width: 32px; height: 32px; border-radius: var(--r); border: 1px solid var(--line-2); background: #fff; }
.pager button.pg.on { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.empty { text-align: center; padding: 56px 24px; color: var(--mute); }
.empty .ico { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin: 0 auto 16px; }
.empty h3 { margin-bottom: 4px; } .empty p { margin: 0 0 16px; }
.skeleton { background: linear-gradient(90deg, var(--gray-100), var(--gray-50), var(--gray-100)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--mute); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-lg); border: 1px solid; font-size: 13px; }
.banner.info { background: var(--primary-50); border-color: var(--primary-100); color: #00359E; }
.banner.warn { background: var(--orange-50); border-color: #FEDF89; color: var(--orange-700); }
.banner.error { background: var(--red-50); border-color: #FECDCA; color: var(--red-700); }
.banner.ok { background: var(--green-50); border-color: #A6F4C5; color: var(--green-700); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(52,64,84,.6); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; overflow-y: auto; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; display: flex; flex-direction: column; max-height: calc(100vh - 128px); }
.modal.lg { max-width: 760px; } .modal.xl { max-width: 1040px; } .modal.sm { max-width: 400px; }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 12px; } .modal-h h2 { flex: 1; } .modal-h p { margin: 4px 0 0; color: var(--mute); }
.modal-b { padding: 8px 24px 16px; overflow-y: auto; } .modal-f { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.xbtn { border: 0; background: none; color: var(--mute-2); width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; }
.xbtn:hover { background: var(--gray-100); color: var(--text); }
.drawer-bg { position: fixed; inset: 0; background: rgba(52,64,84,.4); z-index: 90; animation: fade .12s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw; background: #fff; z-index: 91; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .15s; }
.drawer.lg { width: 640px; } .drawer.xl { width: 880px; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); } .drawer-h h2 { flex: 1; font-size: 18px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 20px; } .drawer-f { display: flex; justify-content: flex-end; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.menu { position: fixed; z-index: 200; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 4px; min-width: 180px; max-height: 360px; overflow-y: auto; animation: fade .08s; }
.menu button, .menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; text-align: left; color: var(--text-2); font-size: 14px; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--gray-50); text-decoration: none; }
.menu button.danger { color: var(--red-700); } .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu.hl { border: 0; border-radius: 3px; padding: 4px 0; min-width: 193px; max-height: none; box-shadow: 0 3px 6px -4px rgba(0,0,0,.12), 0 6px 16px rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05); }
.menu.hl button, .menu.hl a { height: 34px; padding: 0 16px 0 11px; gap: 11px; border-radius: 0; color: #344054; white-space: nowrap; }
.menu.hl button:hover:not(:disabled), .menu.hl a:hover { background: #F9FAFB; }
.menu.hl hr { border-top-color: #EFEFF5; margin: 4px 0; }
.menu .mh { padding: 6px 10px 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--mute-2); }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #101828; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 560px; animation: fade .15s; }
.toast.error { background: var(--red-700); } .toast.ok .ic { color: #6CE9A6; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth .card { width: 100%; max-width: 420px; padding: 32px; }
.auth h1 { margin-bottom: 4px; } .auth .sub { color: var(--mute); margin: 0 0 24px; }
.auth .logo { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, #2E90FA, #7A5AF8); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 20px; }
