/* TMG Connect design system. Tokens -> base -> layout -> components -> utilities. */
:root {
  --brand: #2563eb; --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white); --brand-strong: color-mix(in srgb, var(--brand) 85%, black);
  --bg: #f6f7f9; --surface: #fff; --surface-2: #f9fafb; --line: #e5e7eb; --line-strong: #d1d5db;
  --ink: #0f172a; --ink-2: #475569; --ink-3: #94a3b8;
  --ok: #16a34a; --ok-soft: #dcfce7; --warn: #d97706; --warn-soft: #fef3c7; --bad: #dc2626; --bad-soft: #fee2e2; --info: #0284c7; --info-soft: #e0f2fe; --violet: #7c3aed; --violet-soft: #ede9fe;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --shadow-sm: 0 1px 2px rgb(15 23 42 / .06); --shadow: 0 4px 16px rgb(15 23 42 / .08); --shadow-lg: 0 20px 50px rgb(15 23 42 / .18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --side: 236px; --top: 56px;
}
[data-theme="dark"] {
  --bg: #0b1120; --surface: #111a2e; --surface-2: #162036; --line: #22304a; --line-strong: #2f4060; --ink: #e8edf5; --ink-2: #a3b1c6; --ink-3: #64748b;
  --brand-soft: color-mix(in srgb, var(--brand) 22%, #111a2e); --ok-soft: #12351f; --warn-soft: #3d2c0b; --bad-soft: #401717; --info-soft: #0c2f44; --violet-soft: #2a1f4d;
  --shadow: 0 4px 16px rgb(0 0 0 / .4); --shadow-lg: 0 20px 50px rgb(0 0 0 / .6);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; } h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14.5px; } h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
p { margin: 0; } a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--bg); }

/* ---------- layout */
.shell { display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: var(--top) 1fr; height: 100vh; }
.side { grid-row: 1 / 3; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-brand { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); display: grid; place-items: center; color: #fff; flex: none; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group { margin-top: 14px; } .nav-group > h4 { padding: 0 10px 6px; font-size: 10.5px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; cursor: pointer; text-decoration: none !important; position: relative; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; } [data-theme="dark"] .nav-item.active { color: #fff; }
.nav-item svg { width: 17px; height: 17px; flex: none; } .nav-item .count { margin-left: auto; }
.side-foot { border-top: 1px solid var(--line); padding: 10px; }
.top { display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .search { flex: 1; max-width: 460px; position: relative; } .top .search input { padding-left: 34px; background: var(--surface-2); } .top .search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--ink-3); }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 60; max-height: 380px; overflow: auto; padding: 6px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; } .search-results a:hover, .search-results a.sel { background: var(--surface-2); }
.main { overflow-y: auto; min-width: 0; } .page { padding: 22px 26px 60px; max-width: 1480px; margin: 0 auto; } .page.flush { padding: 0; max-width: none; height: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; } .page-head .sub { color: var(--ink-2); margin-top: 2px; } .page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 80; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); } .side.open { transform: none; } .menu-btn { display: inline-flex; } .page { padding: 16px 14px 60px; } .hide-sm { display: none !important; } }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; color: var(--ink); }
.btn:hover { background: var(--surface-2); } .btn svg { width: 15px; height: 15px; } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); } .btn.primary:hover { background: var(--brand-strong); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); } .btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; } .btn.lg { height: 42px; padding: 0 18px; font-size: 15px; } .btn.icon { width: 34px; padding: 0; } .btn.icon.sm { width: 28px; } .btn.block { width: 100%; }
.btn.ai { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: 0; } .btn.ai:hover { filter: brightness(1.08); }
.input, input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=password], input[type=search], input[type=url], select, textarea { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
label.field { display: block; margin-bottom: 12px; } label.field > span { display: block; font-weight: 550; font-size: 12.5px; margin-bottom: 5px; color: var(--ink-2); } label.field small { color: var(--ink-3); display: block; margin-top: 4px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; margin-bottom: 10px; } .check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; } .switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; } .switch i { position: absolute; inset: 0; background: var(--line-strong); border-radius: 20px; transition: .15s; } .switch i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: var(--shadow-sm); } .switch input:checked + i { background: var(--brand); } .switch input:checked + i::after { transform: translateX(16px); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; } .seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; cursor: pointer; font-weight: 550; color: var(--ink-2); font-size: 12.5px; } .seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); } .card.pad { padding: 18px; } .card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); } .card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; } .card-body { padding: 18px; }
.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)); } .g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } .g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g-main { grid-template-columns: 1fr; } } @media (max-width: 640px) { .g2, .g4 { grid-template-columns: 1fr; } }
.kpi { padding: 16px 18px; } .kpi .label { color: var(--ink-2); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 7px; } .kpi .label svg { width: 15px; height: 15px; color: var(--ink-3); } .kpi .value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; line-height: 1.15; } .kpi .delta { font-size: 12px; margin-top: 3px; color: var(--ink-3); } .kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--bad); }
.kpi.link { cursor: pointer; transition: border-color .12s, transform .12s; } .kpi.link:hover { border-color: var(--brand); transform: translateY(-1px); }
table.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; } .tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; } .tbl tr:last-child td { border-bottom: 0; } .tbl tbody tr.click { cursor: pointer; } .tbl tbody tr.click:hover { background: var(--surface-2); } .tbl .num { text-align: right; font-variant-numeric: tabular-nums; } .tbl-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; } .badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; } .badge.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; } .badge.brand { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; } [data-theme="dark"] .badge.brand { color: #fff; }
.count { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 20px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; } .count.muted { background: var(--line-strong); color: var(--ink); } .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ink-3); flex: none; } .dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); } .dot.brand { background: var(--brand); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 650; font-size: 12.5px; color: #fff; flex: none; letter-spacing: 0; } .avatar.sm { width: 26px; height: 26px; font-size: 10.5px; } .avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; } .tabs button { border: 0; background: none; padding: 9px 13px; cursor: pointer; font-weight: 550; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; } .tabs button:hover { color: var(--ink); } .tabs button.active { color: var(--brand-strong); border-bottom-color: var(--brand); } [data-theme="dark"] .tabs button.active { color: #fff; }
.empty { text-align: center; padding: 46px 20px; color: var(--ink-2); } .empty svg { width: 38px; height: 38px; color: var(--ink-3); margin-bottom: 10px; } .empty h3 { color: var(--ink); margin-bottom: 4px; } .empty .btn { margin-top: 14px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; } .list-row.click { cursor: pointer; } .list-row.click:hover { background: var(--surface-2); } .list-row .grow { flex: 1; min-width: 0; } .list-row .title { font-weight: 600; } .list-row .meta { color: var(--ink-2); font-size: 12.5px; }
.callout { display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--r); background: var(--info-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); font-size: 13px; } .callout svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--info); } .callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); } .callout.warn svg { color: var(--warn); } .callout.ai { background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 25%, transparent); } .callout.ai svg { color: var(--violet); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 13px; } .kv dt { color: var(--ink-2); } .kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.progress { height: 7px; background: var(--surface-2); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); } .progress i { display: block; height: 100%; background: var(--brand); border-radius: 8px; transition: width .4s; }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; } .stars .off { color: var(--line-strong); }
pre.code, code.code { font: 12px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; } pre.code { padding: 12px 14px; overflow: auto; max-height: 340px; margin: 0; white-space: pre-wrap; word-break: break-word; } code.code { padding: 1px 6px; }

/* ---------- overlays */
.overlay { position: fixed; inset: 0; background: rgb(15 23 42 / .45); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .14s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .16s; border: 1px solid var(--line); } .modal.lg { width: min(860px, 100%); } .modal.sm { width: min(420px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; } .modal-head h2 { flex: 1; } .modal-body { padding: 20px; overflow-y: auto; } .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 16px 16px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 101; display: flex; flex-direction: column; animation: slide .2s; border-left: 1px solid var(--line); } .drawer.wide { width: min(760px, 100vw); }
.pop { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 90; min-width: 200px; padding: 6px; } .pop button, .pop a { display: flex; width: 100%; gap: 9px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; color: var(--ink); text-decoration: none; } .pop button:hover, .pop a:hover { background: var(--surface-2); } .pop svg { width: 15px; height: 15px; color: var(--ink-2); } .pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; } .toast { background: var(--ink); color: var(--surface); padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 380px; animation: pop .16s; font-weight: 500; } .toast.error { background: var(--bad); color: #fff; } .toast.ok { background: #15803d; color: #fff; } .toast svg { width: 16px; height: 16px; flex: none; }
.callpop { position: fixed; top: 68px; right: 20px; width: 340px; z-index: 150; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 16px; animation: slide .2s; } .callpop .ring { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; } .callpop .ring .dot { background: var(--ok); animation: pulse 1s infinite; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } } @keyframes slide { from { transform: translateX(30px); opacity: 0; } } @keyframes pulse { 50% { opacity: .3; } } @keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; } .loading { display: grid; place-items: center; padding: 60px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 14px; } @keyframes sk { to { background-position: -200% 0; } }

/* ---------- messaging (inbox, chat, AI simulator) */
.split { display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; height: 100%; min-height: 0; } .split.two { grid-template-columns: 300px minmax(0, 1fr); } .split > * { min-height: 0; min-width: 0; } .pane { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); } .pane:last-child { border-right: 0; } .pane-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; min-height: 57px; } .pane-body { flex: 1; overflow-y: auto; }
@media (max-width: 1200px) { .split { grid-template-columns: 300px minmax(0, 1fr); } .split > .pane-info { display: none; } } @media (max-width: 760px) { .split, .split.two { grid-template-columns: 1fr; } .split.has-open > .pane-list { display: none; } .split:not(.has-open) > .pane-thread { display: none; } }
.conv { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; } .conv:hover { background: var(--surface-2); } .conv.active { background: var(--brand-soft); } .conv .body { flex: 1; min-width: 0; } .conv .top-row { display: flex; gap: 8px; align-items: baseline; } .conv .name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .conv.unread .name { font-weight: 750; } .conv .time { font-size: 11.5px; color: var(--ink-3); flex: none; } .conv .preview { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .conv.unread .preview { color: var(--ink); font-weight: 550; }
.thread { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.bubble { max-width: min(72%, 560px); padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; position: relative; line-height: 1.42; } .bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; } .bubble.out { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 5px; } .bubble.out.auto { background: color-mix(in srgb, var(--brand) 16%, var(--surface)); color: var(--ink); border: 1px dashed color-mix(in srgb, var(--brand) 45%, transparent); } .bubble.failed { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.bubble-meta { font-size: 11px; color: var(--ink-3); margin: 0 4px 6px; } .bubble-meta.out { align-self: flex-end; } .day-sep { align-self: center; font-size: 11.5px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); padding: 2px 10px; border-radius: 20px; margin: 10px 0; font-weight: 550; }
.composer { border-top: 1px solid var(--line); padding: 12px 14px; background: var(--surface); } .composer textarea { border: 0; box-shadow: none !important; min-height: 60px; padding: 4px 2px; resize: none; background: transparent; } .composer .bar { display: flex; gap: 6px; align-items: center; } .composer .bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 12px; }
.tool-chip { align-self: center; font: 11.5px ui-monospace, Consolas, monospace; background: var(--violet-soft); color: var(--violet); border-radius: 8px; padding: 4px 10px; max-width: 90%; overflow-wrap: anywhere; }

/* ---------- calendar */
.cal { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; position: relative; max-height: calc(100vh - 220px); } .cal-head { position: sticky; top: 0; z-index: 5; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 9px 10px; font-weight: 600; font-size: 12.5px; text-align: center; border-left: 1px solid var(--line); } .cal-time { font-size: 11px; color: var(--ink-3); text-align: right; padding: 0 8px; transform: translateY(-7px); } .cal-col { position: relative; border-left: 1px solid var(--line); } .cal-slot { height: 28px; border-bottom: 1px solid var(--line); cursor: pointer; } .cal-slot:nth-child(even) { border-bottom-style: dashed; border-bottom-color: color-mix(in srgb, var(--line) 60%, transparent); } .cal-slot:hover { background: var(--brand-soft); }
.appt { position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 3px 7px; font-size: 11.5px; line-height: 1.3; overflow: hidden; cursor: pointer; border-left: 3px solid var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 14%, var(--surface)); color: var(--ink); z-index: 2; } .appt:hover { z-index: 3; box-shadow: var(--shadow); } .appt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .appt.cancelled, .appt.no_show { opacity: .45; text-decoration: line-through; } .appt .risk { position: absolute; top: 3px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 4; pointer-events: none; } .now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ---------- charts */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; } .chart text { fill: var(--ink-3); font-size: 10.5px; font-family: var(--font); } .chart .grid-line { stroke: var(--line); stroke-width: 1; } .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; font-size: 10px; color: var(--ink-3); align-items: center; } .heat i { aspect-ratio: 1; border-radius: 3px; background: var(--brand); display: block; min-height: 10px; }

/* ---------- utilities */
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .col { display: flex; flex-direction: column; gap: 10px; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; } .right { margin-left: auto; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .bold { font-weight: 650; } .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; } .nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .center { text-align: center; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .gap4 { gap: 4px; } .gap16 { gap: 16px; } .hidden { display: none !important; } .c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-warn { color: var(--warn); } .c-brand { color: var(--brand); } .c-violet { color: var(--violet); }
.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; } .ico.lg { width: 20px; height: 20px; }

/* ---------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; } .login-art { background: radial-gradient(1200px 600px at 10% 10%, #1d4ed8 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #7c3aed 0%, transparent 55%), #0b1120; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; } .login-art h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.03em; max-width: 520px; } .login-art p { color: #cbd5e1; max-width: 480px; margin-top: 14px; font-size: 16px; } .login-form { display: grid; place-items: center; padding: 30px; background: var(--surface); } .login-form form { width: min(380px, 100%); } .demo-logins { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; } .demo-logins button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); padding: 9px 12px; border-radius: 10px; margin-top: 8px; cursor: pointer; } .demo-logins button:hover { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- phones: sheets instead of centred modals, tighter chrome, larger tap targets */
@media (max-width: 700px) {
  .top { padding: 0 10px; gap: 6px; } .top select { max-width: 132px; font-size: 13px; padding: 0 6px; }
  .page-head { gap: 12px; margin-bottom: 14px; } .page-head .actions { margin-left: 0; width: 100%; } .page-head .actions .btn { flex: 1; }
  .overlay { padding: 0; place-items: end stretch; } .modal, .modal.lg, .modal.sm { width: 100%; max-height: 92svh; border-radius: 18px 18px 0 0; animation: sheet .2s; } .modal-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); } .modal-foot .btn { flex: 1; height: 44px; }
  .drawer, .drawer.wide { width: 100vw; }
  .btn { height: 40px; } .btn.sm { height: 36px; } .btn.icon { width: 40px; } .btn.icon.sm { width: 36px; }
  input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=password], input[type=search], input[type=url], select, textarea { font-size: 16px; height: 44px; } textarea { height: auto; }
  .kpi .value { font-size: 24px; } .card.pad, .card-body { padding: 14px; } .card-head { padding: 12px 14px; } .list-row { padding: 12px 14px; }
  .tbl th, .tbl td { padding: 10px 12px; } .kv { grid-template-columns: 110px 1fr; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); } .toast { max-width: none; } .callpop { left: 10px; right: 10px; width: auto; top: 64px; }
  .thread { padding: 14px 12px; } .bubble { max-width: 86%; } .composer .bar { flex-wrap: wrap; } .cal { max-height: calc(100svh - 250px); }
  .login-form { padding: 22px 18px; align-items: start; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
