:root {
      color-scheme: dark;
      --bg: #090c11;
      --panel: #11161e;
      --panel-2: #151c26;
      --line: #222c39;
      --text: #f3f6fb;
      --muted: #8995a5;
      --blue: #2585ff;
      --blue-soft: #102b4d;
      --green: #39ce8c;
      --yellow: #f7bd4b;
      --red: #ff626b;
      --purple: #b58aff;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-synthesis: none;
    }
    * { box-sizing: border-box; }
    body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
    button, input, select, textarea { font: inherit; }
    button { color: inherit; }
    .app { display: flex; min-height: 100vh; }
    .sidebar { width: 250px; flex: 0 0 250px; padding: 26px 15px 20px; border-right: 1px solid var(--line); background: #0c1016; display: flex; flex-direction: column; }
    .brand { display: flex; align-items: center; gap: 12px; padding: 0 11px 29px; }
    .brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: white; font-size: 15px; font-weight: 900; font-style: italic; background: linear-gradient(145deg, #3898ff, #0750bf); box-shadow: 0 8px 22px #0873ff38; }
    .brand-name { font-size: 14px; font-weight: 850; letter-spacing: .075em; }
    .brand-sub { margin-top: 3px; color: var(--blue); font-size: 9px; letter-spacing: .21em; font-weight: 800; }
    .nav-label { padding: 10px 12px 9px; color: #647082; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
    .nav { display: grid; gap: 5px; }
    .nav-btn { width: 100%; padding: 11px 12px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #9aa5b4; cursor: pointer; transition: .18s ease; font-size: 13px; }
    .nav-btn:hover { background: #141b25; color: var(--text); }
    .nav-btn.active { color: #fff; background: linear-gradient(100deg, #0d3767, #12253c); border-color: #1d5ca0; box-shadow: inset 3px 0 var(--blue); }
    .nav-btn.active .icon { color: #52a0ff; }
    .icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .nav-count { margin-left: auto; padding: 2px 7px; color: #ff9a9f; background: #462027; border-radius: 20px; font-size: 10px; font-weight: 700; }
    .sidebar-bottom { margin-top: auto; padding: 14px 10px 0; }
    .shop-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #111720; }
    .shop-card strong { display: block; font-size: 12px; }
    .shop-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
    .online-dot { display: inline-block !important; width: 7px; height: 7px; margin: 0 5px 0 0 !important; border-radius: 50%; background: var(--green); }
    .main { min-width: 0; flex: 1; }
    .topbar { height: 76px; padding: 0 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: #0b0f15; }
    .crumb { color: var(--muted); font-size: 12px; }
    .crumb b { color: var(--text); font-weight: 650; }
    .top-actions { display: flex; align-items: center; gap: 15px; }
    .search { position: relative; }
    .search .icon { position: absolute; top: 10px; left: 12px; color: #788494; width: 16px; height: 16px; }
    .search input { width: 220px; height: 37px; padding: 0 13px 0 37px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #111720; color: var(--text); font-size: 12px; }
    .search input:focus, .field input:focus, .field select:focus, .field textarea:focus, .ai-input:focus { border-color: #398cff; box-shadow: 0 0 0 3px #2585ff20; }
    .icon-button { width: 37px; height: 37px; display: grid; place-items: center; position: relative; border: 1px solid var(--line); border-radius: 10px; background: #111720; color: #aeb8c6; cursor: pointer; }
    .icon-button:hover { color: white; border-color: #405168; }
    .notification-dot { position: absolute; width: 7px; height: 7px; top: 7px; right: 7px; background: var(--blue); border: 1px solid #111720; border-radius: 50%; }
    .profile { display: flex; align-items: center; gap: 9px; }
    .avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #b9d8ff; background: #193456; font-size: 11px; font-weight: 800; }
    .profile-name { font-size: 12px; font-weight: 700; }
    .profile-role { margin-top: 3px; color: var(--muted); font-size: 10px; }
    .content { width: min(1220px, 100%); margin: 0 auto; padding: 31px 34px 50px; }
    .page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
    .eyebrow { margin-bottom: 8px; color: #569eff; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
    h1 { margin: 0; font-size: clamp(24px, 3vw, 30px); letter-spacing: -.04em; }
    .subtitle { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
    .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: #151c26; color: #e7edf5; font-size: 12px; font-weight: 700; cursor: pointer; transition: .18s ease; white-space: nowrap; }
    .btn:hover { border-color: #49627c; background: #1a2532; }
    .btn-primary { border-color: #267be1; background: linear-gradient(120deg, #1675eb, #0756bf); color: white; box-shadow: 0 7px 18px #0869e22b; }
    .btn-primary:hover { background: #2788ff; border-color: #58a1ff; }
    .btn .icon { width: 15px; height: 15px; }
    .grid { display: grid; gap: 16px; }
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 19px; }
    .stat-card, .panel, .list-card, .record-card { border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #121821, #0f141b); }
    .stat-card { min-height: 127px; padding: 17px 18px; position: relative; overflow: hidden; }
    .stat-top { display: flex; justify-content: space-between; align-items: center; }
    .stat-label { color: #9aa5b4; font-size: 11px; font-weight: 650; }
    .stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #61a7ff; background: #102d50; }
    .stat-icon .icon { width: 16px; height: 16px; }
    .stat-card.warn .stat-icon { color: var(--yellow); background: #3a2b11; }
    .stat-card.good .stat-icon { color: var(--green); background: #103424; }
    .stat-card.danger .stat-icon { color: var(--red); background: #3d1c22; }
    .stat-number { margin-top: 11px; font-size: 29px; font-weight: 780; letter-spacing: -.05em; }
    .stat-foot { margin-top: 3px; color: #758193; font-size: 10px; }
    .stat-foot em { color: var(--green); font-style: normal; }
    .overview-grid { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); align-items: start; }
    .panel { padding: 19px; }
    .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
    .panel-title { margin: 0; font-size: 14px; font-weight: 750; }
    .panel-note { color: var(--muted); font-size: 10px; }
    .text-link { padding: 0; border: 0; background: transparent; color: #62a5ff; font-size: 11px; font-weight: 700; cursor: pointer; }
    .work-list { display: grid; gap: 9px; }
    .work-row { display: grid; grid-template-columns: 39px minmax(120px, 1fr) minmax(110px, .75fr) auto; align-items: center; gap: 12px; padding: 11px; border: 1px solid #202a36; border-radius: 10px; background: #111720; }
    .car-thumb { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; background: #14283f; color: #63a8ff; }
    .car-thumb .icon { width: 21px; height: 21px; }
    .row-title { font-size: 12px; font-weight: 700; }
    .row-sub { margin-top: 4px; color: var(--muted); font-size: 10px; }
    .row-task { color: #c3ccd8; font-size: 11px; }
    .row-task small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
    .status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid transparent; border-radius: 20px; font-size: 9px; font-weight: 750; white-space: nowrap; }
    .status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
    .status.blue { color: #67adff; background: #102946; border-color: #1a426d; }
    .status.yellow { color: #ffd06a; background: #34280f; border-color: #564216; }
    .status.orange { color: #ffad68; background: #382315; border-color: #61381c; }
    .status.purple { color: #c2a0ff; background: #2a1e40; border-color: #49326e; }
    .status.green { color: #56dfa2; background: #102c20; border-color: #1c5036; }
    .status.red { color: #ff8389; background: #371c22; border-color: #60272e; }
    .side-stack { display: grid; gap: 16px; }
    .urgent-item, .appointment { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-top: 1px solid #202a36; }
    .urgent-item:first-of-type, .appointment:first-of-type { border-top: 0; padding-top: 0; }
    .priority-mark { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px #ff626b65; }
    .urgent-copy, .appt-copy { flex: 1; min-width: 0; }
    .urgent-copy strong, .appt-copy strong { display: block; font-size: 11px; }
    .urgent-copy span, .appt-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
    .time { color: #a8b4c3; font-size: 10px; white-space: nowrap; }
    .date-tile { width: 38px; height: 41px; flex: 0 0 auto; display: grid; place-content: center; text-align: center; border-radius: 8px; background: #102b4d; color: #77b5ff; }
    .date-tile b { font-size: 13px; }
    .date-tile small { font-size: 8px; text-transform: uppercase; }
    .money-card { padding: 16px; border: 1px solid #23466c; border-radius: 11px; background: linear-gradient(120deg, #10243a, #101a26); }
    .money-card span { color: #a6b5c8; font-size: 10px; }
    .money-card strong { display: block; margin-top: 7px; font-size: 23px; letter-spacing: -.04em; }
    .money-card small { display: block; margin-top: 5px; color: #65a8ff; font-size: 10px; }
    .two-col { grid-template-columns: 1fr 1fr; }
    .record-list { display: grid; gap: 10px; }
    .record-card { padding: 15px; display: flex; align-items: center; gap: 14px; }
    .record-main { flex: 1; min-width: 0; }
    .record-title { font-size: 13px; font-weight: 720; }
    .record-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
    .record-actions { display: flex; align-items: center; gap: 9px; }
    .record-actions select { max-width: 175px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #111720; color: #dce5ef; font-size: 10px; }
    .detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 13px; }
    .detail { padding: 10px; border-radius: 8px; background: #0d1219; }
    .detail span { display: block; color: var(--muted); font-size: 9px; }
    .detail b { display: block; margin-top: 5px; font-size: 11px; font-weight: 650; }
    .filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
    .filter-chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 18px; background: #111720; color: #a7b2c1; font-size: 10px; cursor: pointer; }
    .filter-chip.selected { border-color: #2a72c2; background: #102a47; color: #82baff; }
    .empty { padding: 40px 20px; text-align: center; border: 1px dashed #293545; border-radius: 12px; color: var(--muted); font-size: 12px; }
    .timeline { position: relative; margin-left: 9px; padding-left: 25px; border-left: 1px solid #2b3c50; }
    .timeline-item { position: relative; padding: 0 0 22px; }
    .timeline-item::before { content: ""; position: absolute; left: -30px; top: 3px; width: 9px; height: 9px; border: 2px solid #0e151e; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
    .timeline-item b { font-size: 12px; }
    .timeline-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
    .ai-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 16px; align-items: start; }
    .ai-chat { min-height: 340px; display: flex; flex-direction: column; }
    .chat-messages { display: grid; gap: 13px; flex: 1; align-content: start; }
    .message { max-width: 84%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; background: #171f2a; color: #d7e0eb; font-size: 12px; line-height: 1.6; }
    .message.user { justify-self: end; border-color: #236bc2; border-radius: 12px 12px 3px 12px; background: #10335a; }
    .message.ai { display: flex; gap: 9px; align-items: flex-start; }
    .ai-avatar { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: #1264c2; color: white; font-size: 11px; font-weight: 800; }
    .ai-input-row { display: flex; gap: 8px; margin-top: 20px; }
    .ai-input { min-width: 0; flex: 1; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #0d1219; color: var(--text); font-size: 12px; }
    .disclaimer { margin: 13px 0 0; color: #788595; font-size: 10px; line-height: 1.5; }
    .suggestions { display: grid; gap: 8px; }
    .suggestion { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #0f151d; color: #b9c5d3; text-align: left; font-size: 11px; cursor: pointer; }
    .suggestion:hover { border-color: #377ecb; color: white; }
    .reminder { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
    .reminder:first-child { padding-top: 0; border-top: 0; }
    .check { width: 18px; height: 18px; flex: 0 0 auto; border: 1px solid #3c4a5b; border-radius: 5px; background: #101720; cursor: pointer; }
    .check.done { border-color: #2585ff; background: #1675eb; }
    .check.done::after { content: "✓"; display: block; color: white; text-align: center; font-size: 12px; line-height: 16px; }
    .reminder-copy { flex: 1; }
    .reminder-copy b { display: block; font-size: 12px; }
    .reminder-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
    .reminder.done + .reminder { opacity: .65; }
    .modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 18px; background: #030609c9; backdrop-filter: blur(5px); }
    .modal { width: min(520px, 100%); max-height: min(90vh, 760px); overflow: auto; padding: 22px; border: 1px solid #2c3949; border-radius: 15px; background: #111720; box-shadow: 0 25px 90px #000b; }
    .modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
    .modal-head h2 { margin: 0; font-size: 19px; }
    .modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
    .close { border: 0; background: transparent; color: #a7b1be; font-size: 22px; cursor: pointer; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
    .field { display: grid; gap: 6px; }
    .field.full { grid-column: 1 / -1; }
    .field label { color: #a9b5c4; font-size: 10px; font-weight: 650; }
    .field input, .field select, .field textarea { width: 100%; padding: 10px 11px; outline: none; border: 1px solid #293545; border-radius: 8px; background: #0b1017; color: var(--text); font-size: 12px; }
    .field textarea { min-height: 75px; resize: vertical; }
    .form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
    .toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; padding: 12px 16px; border: 1px solid #2b7451; border-radius: 10px; background: #10291e; color: #b9f4d8; font-size: 12px; box-shadow: 0 8px 26px #0007; animation: appear .2s ease-out; }
    @keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
    .demo-banner, .error-banner { margin-bottom: 16px; padding: 11px 13px; border: 1px solid #655021; border-radius: 9px; background: #2b2312; color: #f0d48e; font-size: 11px; line-height: 1.5; }
    .error-banner { border-color: #71343b; background: #301a20; color: #ffc0c3; }
    .logout { border: 0; background: transparent; color: #8492a3; font-size: 10px; cursor: pointer; }
    .logout:hover { color: white; }
    #authRoot:empty { display: none; }
    .auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at 50% 25%, #102847 0, #090c11 52%); }
    .auth-card { width: min(440px, 100%); padding: 27px; border: 1px solid #263648; border-radius: 16px; background: #111720; box-shadow: 0 25px 80px #0008; }
    .auth-brand { margin-bottom: 25px; display: flex; align-items: center; gap: 12px; }
    .auth-card h1 { font-size: 23px; }
    .auth-error { display: none; margin: 14px 0; padding: 10px; border-radius: 8px; background: #3a1c22; color: #ffb6bc; font-size: 11px; }
    .auth-help { margin-top: 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
    .auth-switch { width: 100%; margin-top: 15px; border: 0; background: transparent; color: #70adff; font-size: 11px; cursor: pointer; }
    .record-actions .btn { font-size: 10px; }
    .mobile-nav { display: none; }
    @media (max-width: 1050px) {
      .sidebar { width: 220px; flex-basis: 220px; }
      .content { padding-inline: 24px; }
      .topbar { padding-inline: 24px; }
      .stats { grid-template-columns: repeat(2, 1fr); }
      .overview-grid { grid-template-columns: 1fr; }
      .side-stack { grid-template-columns: 1fr 1fr; }
    }
    @media (max-width: 700px) {
      .sidebar { display: none; }
      .topbar { height: 62px; padding: 0 16px; }
      .crumb { display: none; }
      .top-actions { width: 100%; gap: 9px; }
      .search { flex: 1; }
      .search input { width: 100%; }
      .profile-copy { display: none; }
      .profile { margin-left: auto; }
      .content { padding: 23px 15px 95px; }
      .page-heading { margin-bottom: 19px; }
      .page-heading .btn { min-height: 36px; padding-inline: 10px; font-size: 10px; }
      .subtitle { font-size: 11px; line-height: 1.5; }
      .stats { gap: 10px; }
      .stat-card { min-height: 113px; padding: 13px; }
      .stat-label { max-width: 90px; font-size: 10px; line-height: 1.4; }
      .stat-number { font-size: 25px; }
      .overview-grid, .side-stack, .ai-layout, .two-col { grid-template-columns: 1fr; }
      .work-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; padding: 9px; }
      .car-thumb { width: 34px; height: 34px; }
      .row-task { display: none; }
      .row-title { font-size: 10px; }
      .row-sub { font-size: 9px; }
      .status { padding: 5px 6px; font-size: 8px; }
      .panel { padding: 15px; }
      .record-card { align-items: flex-start; padding: 12px; }
      .record-actions { align-items: flex-end; flex-direction: column; }
      .record-actions select { max-width: 145px; }
      .detail-grid { grid-template-columns: repeat(2, 1fr); }
      .mobile-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; padding: 8px 6px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid #252e3b; background: #0c1118f5; backdrop-filter: blur(14px); }
      .mobile-nav button { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 4px; padding: 3px 1px; border: 0; background: transparent; color: #7f8b9b; font-size: 8px; cursor: pointer; }
      .mobile-nav button .icon { width: 19px; height: 19px; }
      .mobile-nav button.active { color: #4a9aff; }
      .toast { right: 12px; bottom: 76px; left: 12px; text-align: center; }
    }
    @media (max-width: 390px) {
      .page-heading { align-items: flex-end; }
      .page-heading .btn { font-size: 0; }
      .page-heading .btn .icon { width: 17px; height: 17px; }
      .form-grid { grid-template-columns: 1fr; }
      .field.full { grid-column: auto; }
      .record-title { font-size: 11px; }
    }