/* =================== Glee Call enterprise layer: loaded last. New components (clients, auto dialer, sign-ups) + global polish =================== */

/* ---------- global polish ---------- */
::selection { background: rgba(59, 123, 255, .22); }
:focus-visible { outline: 2px solid #3b7bff; outline-offset: 2px; }
.page-head { align-items: flex-end; margin-bottom: 18px; }
.page-head h1 { font-weight: 800; letter-spacing: -.03em; }
.page-head p { max-width: 760px; }
#view > * { animation: gc-in .28s ease both; }
@keyframes gc-in { from { opacity: 0; transform: translateY(6px); } }
.card { transition: box-shadow .2s, transform .2s, border-color .2s; }
.table-wrap { border-radius: 12px; }
thead th { position: sticky; top: 0; z-index: 1; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
tbody tr { transition: background .12s; }
.btn { font-weight: 600; }
.btn-green { background: linear-gradient(135deg, #34d399, #16a34a); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -6px rgba(22, 163, 74, .6); }
.btn-green:hover { filter: brightness(1.05); }
.empty-state { text-align: center; padding: 46px 20px; }
.empty-state svg { width: 46px; height: 46px; color: #94a3b8; margin-bottom: 8px; }
.stat .val small { font-size: 15px; color: var(--muted); font-weight: 600; }
.stat .hint { font-size: 12px; margin-top: 2px; }
.progress.sm { height: 6px; margin: 0; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3b7bff, #1d5bf0); transition: width .5s ease; }
.sidebar nav a { transition: background .15s, color .15s, transform .15s; }
.sidebar nav a:hover:not(.active) { transform: translateX(2px); }
.modal { animation: gc-pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes gc-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-bg { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@media (prefers-reduced-motion: reduce) { #view > *, .modal, .progress i { animation: none !important; transition: none !important; } }

/* segmented control + toolbar bar */
.seg { display: inline-flex; background: #eef2f8; border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: #475569; cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.cl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; }
.cl-bar .lb-search { flex: 1 1 240px; min-width: 200px; }
.cl-bar .lb-field { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- clients ---------- */
.cl-health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cl-health::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cl-health.ok { background: #e6f8ee; color: #15803d; }
.cl-health.warn { background: #fff5e0; color: #b45309; }
.cl-health.bad { background: #fdecec; color: #dc2626; }
.cl-health.off { background: #eef2f7; color: #64748b; }
.cl-seats { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.cl-seats .progress { flex: 1; }
.cl-seats small { font-weight: 600; color: var(--muted); white-space: nowrap; }
.client-card .cl-seats { margin-top: 4px; }
.cl-table td { vertical-align: middle; }
.cl-table .who a b { color: var(--text); }
.cl-table .who a:hover b { color: var(--primary); }
.cl-dialing { background: #ecfdf5 !important; color: #047857 !important; font-size: 11px; }
.cl-more { position: relative; display: inline-block; }
.cl-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; background: var(--panel, #fff); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(15, 27, 45, .28); padding: 6px; }
.cl-menu button, .cl-menu a { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.cl-menu button:hover, .cl-menu a:hover { background: var(--primary-50); }
.cl-menu svg { width: 15px; height: 15px; }
.cl-menu .danger { color: #dc2626; }
.client-card h3 a { color: inherit; }

/* client profile → activity */
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cp-pipe { display: flex; flex-direction: column; gap: 10px; }
.cp-pipe-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; font-size: 13px; padding: 2px 0; }
.cp-pipe-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
@media (max-width: 1100px) { .g2-1 { grid-template-columns: 1fr; } }

/* ---------- auto dialer ---------- */
.dl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dl-camp { position: relative; overflow: hidden; }
.dl-camp::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #cbd5e1; }
.dl-camp.running::before { background: linear-gradient(180deg, #34d399, #16a34a); }
.dl-camp.paused::before { background: #f59e0b; }
.dl-camp.done::before { background: #3b7bff; }
.dl-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dl-title { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.dl-title h3 { font-size: 16px; }
.dl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 10px; background: #cbd5e1; }
.dl-dot.running { background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: dl-pulse 1.6s infinite; }
.dl-dot.paused { background: #f59e0b; }
.dl-dot.done { background: #3b7bff; }
@keyframes dl-pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.pill.dl-st.running { background: #e6f8ee; color: #15803d; }
.pill.dl-st.paused { background: #fff5e0; color: #b45309; }
.pill.dl-st.done { background: #eaf1ff; color: #1d5bf0; }
.dl-bar { height: 8px; border-radius: 8px; background: #eef2f8; margin: 14px 0 12px; overflow: hidden; }
.dl-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3b7bff, #16a34a); transition: width .6s ease; }
.dl-nums { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.dl-nums div { display: flex; flex-direction: column; }
.dl-nums b { font-size: 17px; letter-spacing: -.02em; }
.dl-nums span { font-size: 11px; color: var(--muted); }
.dl-agents { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.dl-agent { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; }
.dl-actions { margin-top: 12px; flex-wrap: wrap; }
.dl-help ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }
.dl-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-checks .check { margin: 0; padding: 7px 11px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; font-size: 13px; }
.dl-checks .check:has(input:checked) { border-color: #3b7bff; background: #eaf1ff; }
.dl-preview { padding: 12px 14px; border-radius: 12px; background: #eaf1ff; color: #1e3a8a; font-size: 13px; }
.pill.dl-it.pending { background: #f1f5f9; color: #475569; }
.pill.dl-it.calling { background: #e6f8ee; color: #15803d; }
.pill.dl-it.done { background: #eaf1ff; color: #1d5bf0; }
.pill.dl-it.failed { background: #fff5e0; color: #b45309; }
.pill.dl-it.skipped { background: #fdecec; color: #dc2626; }
.wp-alert.dialer { background: linear-gradient(135deg, #ecfdf5, #eaf1ff); border-color: #a7f3d0; color: #065f46; }
@media (max-width: 700px) { .dl-list { grid-template-columns: 1fr; } .dl-nums { grid-template-columns: repeat(3, 1fr); } }

/* ---------- sign-up requests ---------- */
.su-list { display: flex; flex-direction: column; gap: 10px; }
.su-card { padding: 0; overflow: hidden; }
.su-top { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; }
.su-top:hover { background: rgba(59, 123, 255, .04); }
.su-main { flex: 1; min-width: 0; }
.su-main h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.su-main .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.su-when { white-space: nowrap; font-size: 12px; }
.su-chev { transition: transform .2s; color: var(--muted); display: inline-flex; }
.su-chev svg { width: 16px; height: 16px; }
.su-card.open .su-chev { transform: rotate(180deg); }
.su-body { display: none; padding: 4px 18px 18px 72px; border-top: 1px solid var(--border); }
.su-card.open .su-body { display: block; animation: gc-in .2s ease; }
.su-kv { margin: 14px 0; }
.su-msg { background: #f8fafc; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; white-space: pre-wrap; font-size: 13.5px; }
.pill.su-ok { background: #e6f8ee; color: #15803d; font-size: 11px; }
@media (max-width: 800px) { .su-tags, .su-when { display: none; } .su-body { padding-left: 18px; } }

/* ---------- dark theme ---------- */
[data-theme=dark] .seg { background: #0e1729; }
[data-theme=dark] .seg button { color: #8ea0c0; }
[data-theme=dark] .seg button.on { background: #1b2742; color: #fff; }
[data-theme=dark] .cl-menu { background: #111a2e; }
[data-theme=dark] .cl-health.ok, [data-theme=dark] .pill.dl-st.running, [data-theme=dark] .pill.dl-it.calling, [data-theme=dark] .pill.su-ok, [data-theme=dark] .cl-dialing { background: #0f2a1e !important; color: #4ade80 !important; }
[data-theme=dark] .cl-health.warn, [data-theme=dark] .pill.dl-st.paused, [data-theme=dark] .pill.dl-it.failed { background: #2b1f08; color: #fbbf24; }
[data-theme=dark] .cl-health.bad, [data-theme=dark] .pill.dl-it.skipped { background: #2e1418; color: #f87171; }
[data-theme=dark] .cl-health.off, [data-theme=dark] .pill.dl-it.pending, [data-theme=dark] .dl-agent { background: #1b2742; color: #c7d3ea; }
[data-theme=dark] .pill.dl-st.done, [data-theme=dark] .pill.dl-it.done, [data-theme=dark] .dl-preview { background: #16244a; color: #93b4ff; }
[data-theme=dark] .dl-bar, [data-theme=dark] .su-msg, [data-theme=dark] .dl-checks .check { background: #0e1729; border-color: var(--border); }
[data-theme=dark] .dl-checks .check:has(input:checked) { background: #16244a; border-color: #3b7bff; }
[data-theme=dark] .wp-alert.dialer { background: #0f2a1e; border-color: #14532d; color: #86efac; }
.cl-table th, .cl-table td { padding-left: 10px; padding-right: 10px; }
.cl-table td.actions .btn-sm { padding: 6px 9px; }
@media (max-width: 1300px) { .cl-table .cl-seats { min-width: 80px; } }
.cl-table .btn-sm svg { width: 15px; height: 15px; }

/* =================== Figma-style dashboard + compact stat tiles (all pages) =================== */
:root { --fg-bg: #f6f7fb; --fg-line: #eceff5; --fg-ink: #0f172a; --fg-soft: #64748b; --fg-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03); }
body { background: radial-gradient(900px 380px at 100% -8%, #e9efff 0%, transparent 60%), radial-gradient(700px 300px at 0% 110%, #f1ecff 0%, transparent 60%), var(--fg-bg); background-attachment: fixed; }
.card { border: 1px solid var(--fg-line); box-shadow: var(--fg-shadow); border-radius: 16px; }
.card:hover { box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 20px -10px rgba(16, 24, 40, .14); }
.card-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card-head a { font-size: 12.5px; font-weight: 600; }

/* stat tile: label on top, value, trend pill; small icon chip in the corner */
.card.stat { position: relative; display: block; padding: 14px 16px 13px; min-height: 0; }
.card.stat:hover { transform: translateY(-1px); }
.card.stat > .ic { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; box-shadow: none; }
.card.stat > .ic svg { width: 15px; height: 15px; }
.card.stat .label { font-size: 12px; font-weight: 600; color: var(--fg-soft); padding-right: 38px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.stat .val { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 6px 0 4px; }
.card.stat .sub, .card.stat .hint { font-size: 11.5px; color: var(--fg-soft); line-height: 1.45; }
.card.stat .sub .up, .card.stat .sub .down { display: inline-block; font-weight: 700; padding: 0 6px; border-radius: 6px; margin-right: 2px; }
.card.stat .sub .up { background: #e7f8ee; color: #15803d; }
.card.stat .sub .down { background: #fdecec; color: #dc2626; }
/* tiles never leave an orphan: 4 -> 2x2 -> 1 (g4), 3 -> 1 (g3), sized by the space they really have */
#view, .g-dash > .min0 { container-type: inline-size; }
.grid.g4:has(> .card.stat) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid.g3:has(> .card.stat) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 700px) { .grid.g4:has(> .card.stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 560px) { .grid.g3:has(> .card.stat) { grid-template-columns: 1fr; } }
@container (max-width: 340px) { .grid.g4:has(> .card.stat) { grid-template-columns: 1fr; } }
/* soft tinted icon chips instead of heavy gradients inside tiles */
.card.stat > .ic.bg-green { background: #e7f8ee; color: #16a34a; }
.card.stat > .ic.bg-blue { background: #e8efff; color: #1d5bf0; }
.card.stat > .ic.bg-red { background: #fdecef; color: #e11d48; }
.card.stat > .ic.bg-purple { background: #f1ebff; color: #7c3aed; }
.card.stat > .ic.bg-amber { background: #fff4dc; color: #d97706; }
.card.stat > .ic.bg-cyan { background: #e2f7fb; color: #0891b2; }
.card.stat > .ic.bg-pink { background: #fdebf4; color: #db2777; }
.card.stat::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; border-radius: 2px; opacity: 0; transition: opacity .2s; background: linear-gradient(90deg, #3b7bff, #8b5cf6); }
.card.stat:hover::after { opacity: 1; }

/* "agents right now" strip */
.mini-stats { gap: 8px; }
.mini-stat { padding: 8px 10px; border: 1px solid var(--fg-line); border-radius: 12px; gap: 10px; background: #fbfcfe; }
.mini-stat .ic { width: 28px; height: 28px; border-radius: 8px; }
.mini-stat .ic svg { width: 14px; }
.mini-stat .val { font-size: 18px; font-weight: 800; }
.mini-stat .label { font-size: 11.5px; margin-top: 1px; }

/* dashboard rhythm */
.g-dash { gap: 16px; }
.g-dash .grid.mb, .g-dash .card.mb { margin-bottom: 16px; }
.dash-range .range button, .range button { border-radius: 9px; font-size: 12.5px; padding: 7px 11px; }
.chips span { background: #f4f6fb; border: 1px solid var(--fg-line); border-radius: 9px; font-weight: 600; }
.qa { gap: 8px; }
.qa-btn { border-radius: 12px; padding: 10px; transition: border-color .15s, background .15s, transform .15s; }
.qa-btn:hover { transform: translateY(-1px); }
.qa-btn .ic { width: 28px; height: 28px; border-radius: 8px; }
.donut-wrap svg { flex: none; }
.notice { border-radius: 14px; }

/* dark */
[data-theme=dark] { --fg-line: #1f2b45; --fg-soft: #8ea0c0; }
[data-theme=dark] body { background: radial-gradient(900px 380px at 100% -8%, #14224a 0%, transparent 60%), var(--bg); }
[data-theme=dark] .card.stat > .ic { background: #16244a !important; color: #93b4ff !important; }
[data-theme=dark] .card.stat .sub .up { background: #0f2a1e; color: #4ade80; }
[data-theme=dark] .card.stat .sub .down { background: #2e1418; color: #f87171; }
[data-theme=dark] .mini-stat { background: #0e1729; }
[data-theme=dark] .chips span { border-color: var(--border); }

/* ---------- phones / small tablets ---------- */
@media (max-width: 860px) {
  .menu-btn { display: inline-flex !important; } /* an older rule hid the menu button at every size */
  .topbar { gap: 8px; padding: 8px 12px; }
  .topbar .scope select { max-width: 120px; }
  #statusText { display: none; }
  .status-select { padding: 7px 9px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .toolbar { flex-wrap: wrap; }
  .page-head h1 { font-size: 21px; }
  .cl-bar .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .dash-range .range { flex-wrap: wrap; }
  .card { border-radius: 14px; }
  .modal { max-width: calc(100vw - 24px) !important; }
}
@media (max-width: 420px) {
  .topbar .theme-btn { display: none; }
  .content { padding-left: 12px; padding-right: 12px; }
  .card.stat { padding: 12px 12px 11px; }
  .card.stat .val { font-size: 20px; }
}

/* ---------- auto dialer v2: tabs, completed cards, lists, form ---------- */
.dl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.dl-tabs button { border: 0; background: none; padding: 10px 14px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.dl-tabs button span { background: #eef2f8; color: #475569; border-radius: 6px; font-size: 11.5px; padding: 1px 7px; }
.dl-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.dl-tabs button.on span { background: var(--primary-50); color: var(--primary); }
.dl-done-head { display: flex; align-items: center; gap: 12px; }
.dl-done-head > div:nth-child(2) { flex: 1; min-width: 0; }
.dl-done-head h3 { font-size: 16px; }
.dl-badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #34d399, #16a34a); color: #fff; font-weight: 800; flex: none; }
.dl-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--panel, #fff) 76%, transparent 78% 100%), conic-gradient(#16a34a calc(var(--p) * 1%), #e8edf5 0); }
.dl-ring b { font-size: 14px; line-height: 1; } .dl-ring small { font-size: 9.5px; color: var(--muted); }
.dl-split { display: flex; height: 8px; border-radius: 8px; overflow: hidden; margin: 14px 0 12px; background: #eef2f8; gap: 2px; }
.dl-split i { display: block; } .dl-split .ok { background: #16a34a; } .dl-split .warn { background: #f59e0b; } .dl-split .bad { background: #ef4444; }
.dl-results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dl-results span { font-size: 12px; padding: 4px 9px; border-radius: 6px; background: #f4f6fb; border: 1px solid var(--border); }
.dl-filt { margin-top: 10px; }
.dl-camp.done::before { background: linear-gradient(180deg, #34d399, #16a34a) !important; }
.dl-resbars { display: flex; flex-direction: column; gap: 10px; }
.dl-resbars > div { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.dl-ltable td { vertical-align: top; }
.dl-mini { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dl-mini span { font-size: 11px; color: var(--muted); background: #f4f6fb; border-radius: 4px; padding: 1px 6px; }
.dl-step { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; margin-top: 6px; }
.dl-step span { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 12.5px; }
.dl-mode { margin-bottom: 4px; }
.dl-fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.dl-flabel { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.dl-flabel small { font-weight: 500; }
.dl-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }
.dl-inline select { width: auto; }
.dl-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1.5px dashed #b9c6dc; border-radius: 12px; background: #f8faff; }
.dl-drop input[type=file] { flex: 0 0 auto; max-width: 230px; }
.dl-drop > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
@media (max-width: 760px) { .dl-fgrid { grid-template-columns: 1fr; } .dl-drop { flex-direction: column; align-items: flex-start; } }
[data-theme=dark] .dl-tabs button span, [data-theme=dark] .dl-results span, [data-theme=dark] .dl-mini span { background: #0e1729; color: #c7d3ea; }
[data-theme=dark] .dl-drop { background: #0e1729; border-color: #26344f; }
[data-theme=dark] .dl-split { background: #1b2742; }
[data-theme=dark] .dl-ring { background: radial-gradient(closest-side, var(--panel) 76%, transparent 78% 100%), conic-gradient(#16a34a calc(var(--p) * 1%), #1b2742 0); }

/* ---------- CSV format example on import screens ---------- */
.csv-fmt { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #f8faff; margin-top: 12px; }
.csv-fmt-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; font-size: 13px; }
.csv-fmt table { font-size: 12px; background: #fff; }
.csv-fmt th, .csv-fmt td { padding: 6px 9px !important; white-space: nowrap; }
.csv-fmt th { text-transform: none !important; letter-spacing: 0 !important; font-family: var(--gc-mono, monospace); font-size: 11.5px !important; }
.csv-fmt th.req { color: var(--primary) !important; }
.csv-fmt-foot { margin-top: 8px; font-size: 12px; }
.csv-fmt code { background: #eef2f8; border-radius: 4px; padding: 0 4px; font-size: 11.5px; }
[data-theme=dark] .csv-fmt { background: #0e1729; }
[data-theme=dark] .csv-fmt table { background: var(--panel); }
[data-theme=dark] .csv-fmt code { background: #1b2742; }

/* ---------- dashboard: sales boxes reflow instead of squeezing; solid top bar ---------- */
.card:has(> .sales-row) { container-type: inline-size; }
.sales-row.sales-row-5 { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@container (max-width: 520px) { .sales-row.sales-row-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 320px) { .sales-row.sales-row-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sales-row-5 .sale-box { min-width: 0; padding: 10px 12px; }
.sales-row-5 .sale-box b { font-size: 20px; }
.sales-row-5 .sale-box span { font-size: 11.5px; line-height: 1.3; }
.topbar { background: #fff !important; }
[data-theme=dark] .topbar { background: var(--panel) !important; }

/* repeat 3-way warning */
.xfer-warn table { font-size: 12.5px; }
.xfer-warn.sale p:first-child { color: #9a3412; }
.pill.sale { background: #e6f8ee !important; color: #15803d !important; }

.xfer-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; padding: 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; }
.xfer-warn:not(.sale) .xfer-box { background: #f8faff; border-color: var(--border); }
.xfer-box div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.xfer-box span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.xfer-box b { font-size: 14px; }
.xfer-box small { font-size: 12px; color: var(--muted); }
[data-theme=dark] .xfer-box { background: #2a1c0c; border-color: #5c3a14; }
[data-theme=dark] .xfer-warn:not(.sale) .xfer-box { background: #0e1729; border-color: var(--border); }

/* ---------- packages ---------- */
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.pk-plan { display: flex; flex-direction: column; gap: 10px; }
.pk-plan.off { opacity: .65; }
.pk-plan-top { display: flex; justify-content: space-between; gap: 10px; }
.pk-plan h3 { font-size: 16px; }
.pk-price { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.pk-price small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.pk-feat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pk-used { border-top: 1px solid var(--border); padding-top: 8px; }
.pk-card .pk-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pk-card .pk-head b { font-size: 16px; }
.pk-bar { height: 10px; border-radius: 10px; background: #eef2f8; overflow: hidden; margin: 14px 0 8px; }
.pk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #16a34a); border-radius: inherit; }
.pk-card.warn .pk-bar i { background: linear-gradient(90deg, #fbbf24, #ef4444); }
.pk-nums { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pk-nums b { color: var(--text); }
.pk-unl { margin-top: 12px; font-weight: 600; color: #15803d; }
/* ---------- client 360 ---------- */
.cp360 { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: center; }
.cp-health { display: flex; gap: 12px; align-items: center; padding-right: 18px; border-right: 1px solid var(--border); }
.cp-health b { display: block; font-size: 16px; }
.cp-health small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.cp-ring { --p: 0; width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(closest-side, var(--panel, #fff) 76%, transparent 78% 100%), conic-gradient(var(--hc) calc(var(--p) * 1%), #e8edf5 0); }
.cp-ring b { font-size: 18px !important; }
.cp-health.ok { --hc: #16a34a; } .cp-health.warn { --hc: #f59e0b; } .cp-health.bad { --hc: #ef4444; }
.cp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.cp-k { display: flex; flex-direction: column; min-width: 0; }
.cp-k span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cp-k b { font-size: 19px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cp-k small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-k.neg small, .cp-k.neg b { color: #dc2626; }
.cp-sub { margin-top: 16px; }
@media (max-width: 1100px) { .cp360 { grid-template-columns: 1fr; } .cp-health { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 14px; } .cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
[data-theme=dark] .pk-bar { background: #1b2742; }
[data-theme=dark] .cp-ring { background: radial-gradient(closest-side, var(--panel) 76%, transparent 78% 100%), conic-gradient(var(--hc) calc(var(--p) * 1%), #1b2742 0); }

/* ---------- tickets ---------- */
.tk-table tbody tr { cursor: pointer; }
.tk-table tr.tk-new td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.pill.tk-st.open { background: #fdecec; color: #dc2626; } .pill.tk-st.pending { background: #fff5e0; color: #b45309; }
.pill.tk-st.resolved, .pill.tk-st.closed { background: #e6f8ee; color: #15803d; }
.pill.tk-pr.urgent { background: #dc2626; color: #fff; } .pill.tk-pr.high { background: #fdecec; color: #dc2626; } .pill.tk-pr.low { background: #f1f5f9; color: #64748b; }
.tk-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tk-layout.staff { grid-template-columns: minmax(0, 1fr) 280px; }
.tk-thread { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 260px); overflow-y: auto; }
.tk-msg { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; max-width: 86%; }
.tk-msg.cust { align-self: flex-start; background: #fff; }
.tk-msg.staff { align-self: flex-end; background: var(--primary-50); border-color: #c9d8fb; }
.tk-msg.internal { align-self: flex-end; background: #fffbeb; border-color: #fde68a; border-style: dashed; }
.tk-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.tk-meta .hint { margin-left: auto; font-size: 11.5px; }
.tk-body { font-size: 14px; line-height: 1.55; white-space: normal; word-wrap: break-word; }
.tk-reply { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: 0; background: var(--panel, #fff); }
.tk-reply textarea { width: 100%; }
.tk-reply .toolbar { justify-content: flex-end; flex-wrap: wrap; }
.tk-side { display: flex; flex-direction: column; gap: 10px; align-self: start; }
.tk-side label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tk-help .card b { display: block; margin-bottom: 4px; }
@media (max-width: 960px) { .tk-layout.staff { grid-template-columns: 1fr; } .tk-msg { max-width: 100%; } }
[data-theme=dark] .tk-msg.cust { background: var(--panel); } [data-theme=dark] .tk-msg.staff { background: #16244a; border-color: #26344f; }
[data-theme=dark] .tk-msg.internal { background: #2a2010; border-color: #5c4516; }

/* ---------- inbox ---------- */
.ib { display: grid; grid-template-columns: 330px 1fr; padding: 0 !important; height: calc(100vh - 210px); min-height: 520px; overflow: hidden; }
.ib-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.ib-filters { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.ib-tog { display: flex; gap: 14px; font-size: 13px; }
.ib-rows { overflow-y: auto; flex: 1; }
.ib-row { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid #f1f4f8; cursor: pointer; align-items: center; }
.ib-row:hover { background: #f8faff; } .ib-row.on { background: var(--primary-50); }
.ib-row.unread b { font-weight: 800; }
.ib-av { position: relative; width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; background: var(--c); }
.ib-av.lg { width: 44px; height: 44px; }
.ib-ch { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid #fff; color: #fff; font-size: 10px; display: grid; place-items: center; }
.ib-acc .ib-ch, .ib-head .ib-ch { position: absolute; }
.ib-main { flex: 1; min-width: 0; }
.ib-top { display: flex; justify-content: space-between; gap: 8px; }
.ib-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-snip { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-thread { display: flex; flex-direction: column; min-height: 0; }
.ib-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ib-hmain { flex: 1; min-width: 160px; }
.ib-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ib-actions select { width: auto; padding: 6px 8px; }
.ib-note { margin: 8px 16px 0; padding: 8px 12px; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: 13px; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.ib-msg { display: flex; flex-direction: column; max-width: 72%; }
.ib-msg.in { align-self: flex-start; } .ib-msg.out { align-self: flex-end; align-items: flex-end; }
.ib-msg small { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.ib-bubble { padding: 9px 13px; border-radius: 16px; background: #fff; border: 1px solid var(--border); white-space: normal; word-wrap: break-word; line-height: 1.45; }
.ib-msg.out .ib-bubble { background: var(--primary); color: #fff; border-color: transparent; }
.ib-msg.out .ib-bubble a { color: #fff; }
.ib-time { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.ib-sys { align-self: center; font-size: 12px; color: var(--muted); background: #eef2f8; border-radius: 999px; padding: 3px 12px; }
.ib-reply { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ib-reply textarea { flex: 1; resize: vertical; min-height: 44px; }
.ib-code { display: flex; gap: 8px; align-items: center; background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 10px; }
.ib-code code { flex: 1; font-size: 12px; word-break: break-all; background: none !important; color: inherit !important; }
.ib-acc { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 34px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.ib-acc .ib-ch { left: 8px; top: 50%; transform: translateY(-50%); right: auto; bottom: auto; }
.ib-acc .btn { margin-left: auto; }
.ib-test { height: 300px; border: 1px solid var(--border); border-radius: 12px; }
.empty-state.small { padding: 24px 12px; }
@media (max-width: 860px) { .ib { grid-template-columns: 1fr; height: auto; } .ib-list { max-height: 320px; border-right: 0; border-bottom: 1px solid var(--border); } .ib-thread { min-height: 480px; } }
/* ---------- email ---------- */
.em-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.em-form { display: flex; flex-direction: column; gap: 10px; }
.em-form label { display: flex; flex-direction: column; gap: 4px; }
.em-html { font-family: var(--gc-mono, monospace); font-size: 12.5px; }
.em-prev { position: sticky; top: 70px; }
.em-prev iframe { width: 100%; height: 620px; border: 1px solid var(--border); border-radius: 10px; background: #f5f7fb; }
.em-subj { margin: 6px 0 10px; font-size: 14px; }
.em-tpl { flex-wrap: wrap; align-items: center; }
.pill.em-st.sent { background: #e6f8ee; color: #15803d; } .pill.em-st.sending, .pill.em-st.scheduled { background: #eaf1ff; color: #1d5bf0; } .pill.em-st.cancelled { background: #fdecec; color: #dc2626; }
@media (max-width: 1100px) { .em-grid { grid-template-columns: 1fr; } .em-prev { position: static; } }
/* ---------- add-ons ---------- */
.ao-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ao-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.ao-card.on { border-color: #86efac; background: #f0fdf4; }
.ao-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ao-top { display: flex; gap: 10px; align-items: center; }
.ao-top small { display: block; color: var(--muted); font-size: 12px; }
.ao-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-50); display: grid; place-items: center; font-size: 17px; flex: none; }
.ao-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.ao-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.ao-row.on { border-color: #86efac; background: #f0fdf4; }
.ao-main { flex: 1; min-width: 0; } .ao-main small { display: block; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 22px; background: #cbd5e1; transition: background .15s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: #16a34a; } .switch input:checked + i::after { transform: translateX(18px); }
[data-theme=dark] .ib-msgs { background: #0e1729; } [data-theme=dark] .ib-bubble { background: var(--panel); } [data-theme=dark] .ib-row:hover { background: #142039; }
[data-theme=dark] .ao-card.on, [data-theme=dark] .ao-row.on { background: #0f2a1e; border-color: #14532d; } [data-theme=dark] .ib-sys { background: #1b2742; }
