:root {
  --bg: #090b10;
  --bg-2: #0d1118;
  --panel: rgba(20, 24, 33, 0.68);
  --panel-strong: rgba(27, 33, 45, 0.86);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --stroke: rgba(255, 255, 255, 0.095);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text: #f6f8fb;
  --muted: #9ba6b6;
  --accent: #78b7ff;
  --accent-2: #66e3ff;
  --success: #63d69f;
  --warning: #f5b86b;
  --danger: #ff7b86;
  --violet: #a999ff;
  --shadow: 0 24px 64px rgba(0,0,0,.36);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(64, 126, 255, .14), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(35, 212, 255, .10), transparent 25%),
    radial-gradient(circle at 50% 100%, rgba(114, 91, 255, .08), transparent 34%),
    linear-gradient(160deg, #07090d, #0b0e14 46%, #090c12 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.3), transparent 65%);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.glass-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.038));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--shadow);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
}
.glass-soft {
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.075);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  gap: 18px;
  padding: 18px;
}
.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  border-radius: var(--radius-xl);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
}
.brand-row { display:flex; align-items:center; gap:12px; padding:8px 8px 18px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display:grid; place-items:center; font-weight:800;
  background: linear-gradient(145deg, rgba(142,196,255,.95), rgba(103,122,255,.75));
  box-shadow: 0 8px 30px rgba(86, 148, 255,.24), inset 0 1px 0 rgba(255,255,255,.45);
  color:#06101f;
}
.brand-name { font-weight: 760; letter-spacing: -.02em; }
.brand-subtitle { color: var(--muted); font-size: 12px; margin-top: 3px; }
.side-nav { display:flex; flex-direction:column; gap:6px; margin-top: 6px; }
.nav-item {
  border: 0; background: transparent; width:100%; text-align:left;
  display:flex; align-items:center; gap:12px; padding:12px 13px; border-radius:14px;
  color:#c8d0db; cursor:pointer; transition:.2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.05); color:#fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(108,171,255,.18), rgba(92,233,255,.08));
  border:1px solid rgba(130,190,255,.16);
  color:#fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.nav-icon { width:24px; text-align:center; opacity:.9; }
.sidebar-footer { margin-top:auto; padding-top: 18px; }
.profile { display:flex; align-items:center; gap:10px; padding:10px; border-radius:16px; }
.avatar { width:36px; height:36px; border-radius:12px; display:grid; place-items:center; background:rgba(120,183,255,.14); border:1px solid rgba(120,183,255,.22); }
.profile-copy { display:flex; flex-direction:column; gap:2px; min-width:0; }
.profile-copy strong { font-size:13px; }
.profile-copy span { font-size:11px; color:var(--muted); }

.main-area { min-width:0; }
.topbar {
  position: sticky; top:18px; z-index:20;
  height:66px; border-radius:22px; padding:10px 12px;
  display:flex; align-items:center; gap:12px;
}
.top-search-wrap { position:relative; flex:1; max-width:720px; }
.search-icon { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:18px; }
.top-search {
  width:100%; height:44px; padding:0 14px 0 40px;
  border-radius:14px; border:1px solid transparent; outline:none;
  color:var(--text); background:rgba(255,255,255,.045);
  transition:.2s ease;
}
.top-search:focus { border-color:rgba(120,183,255,.34); background:rgba(255,255,255,.07); box-shadow:0 0 0 4px rgba(120,183,255,.06); }
.search-results { position:absolute; left:0; right:0; top:52px; border-radius:18px; padding:8px; max-height:360px; overflow:auto; z-index:60; }
.search-result { padding:10px 12px; border-radius:12px; cursor:pointer; display:flex; justify-content:space-between; gap:12px; }
.search-result:hover { background:rgba(255,255,255,.055); }
.search-result small { color:var(--muted); }
.top-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }
.icon-button, .primary-action, .secondary-action, .danger-action {
  border:1px solid var(--stroke); cursor:pointer; transition:.18s ease;
  background:rgba(255,255,255,.045); border-radius:14px;
}
.icon-button { width:44px; height:44px; display:grid; place-items:center; }
.icon-button:hover, .secondary-action:hover { background:rgba(255,255,255,.075); transform:translateY(-1px); }
.primary-action { padding:11px 15px; font-weight:700; color:#06101f; background:linear-gradient(145deg,#a5d1ff,#6ebcff 55%,#72f0ff); border-color:rgba(255,255,255,.3); box-shadow:0 10px 26px rgba(93,172,255,.20), inset 0 1px 0 rgba(255,255,255,.55); }
.primary-action:hover { transform:translateY(-1px); filter:brightness(1.04); }
.secondary-action { padding:10px 14px; }
.danger-action { padding:10px 14px; border-color:rgba(255,123,134,.20); color:#ffc3c8; background:rgba(255,123,134,.08); }

.page { padding:22px 2px 110px; }
.page-head { display:flex; align-items:end; justify-content:space-between; gap:16px; margin: 6px 4px 20px; }
.page-head h1 { margin:0; font-size: clamp(26px, 3vw, 38px); letter-spacing:-.035em; }
.page-head p { color:var(--muted); margin:7px 0 0; }
.page-actions { display:flex; gap:8px; flex-wrap:wrap; }

.kpi-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:14px; }
.kpi-card { padding:18px; border-radius:20px; min-height:126px; position:relative; overflow:hidden; }
.kpi-card::after { content:""; position:absolute; width:100px; height:100px; border-radius:50%; right:-26px; top:-30px; background:radial-gradient(circle, rgba(130,190,255,.14), transparent 68%); }
.kpi-label { color:var(--muted); font-size:13px; }
.kpi-value { font-size:30px; font-weight:780; letter-spacing:-.03em; margin-top:12px; }
.kpi-note { margin-top:9px; color:#c8d2df; font-size:12px; }
.kpi-note.success { color:#8be2b9; }
.kpi-note.warning { color:#ffd09c; }

.dashboard-grid { display:grid; grid-template-columns: 1.35fr .85fr; gap:14px; margin-top:14px; }
.panel { border-radius:22px; padding:18px; min-width:0; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.panel-title { font-size:16px; font-weight:720; }
.panel-sub { color:var(--muted); font-size:12px; margin-top:3px; }

.timeline { display:flex; flex-direction:column; gap:8px; }
.timeline-row { display:grid; grid-template-columns:68px 1fr auto; gap:12px; align-items:center; padding:12px; border-radius:16px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.05); }
.timeline-time { font-weight:700; color:#dbe8f9; }
.timeline-main strong { display:block; font-size:14px; }
.timeline-main span { color:var(--muted); font-size:12px; margin-top:3px; display:block; }

.status { display:inline-flex; align-items:center; gap:6px; font-size:11px; padding:6px 9px; border-radius:999px; border:1px solid; white-space:nowrap; }
.status::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; box-shadow:0 0 10px currentColor; }
.status.new { color:#99c7ff; background:rgba(120,183,255,.07); border-color:rgba(120,183,255,.15); }
.status.confirmed { color:#79e6ff; background:rgba(102,227,255,.06); border-color:rgba(102,227,255,.15); }
.status.inwork { color:#84e4b5; background:rgba(99,214,159,.07); border-color:rgba(99,214,159,.15); }
.status.waiting { color:#ffd19c; background:rgba(245,184,107,.07); border-color:rgba(245,184,107,.15); }
.status.done { color:#9ff0c7; background:rgba(99,214,159,.07); border-color:rgba(99,214,159,.15); }
.status.cancelled { color:#ff9fa8; background:rgba(255,123,134,.07); border-color:rgba(255,123,134,.15); }

.progress-list { display:flex; flex-direction:column; gap:12px; }
.progress-row { padding:12px; border-radius:16px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.05); }
.progress-top { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13px; }
.progress-top span:last-child { color:var(--muted); }
.progress-bar { height:7px; background:rgba(255,255,255,.055); border-radius:999px; margin-top:9px; overflow:hidden; }
.progress-fill { height:100%; border-radius:999px; background:linear-gradient(90deg,var(--accent),var(--accent-2)); box-shadow:0 0 16px rgba(102,227,255,.24); }

.table-wrap { overflow:auto; border-radius:20px; }
table { width:100%; border-collapse:collapse; min-width:820px; }
th { color:var(--muted); font-size:11px; font-weight:650; text-align:left; padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.06); position:sticky; top:0; background:rgba(12,15,21,.9); backdrop-filter:blur(18px); }
td { padding:14px; border-bottom:1px solid rgba(255,255,255,.045); font-size:13px; vertical-align:middle; }
tr:hover td { background:rgba(255,255,255,.018); }
.cell-main { font-weight:650; }
.cell-sub { color:var(--muted); font-size:11px; margin-top:3px; }
.money-positive { color:#8be2b9; font-weight:700; }
.money-muted { color:#c9d1dc; }
.row-action { border:0; background:transparent; cursor:pointer; color:#b8c3d1; padding:6px 8px; border-radius:10px; }
.row-action:hover { background:rgba(255,255,255,.06); color:#fff; }

.card-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; }
.entity-card { padding:16px; border-radius:20px; cursor:pointer; transition:.18s ease; }
.entity-card:hover { transform:translateY(-2px); border-color:rgba(120,183,255,.18); }
.entity-top { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.entity-title { font-weight:730; font-size:16px; }
.entity-sub { color:var(--muted); font-size:12px; margin-top:4px; }
.entity-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:14px; }
.mini-stat { padding:10px; border-radius:14px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.05); }
.mini-stat span { color:var(--muted); font-size:10px; display:block; }
.mini-stat strong { display:block; margin-top:4px; font-size:13px; }

.filters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.input, .select, .textarea {
  width:100%; border:1px solid rgba(255,255,255,.085); background:rgba(255,255,255,.045); color:var(--text); outline:none;
  border-radius:14px; padding:11px 12px; transition:.18s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color:rgba(120,183,255,.38); box-shadow:0 0 0 4px rgba(120,183,255,.055); }
.select option { background:#111722; color:#fff; }
.textarea { min-height:92px; resize:vertical; }
.filter-search { max-width:320px; }

.modal-backdrop { position:fixed; inset:0; z-index:100; background:rgba(1,3,7,.62); backdrop-filter:blur(12px); display:grid; place-items:center; padding:18px; }
.modal { width:min(720px, 100%); max-height:calc(100vh - 36px); overflow:auto; border-radius:26px; padding:20px; }
.modal h2 { margin:0 0 6px; letter-spacing:-.02em; }
.modal-desc { color:var(--muted); margin:0 0 18px; font-size:13px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-group.full { grid-column:1/-1; }
.form-label { color:#b8c3d1; font-size:12px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }

.quick-menu { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.quick-tile { border:1px solid var(--stroke); background:rgba(255,255,255,.045); border-radius:18px; padding:16px; cursor:pointer; text-align:left; }
.quick-tile:hover { background:rgba(255,255,255,.07); border-color:rgba(120,183,255,.18); }
.quick-tile strong { display:block; }
.quick-tile span { color:var(--muted); font-size:12px; display:block; margin-top:5px; }

.detail-hero { padding:22px; border-radius:24px; display:flex; justify-content:space-between; align-items:flex-start; gap:18px; }
.detail-hero h2 { margin:0; font-size:28px; letter-spacing:-.03em; }
.detail-meta { color:var(--muted); margin-top:6px; }
.detail-grid { display:grid; grid-template-columns:1fr 340px; gap:14px; margin-top:14px; }
.finance-box { padding:18px; border-radius:22px; position:sticky; top:100px; align-self:start; }
.finance-row { display:flex; justify-content:space-between; gap:12px; padding:9px 0; color:#cbd4df; border-bottom:1px solid rgba(255,255,255,.045); }
.finance-row.total { font-size:16px; font-weight:760; color:#fff; }
.finance-row.profit { color:#8be2b9; font-size:16px; font-weight:760; }

.timer-box { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; border-radius:18px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.06); }
.timer-value { font-size:24px; font-weight:760; font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.timer-caption { color:var(--muted); font-size:11px; margin-top:4px; }

.empty { padding:36px 18px; text-align:center; color:var(--muted); }
.toast-region { position:fixed; right:18px; bottom:18px; z-index:150; display:flex; flex-direction:column; gap:8px; }
.toast { padding:12px 14px; border-radius:16px; background:rgba(18,24,34,.92); border:1px solid var(--stroke); box-shadow:var(--shadow); backdrop-filter:blur(20px); font-size:13px; animation:toastIn .2s ease; }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.mobile-nav { display:none; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns:220px 1fr; }
  .kpi-grid { grid-template-columns:repeat(2,1fr); }
  .card-grid { grid-template-columns:repeat(2,1fr); }
  .dashboard-grid, .detail-grid { grid-template-columns:1fr; }
  .finance-box { position:static; }
}

@media (max-width: 860px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .app-shell { display:block; padding:10px; }
  .sidebar { position:fixed; left:10px; top:10px; bottom:10px; height:auto; width:min(300px, calc(100vw - 20px)); transform:translateX(-115%); transition:.25s ease; z-index:90; }
  .sidebar.open { transform:none; }
  .main-area { width:100%; }
  .topbar { top:10px; height:62px; border-radius:20px; }
  .mobile-only { display:grid; }
  .top-actions .icon-button:nth-child(2) { display:none; }
  .primary-action { padding:10px 12px; }
  .top-search::placeholder { color:transparent; }
  .page { padding-top:16px; padding-bottom:100px; }
  .page-head { align-items:flex-start; flex-direction:column; }
  .page-actions { width:100%; }
  .page-actions > * { flex:1; }
  .dashboard-grid { grid-template-columns:1fr; }
  .card-grid { grid-template-columns:1fr; }
  .mobile-nav {
    position:fixed; left:10px; right:10px; bottom:10px; z-index:80; height:68px;
    border-radius:22px; display:grid; grid-template-columns:repeat(5,1fr); padding:6px;
    padding-bottom:calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav button { border:0; background:transparent; color:var(--muted); border-radius:14px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-size:10px; }
  .mobile-nav button .nav-icon { font-size:17px; }
  .mobile-nav button.active { color:#fff; background:rgba(255,255,255,.055); }
  .timeline-row { grid-template-columns:58px 1fr; }
  .timeline-row .status { grid-column:2; justify-self:start; }
  .form-grid { grid-template-columns:1fr; }
  .form-group.full { grid-column:auto; }
  .detail-hero { flex-direction:column; }
}

@media (max-width: 560px) {
  .app-shell { padding:8px; }
  .topbar { top:8px; padding:8px; gap:7px; }
  .top-actions { gap:6px; }
  .top-actions .icon-button:first-child { display:none; }
  .kpi-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .kpi-card { min-height:112px; padding:14px; }
  .kpi-value { font-size:23px; }
  .panel { padding:14px; }
  .page-head h1 { font-size:28px; }
  .quick-menu { grid-template-columns:1fr; }
  .modal { padding:16px; border-radius:22px; }
  .toast-region { left:12px; right:12px; bottom:88px; }
}

/* v0.2 CRM interactions */
.clickable, .clickable-row { cursor:pointer; }
.clickable-row:hover td { background:rgba(120,183,255,.035); }
.readonly-field {
  width:100%; border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.028); color:#d7e0ec;
  border-radius:14px; padding:11px 12px;
}
.optional { color:var(--muted); font-size:10px; font-weight:500; margin-left:4px; }
.stock-qty { display:inline-flex; min-width:34px; justify-content:center; padding:5px 9px; border-radius:999px; background:rgba(120,183,255,.09); border:1px solid rgba(120,183,255,.14); font-weight:700; }
.master-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.master-card { border-radius:20px; padding:16px; }
.master-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.salary-stat strong { color:#8be2b9; }

@media (max-width: 1180px) {
  .master-grid { grid-template-columns:1fr; }
}

@media (max-width: 560px) {
  .topbar .primary-action, .page-head .primary-action { font-size:0; width:42px; height:42px; padding:0; border-radius:14px; flex:0 0 42px; }
  .topbar .primary-action::after, .page-head .primary-action::after { content:"+"; font-size:24px; }
  .modal .primary-action { width:auto; height:auto; font-size:13px; padding:10px 12px; }
  .modal .primary-action::after { content:none; }
}

/* v0.3 CRM extensions */
.status.completed { color:#b8f5d7; background:rgba(99,214,159,.10); border-color:rgba(99,214,159,.24); }
.table-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.accent-row-action { color:#8fc8ff; }
.danger-row-action { color:#ff9fa8; }
.row-action:disabled { opacity:.4; cursor:not-allowed; background:transparent; }
.empty-stock { color:#ffb1b8; background:rgba(255,123,134,.08); border-color:rgba(255,123,134,.16); }
.source-badge { display:inline-flex; padding:5px 8px; border-radius:999px; font-size:10px; color:#cbd4df; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.07); }
.source-badge.stock { color:#8fd4ff; background:rgba(120,183,255,.08); border-color:rgba(120,183,255,.16); }
.hero-status-wrap { display:flex; flex-direction:column; gap:8px; align-items:flex-end; }
.section-tabs { display:inline-flex; gap:6px; border-radius:18px; padding:6px; margin:0 4px 14px; }
.section-tab { border:0; background:transparent; color:var(--muted); padding:10px 14px; border-radius:13px; cursor:pointer; display:flex; gap:8px; align-items:center; }
.section-tab span { display:inline-flex; min-width:22px; height:22px; align-items:center; justify-content:center; border-radius:999px; background:rgba(255,255,255,.055); font-size:10px; }
.section-tab.active { color:#fff; background:rgba(120,183,255,.10); box-shadow:inset 0 1px 0 rgba(255,255,255,.06); }
.client-cars-grid { grid-template-columns:1fr !important; margin-top:14px; }
.car-card { cursor:default; display:flex; align-items:center; justify-content:space-between; gap:14px; }
.car-card:hover { transform:none; }
.car-card-main { min-width:0; }
.car-card-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.period-panel { border-radius:22px; padding:16px 18px; display:grid; grid-template-columns:minmax(220px,.7fr) minmax(420px,1.3fr); gap:16px; align-items:center; }
.period-controls { display:flex; flex-direction:column; gap:10px; }
.period-dates { display:grid; grid-template-columns:1fr 1fr auto; gap:8px; align-items:end; }
.period-dates label { color:var(--muted); font-size:11px; display:flex; flex-direction:column; gap:5px; }
.period-presets { display:flex; gap:6px; flex-wrap:wrap; }
.period-chip { border:1px solid rgba(255,255,255,.075); background:rgba(255,255,255,.035); color:#c8d2df; padding:7px 10px; border-radius:999px; cursor:pointer; font-size:11px; }
.period-chip:hover { background:rgba(120,183,255,.08); border-color:rgba(120,183,255,.16); color:#fff; }
.salary-work-list { margin-top:12px; padding-top:10px; border-top:1px solid rgba(255,255,255,.055); display:flex; flex-direction:column; gap:7px; }
.salary-work-row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:11px; color:var(--muted); }
.salary-work-row strong { color:#cfe1f8; white-space:nowrap; }
.salary-empty { margin-top:12px; padding-top:10px; border-top:1px solid rgba(255,255,255,.055); color:var(--muted); font-size:11px; }

@media (max-width: 900px) {
  .period-panel { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .period-dates { grid-template-columns:1fr 1fr; }
  .period-dates .primary-action { grid-column:1/-1; width:100%; font-size:13px; height:auto; padding:10px 12px; }
  .period-dates .primary-action::after { content:none; }
  .car-card { align-items:flex-start; flex-direction:column; }
  .car-card-actions { width:100%; justify-content:flex-start; }
  .hero-status-wrap { align-items:flex-start; }
}


/* v0.4: internal notes and cancelled states */
.internal-comment-preview { max-width:260px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--text-secondary); }
.internal-comment-preview.empty-comment { color:var(--text-tertiary); opacity:.65; }
.internal-note { margin-top:18px; padding:14px 16px; border:1px solid rgba(255,255,255,.08); border-radius:16px; background:rgba(255,255,255,.035); }
.cancelled-row { background:rgba(255,123,134,.025); }
.cancelled-row:hover { background:rgba(255,123,134,.055) !important; }
.cancelled-finance-row { color:#ff9fa8; }
@media (max-width: 760px) { .internal-comment-preview { max-width:180px; } }

/* v0.5: inline client + vehicle creation */
.client-mode-switch { display:flex; gap:7px; flex-wrap:wrap; padding:5px; border:1px solid rgba(255,255,255,.075); border-radius:14px; background:rgba(255,255,255,.025); }
.client-mode-btn { border:0; border-radius:11px; padding:9px 12px; background:transparent; color:var(--muted); cursor:pointer; font:inherit; font-size:12px; transition:.18s ease; }
.client-mode-btn:hover:not(:disabled) { color:#fff; background:rgba(255,255,255,.045); }
.client-mode-btn.active { color:#fff; background:rgba(120,183,255,.12); box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 8px 24px rgba(0,0,0,.12); }
.client-mode-btn:disabled { opacity:.35; cursor:not-allowed; }
.form-subsection { grid-column:1/-1; padding:14px; border:1px solid rgba(255,255,255,.065); border-radius:16px; background:rgba(255,255,255,.025); }
.nested-form-grid { margin:0; }
.form-section-title { margin:2px 0 10px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#b8c5d6; }
.form-section-title:not(:first-child) { margin-top:16px; padding-top:14px; border-top:1px solid rgba(255,255,255,.055); }

/* v0.7: client PDF documents */
.pdf-action {
  border:1px solid rgba(126,191,255,.24);
  background:linear-gradient(135deg,rgba(112,181,255,.18),rgba(112,181,255,.07));
  color:#dcedff; border-radius:14px; padding:10px 14px; cursor:pointer; font:inherit; font-size:13px; font-weight:700;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10),0 10px 28px rgba(31,101,173,.10);
}
.pdf-action:hover { border-color:rgba(142,203,255,.42); background:linear-gradient(135deg,rgba(112,181,255,.25),rgba(112,181,255,.10)); }
.settings-company-panel { max-width:920px; }
.settings-actions { display:flex; justify-content:flex-end; margin-top:16px; }
@media (max-width:560px) {
  .page-head .pdf-action { width:auto; height:42px; padding:0 13px; flex:0 0 auto; }
  .settings-actions .primary-action { width:100%; height:auto; font-size:13px; padding:10px 12px; }
  .settings-actions .primary-action::after { content:none; }
}


/* v0.8: password gate */
.auth-gate {
  position:fixed; inset:0; z-index:10000; display:grid; place-items:center; padding:24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(88,154,255,.17), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(91,230,208,.10), transparent 32%),
    #090b10;
}
.auth-gate.hidden { display:none; }
.auth-locked { overflow:hidden; }
.auth-locked .app-shell, .auth-locked .modal-backdrop, .auth-locked .toast-region {
  visibility:hidden; pointer-events:none; user-select:none;
}
.auth-card {
  width:min(440px,100%); border-radius:30px; padding:32px; position:relative; overflow:hidden;
  box-shadow:0 34px 90px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.09);
}
.auth-card::before {
  content:""; position:absolute; width:260px; height:260px; border-radius:50%; right:-130px; top:-145px;
  background:radial-gradient(circle, rgba(116,187,255,.21), transparent 68%); pointer-events:none;
}
.auth-mark {
  width:58px; height:58px; border-radius:19px; display:grid; place-items:center; font-size:22px; font-weight:800; color:#06101f;
  background:linear-gradient(145deg,rgba(169,214,255,.98),rgba(103,122,255,.82));
  box-shadow:0 12px 38px rgba(86,148,255,.28), inset 0 1px 0 rgba(255,255,255,.55);
}
.auth-copy { margin-top:24px; }
.auth-copy h1 { margin:0; font-size:30px; letter-spacing:-.035em; }
.auth-copy p { margin:8px 0 0; color:var(--muted); font-size:14px; }
.auth-form { margin-top:26px; display:flex; flex-direction:column; gap:10px; }
.auth-form > label { color:#c6d0dd; font-size:12px; font-weight:650; }
.auth-password-wrap { position:relative; }
.auth-password { height:50px; padding-right:94px; font-size:15px; }
.auth-toggle {
  position:absolute; right:7px; top:7px; height:36px; border:0; border-radius:11px; padding:0 10px; cursor:pointer;
  background:rgba(255,255,255,.055); color:#b9c7d8; font:inherit; font-size:11px;
}
.auth-toggle:hover { background:rgba(255,255,255,.09); color:#fff; }
.auth-error { color:#ff9fa8; font-size:12px; padding:2px 2px 0; }
.auth-submit { width:100%; margin-top:6px; min-height:48px; font-size:14px; }
.auth-submit:disabled { opacity:.65; cursor:wait; transform:none; }
@media (max-width:560px) {
  .auth-gate { padding:14px; }
  .auth-card { padding:24px; border-radius:26px; }
  .auth-copy h1 { font-size:27px; }
}

.logout-button{
  width:100%;margin-top:10px;padding:10px 12px;border-radius:14px;border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.035);color:var(--muted);font:inherit;cursor:pointer;transition:.2s ease;
}
.logout-button:hover{color:#fff;background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.14)}
.danger-panel{border-color:rgba(255,88,92,.14)}
.danger-action{color:#ff8c90!important;border-color:rgba(255,88,92,.22)!important;background:rgba(255,88,92,.07)!important}
.danger-action:hover{background:rgba(255,88,92,.12)!important}

/* v1.1: multi-tenant account & service settings */
.auth-login { height:50px; font-size:15px; }
/* v1.2 platform administration, using the existing glass palette */
.platform-eyebrow { color:var(--accent); font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; margin-bottom:8px; }
.platform-nav-note { color:var(--muted); font-size:12px; line-height:1.8; padding:22px 12px; }
.platform-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
.platform-toolbar { display:flex; align-items:center; gap:16px; margin:22px 0 16px; flex-wrap:wrap; }
.platform-toolbar label { display:flex; align-items:center; gap:12px; font-size:13px; }
.platform-toolbar .input { width:auto; }
.platform-toolbar > button { margin-left:auto; }
.platform-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.platform-card { display:flex; flex-direction:column; }
.platform-card-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.platform-service-mark { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; color:var(--accent); background:rgba(120,183,255,.09); border:1px solid rgba(120,183,255,.18); font-weight:700; }
.platform-card h2 { font-size:20px; margin:20px 0 5px; overflow-wrap:anywhere; }
.platform-login { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.platform-contact { font-size:12px; margin:22px 0; }
.platform-contact > div { display:grid; grid-template-columns:80px minmax(0,1fr); gap:8px; padding:7px 0; }
.platform-contact dt { color:var(--muted); }
.platform-contact dd { margin:0; overflow-wrap:anywhere; }
.platform-card > button { margin-top:auto; width:100%; display:flex; justify-content:space-between; }
.platform-pagination { display:flex; align-items:center; justify-content:center; gap:18px; margin-top:24px; font-size:13px; }
.platform-empty { grid-column:1/-1; text-align:center; padding:40px; }
.platform-back { margin-bottom:18px; }
.platform-detail { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr); gap:18px; align-items:start; }
.platform-detail h2 { font-size:18px; margin:0 0 20px; }
.platform-detail p { font-size:13px; line-height:1.65; }
.platform-detail-aside { display:grid; gap:18px; }
.platform-detail-aside button { width:100%; margin-top:15px; }
.platform-record { padding:0 10px; font-size:12px; }
.platform-error { color:var(--danger); font-size:13px; }
.platform-mode .page-head h1 { overflow-wrap:anywhere; }
.platform-mode .page-head > div { min-width:0; }
.platform-mode .mobile-nav { grid-template-columns:repeat(3,1fr); }
button:disabled { cursor:default; opacity:.5; transform:none!important; }
@media(max-width:1180px) { .platform-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } .platform-detail { grid-template-columns:1fr; } }
@media(max-width:560px) {
  .platform-cards { grid-template-columns:1fr; }
  .platform-stats { gap:7px; }
  .platform-stats .kpi-card { padding:12px; min-height:95px; }
  .platform-stats .kpi-label { font-size:10px; }
  .platform-mode .page-head .primary-action { font-size:13px; width:auto; height:auto; flex:auto; }
  .platform-mode .page-head .primary-action::after { content:none; }
  .platform-detail .modal-actions { flex-wrap:wrap; }
  .platform-toolbar { gap:10px; }
  .platform-mode .top-search::placeholder { color:transparent; }
}
.settings-account-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.settings-mini-card { padding:15px 16px; border-radius:17px; display:flex; flex-direction:column; gap:7px; min-width:0; }
.settings-mini-card span { color:var(--muted); font-size:11px; }
.settings-mini-card strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.settings-master-list { display:flex; flex-direction:column; gap:9px; margin-top:14px; }
.settings-master-row { display:flex; align-items:center; justify-content:space-between; gap:14px; border-radius:17px; padding:14px 15px; }
.settings-master-row > div:first-child { display:flex; flex-direction:column; gap:4px; min-width:0; }
.settings-master-row strong { font-size:14px; }
.settings-master-row span { color:var(--muted); font-size:12px; }
.settings-master-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width:720px) {
  .settings-account-grid { grid-template-columns:1fr; }
  .settings-master-row { align-items:flex-start; flex-direction:column; }
  .settings-master-actions { width:100%; justify-content:flex-start; }
}
:root { color-scheme: dark; }
.booking-public { max-width: 760px; margin: 32px auto; padding: 16px; }
.booking-public .panel { padding: 28px; }
.booking-public h1 { margin-top: 20px; }
.booking-public p { line-height: 1.6; }
.booking-muted { opacity: .7; overflow-wrap: anywhere; }
.booking-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.booking-consent { display: flex; gap: 10px; align-items: center; }
.booking-consent input { flex-shrink: 0; }
.booking-settings { margin-top: 20px; }
.booking-request-list { display: grid; gap: 16px; margin: 16px 0; }
.booking-request-list .panel { padding: 24px; overflow-wrap: anywhere; }
.booking-comment { white-space: pre-wrap; }
.booking-confirm { margin-top: 20px; }
.booking-confirm form { margin-top: 16px; }
.booking-filters { margin-top: 20px; }
details > summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
@media(max-width:600px){ .booking-public{margin:0 auto;padding:12px;} .booking-public .panel{padding:20px;} .booking-public .form-grid{grid-template-columns:1fr;} }
.activity-metrics { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0; }
.activity-metric { padding:14px;border-radius:14px;display:flex;flex-direction:column;gap:8px; }
.activity-metric span { color:var(--muted);font-size:12px; }
.activity-metric strong { font-size:24px; }
.activity-section { margin-top:18px; }
#activitySearch { display:flex;gap:8px;flex-wrap:wrap; }
@media(max-width:600px){.activity-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}}

.mechanic-mode .mobile-nav { grid-template-columns:repeat(3,1fr); }
.mechanic-mode .form-grid input[type=number] { min-width:0; }
.mechanic-mode .page-actions { display:flex;flex-wrap:wrap;gap:10px; }

.period-filter { display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:14px;margin:14px 0; }
.period-filter label { display:flex;align-items:center;gap:8px; }
.period-filter input { width:160px; }
.mechanic-mode .mobile-nav { grid-template-columns:repeat(4,1fr); }
@media(max-width:600px){.period-filter label{flex:1;}.period-filter input{width:100%;min-width:0;}}
