/* =================== Glee Call design system — loaded last, defines the product look ===================
   Enterprise UI on the Glee blue brand: blue gradient navigation and primary actions, hairline borders,
   8–10px corners, IBM Plex type with tabular numbers. */
:root {
  --gc-font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gc-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --primary: #1d5bf0; --primary-600: #164fd6; --primary-50: #eaf1ff;
  --bg: #f4f5f7; --panel: #ffffff; --border: #e3e6eb; --text: #111827; --muted: #5f6b7a;
  --line-strong: #cfd5dd; --surface-2: #f8f9fb;
  --green: #12805c; --red: #c8323a; --amber: #b7791f;
  --radius: 10px; --r-ctl: 8px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow-hover: 0 1px 2px rgba(17, 24, 39, .06), 0 4px 12px -4px rgba(17, 24, 39, .10);
  --nav-bg: linear-gradient(180deg, #0b1b46 0%, #0f2560 60%, #11307a 100%); --nav-line: rgba(255, 255, 255, .10); --nav-text: #c9d6f2; --nav-strong: #ffffff;
}
body, button, input, select, textarea { font-family: var(--gc-font); }
body { background: var(--bg) !important; color: var(--text); font-size: 14px; letter-spacing: 0; -webkit-font-smoothing: antialiased; }
.val, .stat .val, .mini-stat .val, .dl-nums b, .client-stats b, .kv b, td, .wp-timer, .bal-chip { font-variant-numeric: tabular-nums; }
h1, h2, h3 { letter-spacing: -.01em; }
a { color: var(--primary); }
#view > * { animation: gc-fade .18s ease both; }
@keyframes gc-fade { from { opacity: 0; } }

/* ---------- navigation ---------- */
.sidebar { background: var(--nav-bg) !important; border-right: 1px solid var(--nav-line) !important; backdrop-filter: none; color: var(--nav-text); padding: 14px 10px; }
.sidebar .brand { padding: 4px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--nav-line); }
.sidebar .brand img { width: 30px; height: 30px; background: #fff; border-radius: 7px; padding: 3px; }
.sidebar .brand-name { color: var(--nav-strong) !important; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.sidebar .brand-tag { color: #8fb1ff !important; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.nav a, .nav-toggle { color: var(--nav-text) !important; border-radius: 6px !important; padding: 7px 10px; font-size: 13.5px; font-weight: 500; box-shadow: none !important; }
.nav a svg, .nav-toggle svg { width: 16px; height: 16px; opacity: .85; }
.nav a:hover, .nav-toggle:hover { background: rgba(255, 255, 255, .05) !important; color: var(--nav-strong) !important; transform: none !important; }
.nav a.active { background: rgba(255, 255, 255, .14) !important; color: #fff !important; font-weight: 600; box-shadow: inset 3px 0 0 #6ea8ff !important; }
.nav-group.has-active > .nav-toggle { color: var(--nav-strong) !important; }
.nav a.sub { color: #a9bbe0 !important; padding: 6px 10px 6px 30px; font-size: 13px; }
.nav a.sub .sub-dot { display: none; }
.nav a.sub.active { color: #fff !important; }
.nav .badge, .badge { background: #3b7bff; border-radius: 5px; font-size: 10.5px; height: 18px; min-width: 18px; }
.plan { background: rgba(255, 255, 255, .06) !important; border: 1px solid var(--nav-line) !important; border-radius: 8px; color: var(--nav-text) !important; }
.plan b { color: var(--nav-strong) !important; }
.plan .progress { background: rgba(255, 255, 255, .15) !important; }
.plan .progress i { background: linear-gradient(90deg, #6ea8ff, #3b7bff) !important; }
.plan-link, .sidebar a.plan-link { color: #8fa9ff !important; }
.sidebar .hint { color: #9fb2d8 !important; }
.sidebar::-webkit-scrollbar { width: 6px; } .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar { background: #fff !important; backdrop-filter: none !important; border-bottom: 1px solid var(--border); min-height: 54px; }
.search input, .topbar .search { border-radius: var(--r-ctl); }
.scope select { background: var(--surface-2) !important; border: 1px solid var(--border) !important; color: var(--text) !important; border-radius: var(--r-ctl); font-weight: 600; }
.status-select, .theme-btn { border-radius: var(--r-ctl) !important; }
.footer { background: transparent !important; border-top: 1px solid var(--border); }

/* ---------- page + cards ---------- */
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.page-head p { color: var(--muted); font-size: 13.5px; }
.card { border-radius: var(--radius) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; background: var(--panel); }
.card:hover, .card.stat:hover { transform: none !important; box-shadow: var(--shadow) !important; }
.card-head h3 { font-size: 14px; font-weight: 600; }
.section-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.notice { background: #fffaf0 !important; border-color: #f1d9a6 !important; color: #7a4d0b; }

/* ---------- controls ---------- */
.btn { border-radius: var(--r-ctl) !important; background: #fff; border: 1px solid var(--line-strong); color: var(--text); font-weight: 600; font-size: 13px; box-shadow: 0 1px 1px rgba(17, 24, 39, .04) !important; transform: none !important; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: linear-gradient(135deg, #3b7bff, #1d5bf0) !important; border-color: transparent !important; color: #fff !important; box-shadow: 0 4px 12px -5px rgba(29, 91, 240, .65) !important; }
.btn-primary:hover { background: linear-gradient(135deg, #2f6ff5, #164fd6) !important; }
.btn-green { background: linear-gradient(135deg, #34d399, #16a34a) !important; border-color: transparent !important; color: #fff !important; box-shadow: 0 4px 12px -5px rgba(22, 163, 74, .55) !important; }
.btn-red { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
input, select, textarea { border-radius: var(--r-ctl) !important; border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(34, 81, 209, .14) !important; outline: none; }
.pill { border-radius: 5px !important; font-size: 11.5px; font-weight: 600; padding: 2px 8px; }
.status-tabs button, .seg button, .range button { border-radius: 6px !important; }
.seg { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); }
.seg button.on { box-shadow: 0 1px 2px rgba(17, 24, 39, .08); }
.status-tabs button.on, .range button.on { background: linear-gradient(135deg, #3b7bff, #1d5bf0) !important; color: #fff !important; }
.status-tabs button.on span { background: rgba(255, 255, 255, .2) !important; }
.chips span { border-radius: 6px !important; background: var(--surface-2) !important; }
.modal { border-radius: 12px !important; }
.modal-bg { backdrop-filter: none !important; background: rgba(17, 24, 39, .45); }
.progress i, .dl-bar i { background: linear-gradient(90deg, #3b7bff, #1d5bf0) !important; }
.empty-state svg { color: #9aa3b2; }

/* ---------- tables ---------- */
th { background: var(--surface-2) !important; color: #4b5563 !important; font-size: 11px !important; font-weight: 600 !important; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--border) !important; }
td { border-bottom: 1px solid #eef0f3 !important; }
tbody tr:hover td { background: #fafbfc !important; }

/* ---------- stat tiles: neutral, numbers first ---------- */
.card.stat { padding: 14px 16px 13px; }
.card.stat > .ic { border: 0; width: 28px; height: 28px; border-radius: 7px; box-shadow: none !important; }
.card.stat .label { font-size: 12px; font-weight: 500; color: var(--muted); }
.card.stat .val { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.card.stat .sub .up { background: #e8f5ef !important; color: var(--green) !important; border-radius: 4px; }
.card.stat .sub .down { background: #fbecec !important; color: var(--red) !important; border-radius: 4px; }
.card.stat::after { display: none; }
.mini-stat { background: #fff !important; border-radius: 8px; }
.mini-stat .ic[class*="bg-"], .qa-btn .ic[class*="bg-"], .stat .ic[class*="bg-"] { box-shadow: none !important; }
.mini-stat .val { font-weight: 600; }
.qa-btn { border-radius: 8px !important; background: #fff; }
.qa-btn:hover { transform: none !important; background: var(--surface-2) !important; }
/* icon tiles keep the brand gradients */
.bg-green { background: linear-gradient(135deg, #34d399, #16a34a) !important; } .bg-blue { background: linear-gradient(135deg, #60a5fa, #1d5bf0) !important; }
.bg-red { background: linear-gradient(135deg, #fb7185, #e11d48) !important; } .bg-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed) !important; }
.bg-amber { background: linear-gradient(135deg, #fcd34d, #f59e0b) !important; } .bg-cyan { background: linear-gradient(135deg, #67e8f9, #0891b2) !important; }
.bg-pink { background: linear-gradient(135deg, #f9a8d4, #db2777) !important; }
.card.stat > .ic.bg-green { background: #e7f8ee !important; color: #16a34a !important; } .card.stat > .ic.bg-blue { background: #e8efff !important; color: #1d5bf0 !important; }
.card.stat > .ic.bg-red { background: #fdecef !important; color: #e11d48 !important; } .card.stat > .ic.bg-purple { background: #f1ebff !important; color: #7c3aed !important; }
.card.stat > .ic.bg-amber { background: #fff4dc !important; color: #d97706 !important; } .card.stat > .ic.bg-cyan { background: #e2f7fb !important; color: #0891b2 !important; }
.card.stat > .ic.bg-pink { background: #fdebf4 !important; color: #db2777 !important; }
.mini-stat .val { font-weight: 600; }
.qa-btn { border-radius: 8px !important; background: #fff; }
.qa-btn:hover { transform: none !important; background: var(--surface-2) !important; }
/* gradient tiles elsewhere become flat */
.bg-green { background: #12805c !important; } .bg-blue { background: #2251d1 !important; } .bg-red { background: #c8323a !important; }
.bg-purple { background: #6941c6 !important; } .bg-amber { background: #b7791f !important; } .bg-cyan { background: #0e7490 !important; } .bg-pink { background: #b42370 !important; }
[class*="bg-"] { box-shadow: none !important; }

/* ---------- status colours: quieter ---------- */
.cl-health.ok { background: #e8f5ef; color: var(--green); }
.cl-health.warn { background: #fdf3e1; color: #92590c; }
.cl-health.bad { background: #fbecec; color: var(--red); }
.cl-health, .dl-agent { border-radius: 5px; }
.dl-camp.running::before { background: var(--green); } .dl-camp.paused::before { background: #d39a2c; } .dl-camp.done::before { background: var(--primary); }

/* ---------- webphone: brand blue ---------- */
.phone { border-radius: 16px !important; }
/* ---------- dark ---------- */
[data-theme=dark] {
  --bg: #0b0d11; --panel: #12151b; --border: #232833; --text: #e6e8ec; --muted: #8b93a1; --surface-2: #171b22; --line-strong: #2c323d;
  --primary: #3b7bff; --primary-600: #2f6ff5; --primary-50: #16244a; --nav-bg: linear-gradient(180deg, #070d1c 0%, #0b1530 100%); --nav-line: #1f2b45;
}
[data-theme=dark] body { background: var(--bg) !important; }
[data-theme=dark] .topbar { background: var(--panel) !important; }
[data-theme=dark] .btn { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
[data-theme=dark] th { background: #151920 !important; color: #9aa2b1 !important; }
[data-theme=dark] td { border-color: #1d222b !important; }
[data-theme=dark] tbody tr:hover td { background: #161a21 !important; }
[data-theme=dark] .mini-stat, [data-theme=dark] .qa-btn { background: var(--surface-2) !important; }
[data-theme=dark] .card.stat > .ic { background: #16244a !important; color: #93b4ff !important; }
[data-theme=dark] .phone { background: var(--panel) !important; }
[data-theme=dark] .notice { background: #241c0c !important; border-color: #4a3a14 !important; color: #f2cf8a; }

/* ---- admin command center */
.ah { padding: 18px; }
.ah-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.ah-goal { min-width: 220px; flex: 0 1 300px; }
.ah-goal-t { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted, #64748b); margin-bottom: 6px; }
.ah-goal-t b { color: var(--text, #0f172a); }
.ah-bar { height: 8px; border-radius: 6px; background: var(--primary-50); overflow: hidden; }
.ah-bar i { display: block; height: 100%; min-width: 2px; border-radius: 6px; background: linear-gradient(90deg, var(--primary), #4f8cff); }
.ah-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.ah-k { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.ah-k span { display: block; font-size: 11.5px; color: var(--muted, #64748b); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ah-k b { display: block; font-size: 20px; margin: 2px 0; }
.ah-k small { display: block; font-size: 11.5px; color: var(--muted, #64748b); overflow: hidden; text-overflow: ellipsis; }
.ah-k.neg b { color: #d23c3c; } .ah-k.warn b { color: #c27a0e; }
.ah-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.ah-sub { font-size: 12px; font-weight: 700; color: var(--muted, #64748b); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.ah-list { display: grid; gap: 6px; }
.ah-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); color: inherit; text-decoration: none; border-left: 4px solid #94a3b8; }
.ah-item:hover { background: var(--primary-50); }
.ah-item > b { font-size: 18px; min-width: 28px; text-align: center; }
.ah-item > span { flex: 1; min-width: 0; font-size: 13.5px; }
.ah-item small { display: block; color: var(--muted, #64748b); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-go { font-style: normal; font-size: 20px; color: var(--muted, #94a3b8); }
.ah-item.t-blue { border-left-color: var(--primary); } .ah-item.t-green { border-left-color: #1f9d5c; } .ah-item.t-purple { border-left-color: #7c4dff; }
.ah-item.t-red { border-left-color: #d23c3c; } .ah-item.t-amber { border-left-color: #e0a019; }
.ah-clear { padding: 14px; border-radius: 10px; background: rgba(31, 157, 92, .08); color: #1f7a4a; font-weight: 600; }
.ah-top { display: grid; gap: 4px; }
.ah-top a { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 8px 10px; border-radius: 9px; color: inherit; text-decoration: none; }
.ah-top a:hover { background: var(--primary-50); }
.ah-top span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-top small { grid-column: 2; text-align: right; font-size: 11.5px; }
@container (max-width: 1100px) { .ah-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ah-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ah-cols { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ah-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- phone number prices & orders */
.did-prices .did-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.did-p { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.did-p > div b { font-size: 19px; }
.did-quote .kv { margin-bottom: 6px; }
.cp-did { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--primary-50); font-size: 13.5px; }

/* ---- Travel CRM */
.tr-pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #eef2f7; color: #475569; white-space: nowrap; }
.tr-pill.q-new, .tr-pill.s-draft { background: var(--primary-50); color: var(--primary); }
.tr-pill.q-contacted { background: #fef3c7; color: #a16207; }
.tr-pill.q-quoted, .tr-pill.s-sent, .tr-pill.b-in_progress { background: #ede9fe; color: #6d28d9; }
.tr-pill.q-follow_up { background: #ffedd5; color: #c2410c; }
.tr-pill.q-won, .tr-pill.s-accepted, .tr-pill.b-issued, .tr-pill.b-completed, .tr-pill.p-received { background: #dcfce7; color: #15803d; }
.tr-pill.q-lost, .tr-pill.s-rejected, .tr-pill.b-cancelled, .tr-pill.b-refunded, .tr-pill.p-refund { background: #fee2e2; color: #b91c1c; }
.tr-pill.b-confirmed { background: #e0f2fe; color: #0369a1; }
.tr-pill.p-paid { background: #fef3c7; color: #a16207; }
.tr-k.neg .val { color: var(--red); } .tr-k.warn .val { color: var(--amber); }
.tr-list { display: grid; gap: 2px; padding: 0 10px 12px; }
.tr-list a, .tr-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 10px; border-radius: 9px; color: inherit; text-decoration: none; }
.tr-list a:hover, .tr-row:hover { background: var(--primary-50); }
.tr-list a span, .tr-row span { grid-column: 1; font-size: 12.5px; color: var(--muted); }
.tr-list a small, .tr-row small { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-size: 12px; color: var(--muted); }
.tr-list a.late small { color: var(--red); font-weight: 600; }
.tr-row { margin: 0 8px; } .card > .tr-row:last-child { margin-bottom: 10px; }
.tr-bar { height: 6px; border-radius: 4px; background: var(--primary-50); overflow: hidden; margin-top: 4px; min-width: 80px; }
.tr-bar i { display: block; height: 100%; background: var(--green); }
.tr-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tr-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.tr-facts > div { min-width: 0; display: grid; gap: 2px; }
.tr-facts span { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tr-facts small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.tr-req { margin: 0 16px 16px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); white-space: pre-wrap; font-size: 13.5px; }
.card.tr-req { margin: 0 0 16px; }
.tr-note { display: grid; grid-template-columns: 150px 1fr; gap: 8px; padding: 0 16px 12px; align-items: start; }
.tr-note textarea { grid-column: 2; grid-row: 1 / span 2; }
.tr-note label { grid-column: 1; font-size: 12px; }
.tr-note button { grid-column: 1 / -1; justify-self: end; }
.tr-tl { padding: 0 16px 14px; display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.tr-tl-i { border-left: 3px solid var(--border); padding: 4px 0 4px 10px; font-size: 13px; }
.tr-tl-i.k-call { border-color: var(--green); } .tr-tl-i.k-whatsapp { border-color: #25d366; } .tr-tl-i.k-handover { border-color: #7c4dff; } .tr-tl-i.k-status { border-color: var(--primary); } .tr-tl-i.k-follow_up { border-color: var(--amber); }
.tr-tl-b { white-space: pre-wrap; margin-top: 2px; }
.tr-quote { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); }
.tr-quote-r { text-align: right; display: grid; gap: 4px; justify-items: end; }
.tr-quote-r small { font-size: 12px; }
.tr-pay { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); }
.tr-pay.k-received > b { color: var(--green); } .tr-pay.k-refund > b, .tr-pay.k-paid > b { color: var(--red); }
.tr-items input { width: 100%; }
.tr-qtot { text-align: right; margin: 10px 0; font-size: 14px; }
tr.click { cursor: pointer; } tr.muted td { opacity: .6; }
@media (max-width: 1000px) { .tr-cols { grid-template-columns: 1fr; } .tr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tr-facts { grid-template-columns: 1fr; } .tr-note { grid-template-columns: 1fr; } .tr-note textarea, .tr-note label { grid-column: 1; grid-row: auto; } }
.tr-check { padding: 0 16px 14px; display: grid; gap: 6px; }
.tr-check .check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.tr-check .done { text-decoration: line-through; color: var(--muted); }
.tr-check .row-input { display: flex; gap: 6px; margin-top: 4px; }
.tr-pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tr-pk { padding: 16px; display: grid; gap: 6px; align-content: start; }
.tr-pk.off { opacity: .6; }
.tr-pk-h { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.tr-pk > b { font-size: 16px; }
.tr-pk-p { font-size: 20px; font-weight: 700; color: var(--primary); }
.tr-pk-p small { font-size: 12px; color: var(--muted); font-weight: 500; }
.tr-pk ul { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.tr-lead { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.tr-lead-h { display: flex; justify-content: space-between; align-items: center; }
.tr-lead a { color: inherit; text-decoration: none; font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tr-lead a:hover { color: var(--primary); }
