/* MoveMate CRM — design system (no frameworks) */
:root {
  --brand: #045CB8; --brand-600: #034f9f; --brand-700: #033f80; --brand-50: #eef5fd; --brand-100: #d9e9fb;
  --accent: #FF9305; --accent-50: #fff4e5;
  --ink: #0E1B2C; --ink-2: #33415a; --muted: #6b7a90; --line: #e3e8f0; --line-2: #eef1f6;
  --bg: #f4f6fa; --card: #ffffff;
  --success: #12805c; --success-50: #e7f6ef; --warning: #b25e00; --warning-50: #fff4e0;
  --danger: #c4314b; --danger-50: #fdecef; --info: #0a6bcf; --info-50: #e8f2fd;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(14,27,44,.06), 0 1px 3px rgba(14,27,44,.04);
  --shadow-lg: 0 12px 40px rgba(14,27,44,.18); --sidebar: 252px; --topbar: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.45rem; font-weight: 700; } h2 { font-size: 1.1rem; font-weight: 650; } h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.strong { font-weight: 650; } .mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--ink); color: #c6d0de; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease; }
.sidebar-brand { height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 18px; color: #fff; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #2f8be6); display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: -.5px; }
.brand-mark span { color: var(--accent); }
.sidebar-nav { overflow-y: auto; padding: 10px 10px 20px; flex: 1; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f7f97; padding: 14px 10px 6px; font-weight: 650; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #c6d0de; font-weight: 500; margin-bottom: 1px; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.sidebar-foot { padding: 12px 18px; font-size: 12px; color: #6f7f97; border-top: 1px solid rgba(255,255,255,.07); }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar); background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 30; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; }
.content { padding: 22px; max-width: 1480px; width: 100%; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(14,27,44,.45); z-index: 35; }
body.nav-open .overlay { display: block; }

/* Global search */
.global-search { position: relative; width: min(440px, 46vw); }
.global-search input { width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font: inherit; }
.global-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.global-search > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto; display: none; z-index: 50; }
.search-results.open { display: block; }
.search-group { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.search-group h6 { margin: 0; padding: 4px 14px; font-size: 10.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.search-item { display: block; padding: 7px 14px; color: var(--ink); }
.search-item:hover, .search-item.active { background: var(--brand-50); text-decoration: none; }
.search-item small { display: block; color: var(--muted); }

/* Icon buttons & dropdowns */
.icon-btn { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; }
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--ink); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg); text-decoration: none; }
.dropdown-menu .divider { height: 1px; background: var(--line); margin: 5px 0; }
.notif-menu { width: 360px; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.notif:hover { background: var(--bg); text-decoration: none; }
.notif.unread { background: var(--brand-50); }
.notif b { display: block; font-weight: 600; font-size: 13px; }
.notif small { color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 9px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink); }
.user-chip:hover { background: var(--bg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.user-chip .meta { text-align: left; line-height: 1.2; }
.user-chip .meta small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #ec8600; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #0e6a4c; }
.btn-danger { background: #fff; border-color: #f2c2cb; color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); }
.btn-danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.link-btn.danger { color: var(--danger); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); color: var(--ink); }
a.stat:hover { border-color: var(--brand-100); text-decoration: none; box-shadow: 0 4px 14px rgba(4,92,184,.08); }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.stat-icon.tone-success { background: var(--success-50); color: var(--success); }
.stat-icon.tone-warning { background: var(--warning-50); color: var(--warning); }
.stat-icon.tone-danger { background: var(--danger-50); color: var(--danger); }
.stat-icon.tone-accent { background: var(--accent-50); color: #c96f00; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.stat-hint { font-size: 12px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table .check { width: 36px; }
.table td .sub { display: block; color: var(--muted); font-size: 12px; }
.table.compact td, .table.compact th { padding: 7px 12px; }
.table tfoot td { font-weight: 650; background: #fafbfd; }
.th-sort { color: inherit; }
.row-link { color: var(--ink); font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-neutral { background: #eef1f5; color: var(--ink-2); }
.badge-outline { background: #fff; border-color: var(--line); color: var(--ink-2); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.col-12 { grid-column: span 12; } .col-10 { grid-column: span 10; } .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; } .col-1 { grid-column: span 1; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; } .col-9 { grid-column: span 9; }
.field label, .label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 5px; color: var(--ink-2); }
.field .req { color: var(--danger); }
.input, select.input, textarea.input { width: 100%; padding: 8px 11px; border: 1px solid #d3dae5; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.input.is-invalid, .is-invalid .input { border-color: var(--danger); }
.input[readonly] { background: var(--bg); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.input-group { display: flex; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; border-left: 0; }
.input-prefix { display: flex; align-items: center; }
.input-prefix span { padding: 8px 10px; border: 1px solid #d3dae5; border-right: 0; border-radius: 8px 0 0 8px; background: var(--bg); color: var(--muted); }
.input-prefix .input { border-radius: 0 8px 8px 0; }
fieldset { border: 0; padding: 0; margin: 0; }
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 6px 0 -4px; grid-column: span 12; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.filters .field { min-width: 140px; flex: 1 1 140px; max-width: 220px; }
.filters .field.wide { max-width: 320px; flex: 2 1 220px; }
.filters .input { padding: 7px 10px; }
.filters .btns { display: flex; gap: 6px; }
.views-bar { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.view-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.view-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.view-chip:hover { text-decoration: none; border-color: var(--brand-100); }
.view-chip form { display: inline; }
.view-chip button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; opacity: .6; }

/* Bulk bar */
.bulk-bar { display: none; align-items: center; gap: 10px; padding: 10px 18px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); flex-wrap: wrap; }
.bulk-bar.show { display: flex; }
.bulk-bar .input { width: auto; padding: 6px 10px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 600; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .active { color: var(--brand); border-bottom-color: var(--brand); }
.card > .tabs { margin: 0; padding: 0 12px; }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* Key/value */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.kv.cols-2 { grid-template-columns: 130px minmax(0, 1fr) 130px minmax(0, 1fr); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline .tl-dot.success { border-color: var(--success); } .timeline .tl-dot.warning { border-color: var(--accent); } .timeline .tl-dot.danger { border-color: var(--danger); } .timeline .tl-dot.muted { border-color: #b8c2d0; }
.timeline .tl-text { font-weight: 500; }
.timeline .tl-meta { color: var(--muted); font-size: 12px; }

/* Alerts & flashes */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; border: 1px solid; }
.alert-info { background: var(--info-50); border-color: #c6defa; color: #0b4f97; }
.alert-success { background: var(--success-50); border-color: #bfe5d4; color: #0b5f44; }
.alert-warning { background: var(--warning-50); border-color: #f6d9a8; color: #7a4300; }
.alert-danger, .alert-error { background: var(--danger-50); border-color: #f4c3cc; color: #8e1d33; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: toastIn .25s ease; border-left: 4px solid var(--brand); }
.toast.success { border-left-color: #2ec58e; } .toast.error { border-left-color: #ff5a76; } .toast.warning { border-left-color: var(--accent); }
.toast button { margin-left: auto; background: none; border: 0; color: #9fb0c6; cursor: pointer; font-size: 18px; line-height: 1; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* Empty / loading */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: #b8c2d0; margin-bottom: 8px; }
.empty h3 { color: var(--ink-2); }
.empty-chart { padding: 40px; text-align: center; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fb 50%, #eef1f5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Modal (dialog) & drawer */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(14,27,44,.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfe; }
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); border: 0; padding: 0; box-shadow: var(--shadow-lg); }
dialog.drawer::backdrop { background: rgba(14,27,44,.4); }

/* Charts */
.chart { width: 100%; height: 220px; display: block; }
.chart-grid { stroke: var(--line-2); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; }
.chart-bar { fill: var(--brand); } .chart-bar:hover { fill: var(--accent); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; }
.donut-total { font-size: 22px; font-weight: 750; fill: var(--ink); }
.donut-seg.s0, .sw.s0 { stroke: #045CB8; background: #045CB8; } .donut-seg.s1, .sw.s1 { stroke: #FF9305; background: #FF9305; }
.donut-seg.s2, .sw.s2 { stroke: #12805c; background: #12805c; } .donut-seg.s3, .sw.s3 { stroke: #7c4dff; background: #7c4dff; }
.donut-seg.s4, .sw.s4 { stroke: #c4314b; background: #c4314b; } .donut-seg.s5, .sw.s5 { stroke: #69B2FD; background: #69B2FD; }
.donut-seg.s6, .sw.s6 { stroke: #8a99ad; background: #8a99ad; } .donut-seg.s7, .sw.s7 { stroke: #e2b100; background: #e2b100; }
.legend { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.legend b { margin-left: auto; padding-left: 14px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.progress { height: 8px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.progress.warn > span { background: var(--accent); } .progress.bad > span { background: var(--danger); }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: #eef1f6; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.board-col h4 { display: flex; justify-content: space-between; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 2px 4px 10px; }
.board-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); box-shadow: var(--shadow); }
.board-card:hover { border-color: var(--brand); text-decoration: none; }
.board-card .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-h { padding: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); background: #fafbfd; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 118px; padding: 6px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; font-size: 12px; }
.cal-d.other { background: #fafbfc; color: #a6b1c0; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-d.holiday { background: #fff8ee; }
.cal-num { font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.slot-pill { display: flex; justify-content: space-between; gap: 4px; margin-top: 4px; padding: 3px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--success-50); color: var(--success); }
.slot-pill.full { background: var(--danger-50); color: var(--danger); }
.slot-pill.low { background: var(--warning-50); color: var(--warning); }
.slot-pill.closed { background: #eef1f5; color: #7a8698; }
.cal-job { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 5px; background: var(--brand-50); color: var(--brand-700); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avail-grid td, .avail-grid th { text-align: center; padding: 6px 4px; font-size: 12px; }
.avail-grid td:first-child, .avail-grid th:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 160px; }
.av { display: inline-block; min-width: 34px; padding: 3px 4px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.av-both { background: var(--success-50); color: var(--success); } .av-morning { background: var(--info-50); color: var(--info); }
.av-afternoon { background: #f1ebff; color: #5b34c7; } .av-unavailable { background: var(--danger-50); color: var(--danger); } .av-none { background: #f3f5f8; color: #a3adbb; }
.av-conflict { outline: 2px solid var(--danger); }

/* Steps / job status tracker */
.steps { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 8px; }
.step { flex: 1; min-width: 92px; text-align: center; position: relative; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.step::before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step .bubble { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: grid; place-items: center; margin: 0 auto 6px; position: relative; z-index: 1; }
.step.done { color: var(--ink-2); } .step.done .bubble { border-color: var(--success); background: var(--success); }
.step.done::before, .step.current::before { background: var(--success); }
.step.current { color: var(--brand); } .step.current .bubble { border-color: var(--brand); background: var(--brand-100); }

/* Price summary */
.price-table { width: 100%; border-collapse: collapse; }
.price-table td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.price-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.price-table tr.total td { font-size: 17px; font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); padding-top: 10px; }
.price-table tr.minor td { color: var(--muted); font-size: 13px; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-art { background: linear-gradient(150deg, #033f80, #045CB8 55%, #2f8be6); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,147,5,.18); right: -120px; bottom: -140px; }
.auth-art h2 { color: #fff; font-size: 30px; line-height: 1.2; max-width: 440px; }
.auth-art p { color: #d6e7fb; max-width: 440px; }
.auth-art .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.auth-points { list-style: none; padding: 0; margin: 18px 0 0; }
.auth-points li { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; color: #e6f0fc; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 24px; }
.auth-box .field { margin-bottom: 14px; }
.portal-switch { display: flex; gap: 6px; margin-top: 22px; justify-content: center; flex-wrap: wrap; font-size: 12.5px; }

/* Error page */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.error-code { font-size: 64px; font-weight: 800; color: var(--brand); letter-spacing: -.04em; line-height: 1; }

/* Mobile-first portal (mover/customer) */
.portal-top { background: var(--ink); color: #fff; }
.portal-top .inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.portal-top a { color: #d4deeb; }
.portal-nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.portal-nav .inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 10px; scrollbar-width: none; }
.portal-nav a { padding: 12px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.portal-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.portal-nav a:hover { text-decoration: none; color: var(--ink); }
.portal-main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.job-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; color: var(--ink); box-shadow: var(--shadow); }
.job-card:hover { border-color: var(--brand); text-decoration: none; }
.job-card .row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.action-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.timer { font-size: 36px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; text-align: center; }
.sig-pad { width: 100%; height: 200px; border: 2px dashed #c5cfdc; border-radius: 10px; background: #fff; touch-action: none; display: block; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo-grid a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.privacy-note { display: flex; gap: 8px; align-items: center; background: var(--warning-50); border: 1px solid #f6d9a8; color: #7a4300; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; }
.stars { color: var(--accent); letter-spacing: 1px; white-space: nowrap; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { display: none; }
.star-input label { font-size: 30px; color: #d3dae5; cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--accent); }

/* Reason chips (matching) */
.reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.reason { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--success-50); color: var(--success); }
.reason.warn { background: var(--warning-50); color: var(--warning); }
.reason.block { background: var(--danger-50); color: var(--danger); }
.score { font-size: 18px; font-weight: 800; color: var(--brand); }

/* Permission matrix */
.perm-matrix th, .perm-matrix td { text-align: center; padding: 7px 6px; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; font-weight: 600; }
.perm-matrix input { width: 16px; height: 16px; accent-color: var(--brand); }
.perm-matrix .na { color: #ccd3dd; }

/* Print */
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .main { margin: 0; } .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kv.cols-2 { grid-template-columns: 130px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .user-chip .meta { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 14px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .global-search { width: auto; flex: 1; }
  .grid-2, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid > [class*="col-"] { grid-column: span 12; }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
  .filters .field { max-width: none; flex: 1 1 45%; }
  .page-head h1 { font-size: 1.25rem; }
  .notif-menu { width: calc(100vw - 20px); position: fixed; right: 10px; top: 60px; }
  .cal { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; }
  .cal-d { min-height: 78px; padding: 4px; }
  .cal-job { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 18px; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 14px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12px; text-align: left; }
  .table.responsive td.check::before { content: ""; }
}

/* Polish: brand mark, flex shrink, small screens */
.brand-mark { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; letter-spacing: -.5px; white-space: nowrap; flex-shrink: 0; }
.stat > div:last-child { min-width: 0; }
.stat-label, .stat-hint { overflow-wrap: anywhere; }
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 600px) {
  .portal-top .inner { gap: 8px; }
  .portal-top .inner > span.small { display: none; }
  .portal-top .inner strong { font-size: 14px; }
  .portal-main { padding: 14px 12px 50px; }
  .job-card .row { flex-wrap: wrap; }
  .action-bar { grid-template-columns: 1fr; }
}

/* ---------- Simplified operations UI (v2) ---------- */
.badge-muted { background: #eef1f5; color: var(--muted); }
.badge-solid.badge-success { background: #2e7d32; color: #fff; }
.badge-solid.badge-danger { background: var(--danger); color: #fff; }
.badge-solid.badge-warning { background: #f0a020; color: #fff; }
.badge-solid.badge-info { background: var(--info); color: #fff; }
.price-tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: #eef1f5; color: var(--ink-2); vertical-align: 1px; }
.price-tag.fixed { background: var(--accent-50); color: #b45f00; }
.toolbar { padding: 14px 16px 0; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-bottom: 12px; }
.tfield { display: flex; flex-direction: column; gap: 3px; min-width: 130px; flex: 0 1 165px; }
.tfield > span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tfield .input { padding: 7px 10px; }
.btn-round { width: 38px; height: 38px; padding: 0; border-radius: 50%; justify-content: center; }
.toolbar-tabs { margin: 0 -16px; padding: 0 12px; border-bottom: 0; border-top: 1px solid var(--line); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { position: relative; display: flex; flex-direction: column; padding: 14px 16px; border-radius: 12px; min-height: 104px; color: var(--ink); border: 2px solid transparent; }
a.kpi:hover { text-decoration: none; filter: brightness(.98); }
.kpi.current { border-color: currentColor; }
.kpi-label { font-size: 13px; font-weight: 600; }
.kpi-value { font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; }
.kpi-icon { position: absolute; right: 12px; bottom: 12px; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.kpi-blue { background: #dfeefc; } .kpi-blue .kpi-label { color: #1d3c63; } .kpi-blue .kpi-icon { background: #c7d3e0; color: #44546a; }
.kpi-orange { background: #fdf0de; } .kpi-orange .kpi-label, .kpi-orange .kpi-value { color: #9a4a0b; } .kpi-orange .kpi-icon { background: #fbd34d; color: #7a3d00; }
.kpi-green { background: #e5f6ec; } .kpi-green .kpi-label, .kpi-green .kpi-value { color: #14633d; } .kpi-green .kpi-icon { background: #2e9e5b; color: #fff; }
.kpi-slate { background: #eaf0f6; } .kpi-slate .kpi-label, .kpi-slate .kpi-value { color: #1d3c63; } .kpi-slate .kpi-icon { background: #4fb3f6; color: #fff; }
.kpi-red { background: #fdecec; } .kpi-red .kpi-label, .kpi-red .kpi-value { color: #9b1c1c; } .kpi-red .kpi-icon { background: #f8b4b4; color: #9b1c1c; }
.table-search { padding: 12px 16px; }
.search-box { position: relative; width: 100%; max-width: 340px; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 34px; border: 2px solid var(--brand-100); }
.search-box .input:focus { border-color: var(--brand); }
.jobs-table thead th { background: #2f3e53; color: #fff; border-color: #2f3e53; }
.jobs-table thead th a { color: #fff; }
.jobs-table td { vertical-align: middle; }
.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.icon-btn.sm { width: 30px; height: 30px; }
.table-foot { display: flex; align-items: center; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.per-page label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.per-page .input { width: auto; padding: 4px 8px; }
.nav-more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #8e9db3; font-weight: 500; margin-top: 8px; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-more[open] summary .chev { transform: rotate(180deg); }
.nav-more .chev { margin-left: auto; transition: transform .15s; }
.nav-more .nav-link { padding-left: 18px; font-size: 13.5px; }
.nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 10px 6px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 88px; } .kpi-value { font-size: 30px; }
  .tfield { flex: 1 1 45%; }
  .search-box { max-width: none; }
  .table-foot { justify-content: center; }
}
@media (max-width: 900px) {
  input.input, select.input, textarea.input, .global-search input { font-size: 16px; }
}
.narrow-form { max-width: 880px; }
.narrow-form > .card { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 600; background: #fff; transition: all .12s; }
.chip:hover span { border-color: var(--brand-100); }
.chip input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.segmented { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: #f6f8fb; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 8px 20px; border-radius: 7px; font-weight: 650; color: var(--muted); }
.segmented input:checked + span { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.places-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); margin-top: 4px; padding: 4px; max-height: 300px; overflow-y: auto; }
.places-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 7px; cursor: pointer; font: inherit; }
.places-item strong { display: block; font-weight: 600; color: var(--ink); }
.places-item span { font-size: 12.5px; color: var(--muted); }
.places-item:hover, .places-item.active { background: var(--brand-50); }
.price-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.price-summary > div { display: flex; flex-direction: column; gap: 2px; }
.price-summary strong { font-size: 16px; }
@media (max-width: 720px) { .price-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card-tabs { margin: 0; padding: 0 12px; }
.table-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.table-search-extra { display: flex; gap: 8px; flex: 1; }
.table-search-extra .input { width: auto; max-width: 200px; }
.truck-chips { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.truck-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; white-space: nowrap; background: #fff; }
.rating-num { display: inline-block; min-width: 22px; }
@media (max-width: 720px) { .table-search-extra { flex: 1 1 100%; } .table-search-extra .input { flex: 1; max-width: none; } }
.kpi-value.kpi-money { font-size: 26px; margin-top: 12px; }
.track-badge { display: flex; align-items: center; gap: 8px; background: var(--success-50); color: var(--success); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.track-badge.off { background: var(--warning-50); color: var(--warning); }
.track-badge[hidden] { display: none; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,128,92,.5); } 70% { box-shadow: 0 0 0 8px rgba(18,128,92,0); } 100% { box-shadow: 0 0 0 0 rgba(18,128,92,0); } }
.live-map { height: calc(100vh - 230px); min-height: 420px; border-radius: 0 0 var(--radius) var(--radius); }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.live-list { max-height: calc(100vh - 230px); overflow-y: auto; }
.live-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); cursor: pointer; }
.live-item:hover { background: var(--bg); text-decoration: none; }
.live-item .meta { font-size: 12px; color: var(--muted); }
.truck-marker { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
@media (max-width: 900px) { .live-layout { grid-template-columns: 1fr; } .live-map { height: 60vh; } .live-list { max-height: none; } }
/* Legal text (terms) */
.legal { line-height: 1.65; color: var(--ink-2); }
.legal h1 { font-size: 1.6rem; }
.legal h2 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; color: var(--ink); padding-bottom: .35rem; border-bottom: 2px solid var(--brand-100); }
.legal h3 { font-size: 1rem; margin: 1.3rem 0 .5rem; color: var(--ink); }
.legal h4 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--ink); }
.legal ol, .legal ul { padding-left: 1.6rem; margin: .4rem 0 .8rem; }
.legal ol ol { list-style-type: decimal; }
.legal ol[type="a" s] { list-style-type: lower-alpha; } .legal ol[type="A" s] { list-style-type: upper-alpha; } .legal ol[type="i" s] { list-style-type: lower-roman; } .legal ol[type="I" s] { list-style-type: upper-roman; }
.legal li { margin: .3rem 0; }
.legal p { margin: .4rem 0; }
.legal-page { max-width: 900px; padding-top: 32px; padding-bottom: 48px; }
.legal-head { border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.rte { border: 1.5px solid var(--line); border-radius: 0 0 10px 10px; padding: 16px 20px; min-height: 420px; max-height: 70vh; overflow-y: auto; background: #fff; outline: none; }
.rte:focus { border-color: var(--brand); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: #f6f8fb; margin-top: 12px; }
.rte-toolbar button { border: 1px solid transparent; background: none; padding: 5px 10px; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.rte-toolbar button:hover, .rte-toolbar button.active { background: #fff; border-color: var(--line); }
.rte-toolbar .sep { width: 1px; background: var(--line); margin: 2px 4px; }
#rteHtml { border-radius: 0 0 10px 10px; font-size: 12.5px; }
.version-list { list-style: none; margin: 0; padding: 0; }
.version-list li { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.version-list li:last-child { border-bottom: 0; }
@media print { .site-header, .site-footer, .legal-head .btn { display: none !important; } }
/* Brand logo */
.brand-logo { display: block; width: auto; max-width: 100%; object-fit: contain; }
.logo-chip { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 4px 10px; line-height: 0; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.logo-chip .brand-logo { height: 40px; }
.logo-chip.lg { padding: 8px 16px; border-radius: 14px; }
.logo-chip.lg .brand-logo { height: 64px; }
a.sidebar-brand { height: auto; min-height: var(--topbar); padding: 10px 18px; text-decoration: none; }
a.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand .logo-chip { width: 100%; padding: 2px 10px; }
.sidebar-brand .brand-logo { height: 62px; }
.portal-top .logo-chip { padding: 3px 8px; }
.portal-top .logo-chip .brand-logo { height: 32px; }
.auth-logo { display: none; margin-bottom: 18px; }
.auth-logo .brand-logo { height: 72px; }
@media (max-width: 900px) { .auth-logo { display: block; } }
.error-page .brand-logo { height: 64px; margin: 0 auto; }
.brand-upload { display: flex; gap: 14px; align-items: center; }
.brand-preview { display: grid; place-items: center; width: 150px; height: 84px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; padding: 6px; flex-shrink: 0; }
.brand-preview.icon { width: 84px; }
.brand-preview img { max-width: 100%; max-height: 100%; }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 60px; } .pw-wrap .link-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.area-tile { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; background: #fff; }
.area-tile:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.area-tile input { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; }
.area-tile small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
/* Sales progress tracker (enquiry page) */
.flow-card .card-body { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 300px; overflow-x: auto; }
.flow-steps li { flex: 1; min-width: 92px; position: relative; text-align: center; padding: 0 4px; }
.flow-steps li::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.flow-steps li:first-child::before { display: none; }
.flow-steps li.done::before, .flow-steps li.current::before { background: var(--success); }
.flow-steps .dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: #fff; border: 2px solid var(--line); font-weight: 700; font-size: 12px; color: var(--muted); }
.flow-steps li.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.flow-steps li.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }
.flow-steps .lbl { display: block; font-size: 12px; font-weight: 650; margin-top: 6px; color: var(--ink-2); }
.flow-steps li.current .lbl { color: var(--ink); }
.flow-steps small { display: block; font-size: 11px; color: var(--muted); }
.flow-next { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
@media (max-width: 720px) { .flow-steps li { min-width: 78px; } .flow-next, .flow-next .btn { width: 100%; justify-content: center; } }
/* Searchable item picker */
.combo { position: relative; }
.combo .input { padding-left: 34px; }
.combo-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 1; line-height: 0; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 80; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 340px; overflow-y: auto; padding: 4px; }
.combo-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
.combo-item { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; color: var(--ink); }
.combo-item span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.combo-item:hover, .combo-item.active { background: var(--brand-50); }
.combo-create { justify-content: flex-start; align-items: center; gap: 6px; color: var(--brand); font-weight: 650; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; margin-top: 4px; position: sticky; bottom: -4px; background: #fff; }
.combo-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.inv-new { border: 1.5px dashed var(--brand-100); background: var(--brand-50); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.inv-new-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.row-flash td { animation: rowflash .9s ease; }
@keyframes rowflash { from { background: #fff4d6; } to { background: transparent; } }
.inv-lines td { vertical-align: middle; } .inv-lines .input.num { text-align: right; }
/* Sidebar toggle: collapses the menu on desktop, slides it in on small screens */
.menu-toggle { display: inline-grid; flex-shrink: 0; }
.main { transition: margin-left .2s ease; }
@media (min-width: 901px) {
  body.nav-collapsed .sidebar { transform: translateX(-100%); }
  body.nav-collapsed .main { margin-left: 0; }
}
@media (max-width: 900px) {
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { box-shadow: var(--shadow-lg); }
}
@media (max-width: 1100px) and (min-width: 901px) { .user-chip .meta { display: none; } }
/* Wrapping tab bar for pages with many tabs (Settings) */
.tabs.tabs-wrap { flex-wrap: wrap; gap: 6px; border-bottom: 0; overflow: visible; }
.tabs.tabs-wrap a { padding: 6px 14px; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13.5px; }
.tabs.tabs-wrap a:hover { border-color: var(--brand-100); color: var(--brand); }
.tabs.tabs-wrap a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
