:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --line: #dfe6ec;
  --text: #172534;
  --muted: #6c7c8c;
  --blue: #1686d9;
  --blue-dark: #0873bd;
  --blue-soft: #eaf5fd;
  --green: #16865c;
  --green-soft: #e9f7f1;
  --amber: #b76809;
  --amber-soft: #fff4df;
  --red: #c4414c;
  --red-soft: #fdecef;
  --surface-soft: #f8fafc;
  --surface-hover: #fbfdff;
  --field-bg: #ffffff;
  --sidebar: #102536;
  --sidebar-active: #1b3c54;
  --row-line: #edf1f4;
  --shadow: rgba(16, 37, 54, .08);
  --radius: 12px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d141b;
  --surface: #17212b;
  --line: #2d3b47;
  --text: #e7eef4;
  --muted: #9aabb8;
  --blue: #3ba4ee;
  --blue-dark: #70bdf3;
  --blue-soft: #17364d;
  --green: #61c99d;
  --green-soft: #17382d;
  --amber: #efb45e;
  --amber-soft: #3b2e18;
  --red: #f07982;
  --red-soft: #47252b;
  --surface-soft: #1c2833;
  --surface-hover: #1d2a35;
  --field-bg: #111a22;
  --sidebar: #09131b;
  --sidebar-active: #183b54;
  --row-line: #283641;
  --shadow: rgba(0, 0, 0, .3);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #0d141b;
    --surface: #17212b;
    --line: #2d3b47;
    --text: #e7eef4;
    --muted: #9aabb8;
    --blue: #3ba4ee;
    --blue-dark: #70bdf3;
    --blue-soft: #17364d;
    --green: #61c99d;
    --green-soft: #17382d;
    --amber: #efb45e;
    --amber-soft: #3b2e18;
    --red: #f07982;
    --red-soft: #47252b;
    --surface-soft: #1c2833;
    --surface-hover: #1d2a35;
    --field-bg: #111a22;
    --sidebar: #09131b;
    --sidebar-active: #183b54;
    --row-line: #283641;
    --shadow: rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.login-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: min(390px, 100%); display: grid; gap: 18px; padding: 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 20px 60px var(--shadow); }
.login-card > .brand-mark { width: 54px; height: 54px; }
.login-card p { margin-top: 5px; color: var(--muted); }
.login-card label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--field-bg); }
.login-card .form-error { margin: 0; color: var(--red); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: #dfeaf2; padding: 24px 14px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px 28px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { color: white; font-size: 15px; }
.brand small { color: #8fa5b5; margin-top: 2px; font-size: 11px; }
nav { display: grid; gap: 5px; }
.nav-item { border: 0; color: #b7c8d4; background: transparent; border-radius: 8px; padding: 11px 12px; text-align: left; cursor: pointer; font-weight: 600; }
.nav-item span { display: inline-block; width: 24px; color: #7fa4bd; }
.nav-item .nav-full, .nav-item .nav-short { width: auto; color: inherit; }
.nav-short, .add-short { display: none !important; }
.nav-item:hover, .nav-item.active { background: var(--sidebar-active); color: white; }
.nav-item.active span { color: #47b2fa; }
.sidebar-note { margin-top: auto; border-top: 1px solid #294457; padding: 18px 10px 0; display: grid; gap: 6px; }
.sidebar-note strong { color: #7dc7f8; font-size: 12px; }
.sidebar-note span { color: #8fa5b5; font-size: 11px; line-height: 1.5; }
main { min-width: 0; padding: 28px 32px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.theme-control { min-height: 39px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.theme-control select { height: 35px; padding: 0 24px 0 4px; border: 0; background: transparent; box-shadow: none; }
h1, h2, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: -0.025em; }
.topbar p { color: var(--muted); margin-top: 6px; }
.license-banner { display: flex; align-items: center; gap: 8px; margin: -8px 0 18px; padding: 11px 14px; border: 1px solid #e5b65f; border-radius: 9px; background: var(--amber-soft); color: var(--amber); }
.license-banner.expired, .license-banner.invalid { border-color: #dc8f97; background: var(--red-soft); color: var(--red); }
.license-banner .link-button { margin-left: auto; color: inherit; }
.link-button { padding: 0; border: 0; background: transparent; font-weight: 700; text-decoration: underline; cursor: pointer; }
.primary, .secondary { border-radius: 8px; min-height: 39px; padding: 0 16px; border: 1px solid transparent; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.primary { background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.secondary { background: var(--field-bg); color: var(--text); border-color: var(--line); }
.secondary:hover { background: var(--surface-soft); }
.view { display: none; }
.view.active { display: block; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; position: relative; overflow: hidden; }
.stats article::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.stats article.warning::before { background: #e49a20; }
.stats article.danger::before { background: var(--red); }
.stats span { color: var(--muted); font-size: 12px; }
.stats strong { display: block; font-size: 26px; margin-top: 7px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .import-card h2 { font-size: 16px; }
.panel-head span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.search { display: flex; align-items: center; gap: 7px; width: min(320px, 46%); padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search input { width: 100%; height: 36px; border: 0; outline: 0; background: transparent; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; background: var(--surface-soft); color: var(--muted); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
td { border-top: 1px solid var(--row-line); padding: 13px 14px; vertical-align: middle; }
tbody tr:hover { background: var(--surface-hover); }
.cell-main { display: block; font-weight: 650; line-height: 1.35; }
.cell-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.35; }
.plate { display: inline-block; border: 1px solid #aeb8bf; border-radius: 4px; padding: 3px 6px; font-size: 12px; font-weight: 750; letter-spacing: .06em; background: var(--field-bg); }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { color: var(--green); background: var(--green-soft); }
.status.blocked { color: var(--red); background: var(--red-soft); }
.status.expired { color: var(--amber); background: var(--amber-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-actions button, .icon-button { width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.row-actions button:hover, .icon-button:hover { background: var(--surface-soft); color: var(--text); }
.row-actions .delete:hover { color: var(--red); background: var(--red-soft); }
.event-actions { min-width: 132px; }
.add-event-pass { min-height: 34px; padding: 7px 10px; border: 1px solid #99c9e8; border-radius: 7px; background: var(--blue-soft); color: var(--blue-dark); font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.add-event-pass:hover { border-color: var(--blue); background: #d9effc; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty strong, .empty span { display: block; }
.empty strong { color: var(--text); margin-bottom: 6px; }
.events-preview { min-width: 0; }
.event-list { padding: 4px 17px 10px; }
.event { display: grid; grid-template-columns: 9px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--row-line); }
.event:last-child { border-bottom: 0; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.event.allowed .event-dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.event-top { display: flex; justify-content: space-between; gap: 8px; }
.event-top strong { font-size: 12px; letter-spacing: .04em; }
.event-top time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.event-content { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; }
.event p { color: var(--muted); font-size: 11px; line-height: 1.4; margin-top: 4px; }
.snapshot-button { width: 78px; height: 48px; padding: 0; border: 0; border-radius: 7px; overflow: hidden; background: var(--surface-soft); cursor: zoom-in; display: block; }
.snapshot-button.compact { width: 48px; height: 38px; }
.snapshot-button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.snapshot-button.image-error { cursor: default; position: relative; }
.snapshot-button.image-error img { display: none; }
.snapshot-button.image-error::after { content: "Нет фото"; display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 9px; }
.vehicle-cell { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; min-width: 170px; }
.vehicle-photo { width: 54px; height: 40px; flex: 0 0 auto; }
.vehicle-photo.placeholder { display: grid; place-items: center; border-radius: 7px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.no-snapshot { color: var(--muted); font-size: 11px; white-space: nowrap; }
.snapshot-dialog { width: min(920px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 12px; background: #101820; color: white; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.42); }
.snapshot-dialog::backdrop { background: rgba(5, 12, 18, .78); }
.snapshot-dialog img { width: 100%; max-height: calc(100vh - 100px); display: block; object-fit: contain; background: #080d11; }
.snapshot-caption { padding: 13px 16px; color: #d8e3ea; }
.snapshot-close { position: absolute; right: 10px; top: 10px; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0,0,0,.58); color: white; font-size: 24px; cursor: pointer; }
.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.import-card { padding: 24px; }
.import-card > p { color: var(--muted); line-height: 1.55; margin: 9px 0 20px; }
.dropzone { min-height: 150px; border: 1px dashed #9eb3c2; border-radius: 10px; background: var(--surface-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; margin-bottom: 14px; }
.dropzone:hover { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input { display: none; }
.dropzone span { color: var(--muted); font-size: 12px; margin-top: 6px; }
.export-actions { display: flex; gap: 10px; margin-bottom: 24px; }
.columns { padding-top: 18px; border-top: 1px solid var(--line); }
.columns strong, .columns span { display: block; }
.columns span { color: var(--muted); line-height: 1.6; margin-top: 7px; }
.result { margin-top: 14px; border-radius: 8px; padding: 12px; background: var(--blue-soft); color: var(--blue-dark); }
.event-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.event-stats article { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; }
.event-stats span { display: block; color: var(--muted); font-size: 11px; }
.event-stats strong { display: block; margin-top: 6px; font-size: 23px; }
.event-stats .danger strong { color: var(--red); }
.events-toolbar { display: grid; grid-template-columns: minmax(210px, 1.4fr) minmax(220px, 2fr) repeat(3, minmax(135px, .8fr)) auto; align-items: end; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.events-heading { align-self: center; }
.events-heading h2 { font-size: 16px; }
.events-heading span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.events-toolbar label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.events-toolbar input, .events-toolbar select { width: 100%; min-width: 0; }
.events-reset { white-space: nowrap; }
.audit-action { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
.audit-details { margin-top: 7px; }
.audit-details summary { color: var(--blue-dark); font-size: 11px; font-weight: 700; cursor: pointer; }
.audit-details strong { display: block; margin-top: 8px; font-size: 10px; color: var(--muted); text-transform: uppercase; }
.audit-details pre { max-width: 520px; max-height: 220px; overflow: auto; margin-top: 4px; padding: 8px; border-radius: 6px; background: var(--surface-soft); font: 10px/1.45 monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.requests-grid { grid-template-columns: minmax(320px, .75fr) minmax(0, 1fr); margin-bottom: 18px; }
.request-form-panel, .request-report-panel, .requests-list-panel { overflow: hidden; }
.request-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.request-form-fields label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.request-form-fields input, .request-form-fields select, .request-form-fields textarea { width: 100%; min-width: 0; }
.request-form-fields .wide { grid-column: 1 / -1; }
.request-date-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.request-date-shortcuts button { flex: 1 1 120px; }
.import-mini { display: grid; gap: 12px; padding: 18px; }
.requests-list-panel { margin-top: 18px; }
.request-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 150px; }
.parking-grid { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.parking-stats { margin-bottom: 18px; }
.parking-operations-panel { margin-bottom: 18px; overflow: hidden; }
.parking-operation-content { display: grid; gap: 12px; padding: 18px; }
.parking-operation-content p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.occupancy-meter { height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.occupancy-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .2s ease; }
.occupancy-meter span.warning { background: #d58a00; }
.occupancy-meter span.full { background: var(--red); }
.parking-sessions-table tr.stale-session td { background: color-mix(in srgb, var(--red-soft) 60%, transparent); }
.stale-badge { display: inline-block; margin-top: 5px; padding: 3px 6px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-size: 9px; font-weight: 750; }
.parking-total { font-size: 19px !important; color: var(--green); }
.parking-sessions-panel { margin-bottom: 24px; overflow: hidden; }
.parking-session-head { min-height: 78px; }
.parking-session-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-width: min(520px, 58%); }
.parking-session-actions .search { width: min(300px, 100%); }
.parking-session-actions .primary { white-space: nowrap; }
.parking-section-title { margin: 5px 0 14px; }
.parking-section-title h2 { font-size: 18px; }
.parking-section-title p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.ticket-code { font: 700 12px monospace; letter-spacing: .045em; white-space: nowrap; }
.ticket-link { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue-dark); background: var(--field-bg); font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ticket-link:hover { border-color: var(--blue); background: var(--blue-soft); }
.parking-session-dialog { width: min(560px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 12px; color: var(--text); background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.parking-session-dialog::backdrop { background: rgba(5, 12, 18, .62); }
.parking-session-dialog form { margin: 0; }
.parking-report-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 18px; margin-bottom: 18px; }
.parking-shift-panel, .parking-report-panel, .parking-history-panel { overflow: hidden; }
.parking-shift-content { min-height: 150px; padding: 20px; color: var(--muted); }
.shift-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shift-summary div, .parking-report-stats div { min-width: 0; padding: 12px; border-radius: 8px; background: var(--surface-soft); }
.shift-summary span, .parking-report-stats span { display: block; color: var(--muted); font-size: 10px; }
.shift-summary strong, .parking-report-stats strong { display: block; margin-top: 5px; font-size: 16px; overflow-wrap: anywhere; }
.shift-warning { margin-bottom: 12px; padding: 12px; border: 1px solid #d7a22a; border-radius: 9px; background: rgba(215, 162, 42, 0.16); color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.45; }
.parking-shift-history { padding: 0 20px 16px; }
.parking-shift-history:empty { display: none; }
.parking-shift-history h3 { margin-bottom: 9px; font-size: 12px; }
.shift-history-list { display: grid; gap: 8px; }
.shift-history-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-soft); }
.shift-history-row div { min-width: 0; }
.shift-history-row div:last-child { text-align: right; }
.shift-history-row strong, .shift-history-row span { display: block; overflow-wrap: anywhere; }
.shift-history-row strong { font-size: 11px; }
.shift-history-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.parking-report-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 16px 18px 0; }
.parking-report-filters label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.parking-report-filters input { width: 100%; min-width: 0; }
.parking-report-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px 18px; }
.payment-methods { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.payment-methods span { padding: 6px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 10px; font-weight: 700; }
.parking-report-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--line); }
.parking-history-panel { margin-bottom: 24px; }
.session-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 21px 24px; }
.session-form-fields label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.session-form-fields input, .session-form-fields select { width: 100%; min-width: 0; }
.session-form-fields textarea { width: 100%; min-width: 0; resize: vertical; }
.payment-form-fields .full-field { grid-column: 1 / -1; }
.parking-action-warning { margin: 0; padding: 12px 14px; border: 1px solid #e3a4aa; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 11px; line-height: 1.5; }
.parking-action-dialog .drawer-actions .danger-outline { min-height: 39px; }
.parking-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 150px; }
.compact-action { min-height: 32px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
.compact-action.danger { border-color: #e3a4aa; color: var(--red); background: var(--field-bg); }
.compact-action.danger:hover { background: var(--red-soft); }
.parking-history-table tbody tr { cursor: pointer; }
.parking-history-table tbody tr:hover td { background: var(--surface-soft); }
.parking-history-open { color: var(--blue-dark); font-size: 10px; font-weight: 700; }
.parking-details-dialog { width: min(820px, calc(100% - 24px)); }
.parking-details-content { max-height: min(68vh, 720px); overflow: auto; padding: 20px 24px; }
.parking-detail-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.parking-detail-photo { min-width: 0; }
.parking-detail-photo h3, .parking-detail-section h3 { margin-bottom: 8px; font-size: 12px; }
.parking-detail-photo .snapshot-button { width: 100%; height: 190px; }
.parking-detail-photo .no-snapshot { display: grid; place-items: center; height: 120px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); }
.parking-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.parking-detail-grid div { min-width: 0; padding: 11px; border-radius: 8px; background: var(--surface-soft); }
.parking-detail-grid div.payment-refund { border: 1px solid #e3a4aa; background: var(--red-soft); }
.parking-detail-grid span, .parking-detail-event span { display: block; color: var(--muted); font-size: 9px; }
.parking-detail-grid strong { display: block; margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.payment-refund-button { margin-top: 8px; width: 100%; }
.parking-detail-section { margin-top: 18px; }
.parking-detail-events { display: grid; gap: 8px; }
.parking-detail-event { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.parking-detail-event .snapshot-button { width: 76px; height: 52px; }
.parking-detail-event strong { display: block; font-size: 11px; }
.parking-detail-result { font-size: 10px; font-weight: 750; white-space: nowrap; }
.parking-detail-result.allowed { color: var(--green); }
.parking-detail-result.denied { color: var(--red); }
.tariff-editor { overflow: hidden; }
.tariff-fields { display: grid; gap: 15px; padding: 18px; }
.tariff-fields label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.tariff-fields input, .tariff-fields select { width: 100%; min-width: 0; }
.tariff-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tariff-active { color: var(--text) !important; }
.tariff-form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 18px; border-top: 1px solid var(--line); }
.tariff-list-panel { min-width: 0; overflow: hidden; }
.tariff-price { font-weight: 750; white-space: nowrap; }
.tariff-cap { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-grid > *, .settings-card, .settings-fields, .settings-fields label { min-width: 0; }
.settings-card { width: 100%; max-width: 100%; overflow: hidden; padding: 22px; }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-card-head h2 { font-size: 16px; }
.settings-card-head p, .settings-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 5px; }
.users-card, .maintenance-card, .license-card { grid-column: 1 / -1; }
.license-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(260px, .8fr); gap: 24px; align-items: end; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-field button { width: auto; }
.license-summary { display: grid; gap: 7px; padding-top: 18px; }
.license-summary strong { font-size: 14px; }
.license-summary span { color: var(--muted); font-size: 12px; }
.license-summary .restore-button { width: fit-content; margin-top: 5px; padding: 0 14px; min-height: 39px; }
.maintenance-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); gap: 24px; }
.backup-panel { min-width: 0; padding-top: 18px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.backup-actions button, .restore-button { min-height: 39px; padding: 0 14px; }
.restore-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; background: var(--field-bg); color: var(--text); font-weight: 650; cursor: pointer; }
.restore-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.restore-button input { display: none; }
.backup-list { display: grid; gap: 8px; margin-top: 16px; }
.backup-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.backup-row div { min-width: 0; }
.backup-row strong, .backup-row span { display: block; overflow: hidden; text-overflow: ellipsis; }
.backup-row span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.backup-row a { color: var(--blue-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
.checkbox-setting { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; }
.checkbox-setting input { width: 18px; height: 18px; padding: 0; }
.users-list { display: grid; gap: 10px; padding-top: 18px; }
.local-user-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 18px 0; border-bottom: 1px solid var(--line); }
.local-user-form label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.local-user-form input, .local-user-form select { width: 100%; min-width: 0; }
.user-role-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.user-role-row:last-child { border-bottom: 0; }
.user-role-row div { min-width: 0; display: grid; gap: 3px; }
.user-role-row strong, .user-role-row span { overflow: hidden; text-overflow: ellipsis; }
.user-role-row span { color: var(--muted); font-size: 11px; }
.user-role-row select { width: 100%; min-width: 0; }
.user-permissions { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px !important; padding: 12px; border-radius: 9px; background: var(--surface-soft); }
.user-permissions label { display: flex; align-items: flex-start; gap: 7px; color: var(--text); font-size: 11px; line-height: 1.35; }
.user-permissions input { margin-top: 1px; }
.user-source { display: inline-flex !important; width: fit-content; padding: 3px 6px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark) !important; font-size: 9px !important; font-weight: 700; }
.user-row-actions { display: flex !important; grid-auto-flow: column; gap: 6px !important; }
.user-row-actions button { white-space: nowrap; }
.setup-status { padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.setup-status.success { background: var(--green-soft); color: var(--green); }
.setup-status.error { background: var(--red-soft); color: var(--red); }
.settings-fields { display: grid; gap: 15px; padding-top: 18px; }
.settings-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.settings-fields input, .settings-fields select, .settings-fields button { width: 100%; max-width: 100%; min-width: 0; }
.settings-fields textarea { width: 100%; max-width: 100%; min-width: 0; resize: vertical; }
.settings-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-fields .access-point-enabled { display: flex; grid-template-columns: none; align-items: center; gap: 9px; color: var(--text); }
.settings-fields .access-point-enabled input { width: auto; max-width: none; }
.score-input { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: center; gap: 10px; }
.score-input input { padding: 0; }
.score-input output { color: var(--blue-dark); font-weight: 750; text-align: right; }
.danger-outline { min-height: 39px; padding: 0 16px; border: 1px solid #e3a4aa; border-radius: 8px; background: var(--field-bg); color: var(--red); font-weight: 700; cursor: pointer; }
.danger-outline:hover { background: var(--red-soft); }
.integration-card, .parking-settings-card { grid-column: 1 / -1; }
.integration-flow { display: flex; align-items: center; justify-content: center; gap: 13px; flex-wrap: wrap; padding: 24px 10px 13px; }
.integration-flow span { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--surface-soft); font-weight: 650; }
.integration-flow b { color: var(--blue); }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 15px; }
#settings-message { color: var(--muted); font-size: 12px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.about-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 300px); gap: 24px; align-items: center; padding: 26px; }
.about-brand { min-width: 0; display: flex; align-items: center; gap: 18px; }
.about-logo { width: 72px; height: 72px; flex: 0 0 72px; display: grid; place-items: center; border-radius: 18px; background: var(--blue); box-shadow: 0 12px 28px var(--shadow); overflow: hidden; }
.about-logo img { width: 100%; height: 100%; object-fit: cover; }
.about-eyebrow { display: block; margin-bottom: 5px; color: var(--blue-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.about-brand h2 { font-size: 25px; }
.about-brand p { max-width: 590px; margin-top: 7px; color: var(--muted); line-height: 1.5; }
.version-panel { min-width: 0; display: grid; gap: 7px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.version-panel > span:first-child { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.version-panel strong { font-size: 24px; }
.version-panel .setup-status { width: fit-content; white-space: normal; }
.version-panel small { color: var(--muted); line-height: 1.4; }
.about-card { padding: 22px; }
.about-card .settings-card-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.about-card.license-card { grid-column: auto; }
.license-modules { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.license-modules > div { display: flex; flex-wrap: wrap; gap: 7px; }
.module-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 10px; font-weight: 750; }
.module-badge.muted { background: var(--surface-soft); color: var(--muted); }
.developer-profile { display: grid; grid-template-columns: minmax(180px, .55fr) minmax(0, 1.45fr); gap: 24px; align-items: start; padding-top: 20px; }
.developer-profile > div:first-child { display: grid; gap: 3px; }
.developer-profile > div:first-child strong { font-size: 18px; }
.contact-links { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contact-links a { min-width: 0; display: grid; gap: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--text); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.contact-links a:hover { border-color: var(--blue); background: var(--blue-soft); }
.contact-links span { color: var(--muted); font-size: 10px; }
.contact-links strong { overflow: hidden; color: var(--blue-dark); font-size: 11px; text-overflow: ellipsis; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(14, 28, 40, .38); z-index: 10; }
.drawer { position: fixed; z-index: 11; right: 0; top: 0; bottom: 0; width: min(610px, 100%); background: var(--surface); box-shadow: -18px 0 50px var(--shadow); transform: translateX(102%); transition: transform .22s ease; overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer form { min-height: 100%; display: flex; flex-direction: column; }
.drawer-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-head p { color: var(--muted); margin-top: 5px; font-size: 12px; }
.drawer-head .icon-button { font-size: 24px; }
fieldset { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 21px 24px 24px; }
legend { padding: 0; font-weight: 750; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 16px; }
.form-grid > label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.form-grid .wide { grid-column: 1 / -1; }
input, select, textarea { border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--field-bg); outline: 0; }
input, select { height: 39px; padding: 0 10px; }
textarea { padding: 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.plate-input { text-transform: uppercase; font-weight: 750; letter-spacing: .07em; }
.field-hint { color: var(--muted); font-size: 10px; font-weight: 400; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.weekday-picker label { position: relative; }
.weekday-picker input { position: absolute; opacity: 0; }
.weekday-picker label { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); cursor: pointer; }
.weekday-picker label:has(input:checked) { color: white; border-color: var(--blue); background: var(--blue); }
.time-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.form-error { margin: 16px 24px 0; color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 11px; }
.drawer-actions { position: sticky; bottom: 0; background: var(--surface); margin-top: auto; padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translateX(-50%); color: white; background: #193246; border-radius: 8px; padding: 11px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
  .events-preview { display: none; }
  .events-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .events-heading, .events-search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 12px 10px 10px; }
  .brand { padding: 0 4px 10px; }
  nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 4px; overflow: visible; }
  .nav-item { min-width: 0; padding: 9px 4px; text-align: center; white-space: normal; font-size: 10px; line-height: 1.25; }
  .nav-item > span:first-child { display: block; width: auto; margin-bottom: 3px; font-size: 14px; }
  .nav-full, .add-full { display: none !important; }
  .nav-short, .add-short { display: inline !important; }
  .sidebar-note { display: none; }
  main { width: 100%; min-width: 0; padding: 18px 12px 28px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 18px; }
  .topbar-actions { gap: 6px; }
  .theme-control { width: 39px; padding: 0; justify-content: center; }
  .theme-control select { position: absolute; width: 39px; opacity: 0; cursor: pointer; }
  .topbar p { display: none; }
  h1 { font-size: 18px; line-height: 1.2; }
  .topbar .primary { min-height: 37px; font-size: 11px; padding: 0 10px; white-space: nowrap; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stats article { min-width: 0; padding: 14px; }
  .stats strong { font-size: 23px; }
  .content-grid, .import-grid { grid-template-columns: 1fr; }
  .requests-grid, .request-form-fields { grid-template-columns: 1fr; }
  .request-form-fields .wide { grid-column: auto; }
  .parking-grid { grid-template-columns: 1fr; }
  .parking-report-grid { grid-template-columns: 1fr; }
  .parking-report-filters { grid-template-columns: 1fr; }
  .parking-report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shift-summary, .shift-history-row { grid-template-columns: 1fr; }
  .shift-history-row div:last-child { text-align: left; }
  .parking-report-actions .secondary, .parking-report-actions .primary { flex: 1 1 100%; }
  .parking-session-head { align-items: stretch; }
  .parking-session-actions { min-width: 0; width: 100%; align-items: stretch; flex-direction: column; }
  .parking-session-actions .search, .parking-session-actions .primary { width: 100%; }
  .session-form-fields { grid-template-columns: 1fr; padding: 18px 16px; }
  .parking-detail-photos, .parking-detail-grid { grid-template-columns: 1fr; }
  .parking-details-content { padding: 16px; }
  .parking-detail-event { grid-template-columns: 64px minmax(0, 1fr); }
  .parking-detail-event .snapshot-button { width: 64px; height: 48px; }
  .parking-detail-result { grid-column: 2; }
  .tariff-field-pair { grid-template-columns: 1fr; }
  .tariff-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .tariff-form-actions button { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-pair { grid-template-columns: 1fr; }
  .integration-card, .parking-settings-card, .users-card, .maintenance-card, .license-card, .settings-actions { grid-column: auto; }
  .license-grid { grid-template-columns: 1fr; gap: 4px; }
  .copy-field { grid-template-columns: 1fr; }
  .copy-field button, .license-summary .restore-button { width: 100%; }
  .license-banner { align-items: flex-start; flex-wrap: wrap; }
  .license-banner .link-button { margin-left: 0; width: 100%; text-align: left; }
  .maintenance-grid { grid-template-columns: 1fr; gap: 8px; }
  .backup-actions { display: grid; grid-template-columns: 1fr; }
  .backup-actions button, .restore-button { width: 100%; }
  .backup-row { grid-template-columns: 1fr; }
  .settings-card { padding: 17px; }
  .settings-card-head { flex-direction: column; }
  .local-user-form { grid-template-columns: 1fr; }
  .user-role-row { grid-template-columns: 1fr; gap: 8px; }
  .user-permissions { grid-template-columns: 1fr; }
  .integration-flow { justify-content: flex-start; gap: 7px; }
  .integration-flow span { padding: 7px 8px; font-size: 11px; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .about-hero { grid-template-columns: 1fr; padding: 18px; }
  .about-brand { align-items: flex-start; gap: 13px; }
  .about-logo { width: 54px; height: 54px; flex-basis: 54px; border-radius: 13px; }
  .about-brand h2 { font-size: 21px; }
  .about-card { padding: 17px; }
  .developer-profile, .contact-links { grid-template-columns: 1fr; }
  .developer-profile { gap: 17px; }
  .event-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .events-toolbar { grid-template-columns: 1fr; padding: 14px; }
  .events-heading, .events-search { grid-column: auto; }
  .events-reset { width: 100%; }
  .panel { min-width: 0; border-radius: 10px; }
  .panel-head { min-height: auto; align-items: stretch; flex-direction: column; padding: 14px; }
  .search { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .table-wrap { overflow: visible; }
  .responsive-table, .responsive-table tbody { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { padding: 10px; }
  .responsive-table tr { display: grid; width: 100%; margin-bottom: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 2px 8px var(--shadow); }
  .responsive-table tr:last-child { margin-bottom: 0; }
  .responsive-table td { min-width: 0; display: grid; grid-template-columns: 95px minmax(0, 1fr); align-items: start; gap: 9px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--row-line); overflow-wrap: anywhere; }
  .responsive-table td:last-child { border-bottom: 0; padding-bottom: 0; }
  .responsive-table td:first-child { padding-top: 0; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; padding-top: 3px; }
  .vehicle-cell { min-width: 0; }
  .vehicle-photo { width: 76px; height: 54px; }
  .row-actions { justify-content: flex-start; }
  .event-actions { min-width: 0; }
  .add-event-pass { width: 100%; white-space: normal; }
  .events-table td:first-child { grid-template-columns: 95px minmax(0, 1fr); }
  .snapshot-button { width: min(180px, 100%); height: 96px; }
  .snapshot-button.vehicle-photo { width: 76px; height: 54px; }
  .import-card { padding: 18px; }
  .export-actions { flex-direction: column; }
  .drawer-head, fieldset, .drawer-actions { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}
