/* Панель парковки — палитра приложения Hertz Energy: светло-зелёный акцент, белые карточки, мягкие тени */
:root {
  --primary: #9BE15D; --primary-dark: #33842A; --on-primary: #14320C; --primary-soft: #EDF9E3; --primary-line: #C9EBAE;
  --ink: #16191D; --text: #2B3138; --muted: #6B7380; --faint: #9BA2AB; --line: #ECEEF1; --field: #F3F4F6; --bg: #F7F8FA;
  --green: #2E9442; --green-bg: #E6F5E9; --orange: #DB8414; --orange-bg: #FFF1DE; --blue: #2D7BE5; --blue-bg: #E8F1FD;
  --red: #D7392F; --red-bg: #FDECEA; --dark: #1C2127;
  --shadow: 0 6px 20px rgba(16,24,40,.08); --shadow-soft: 0 3px 12px rgba(16,24,40,.06);
  --r: 16px; --r-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary-dark); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 700; }
h1 { font-size: 24px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono, .plate, .num { font-variant-numeric: tabular-nums; }

/* ---- каркас */
#app { min-height: 100vh; display: flex; }
.side { width: 232px; flex: 0 0 232px; background: #fff; border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; }
.brand b { display: block; font-size: 17px; color: var(--ink); line-height: 1.1; } .brand span { font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text); font-weight: 500; }
.nav a .n { font-size: 11px; color: var(--faint); font-weight: 600; width: 18px; }
.nav a:hover { background: var(--field); text-decoration: none; }
.nav a.on { background: var(--primary-soft); color: var(--ink); font-weight: 600; } .nav a.on .n { color: var(--primary-dark); }
.side .me { margin-top: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.side .me b { color: var(--ink); } .side .me .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.main { flex: 1 1 auto; min-width: 0; padding: 26px 30px 48px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.head .crumb { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.head h1 { margin-top: 4px; }
.head .tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.live { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; background: var(--green-bg); color: var(--green); font-size: 12px; font-weight: 700; }
.live.off { background: var(--red-bg); color: var(--red); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---- карточки, сетки */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cols > .c3 { flex: 3 1 520px; min-width: 0; } .cols > .c2 { flex: 2 1 360px; min-width: 0; } .cols > .c1 { flex: 1 1 300px; min-width: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-soft); }
.card.flat { box-shadow: none; }
.card .ttl { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.kpi .lbl { font-size: 11px; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.kpi .val { font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1.1; margin: 8px 0 4px; }
.kpi .val small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.warn { border-color: #F0C77A; background: #FFFBF3; } .kpi.warn .lbl, .kpi.warn .val { color: var(--orange); }
.kpi.ok .val { color: var(--green); }
.bar { height: 6px; border-radius: 3px; background: var(--field); overflow: hidden; margin: 10px 0 6px; } .bar i { display: block; height: 100%; background: var(--primary); }

/* ---- кнопки, формы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--field); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); } .btn.primary:hover { background: #8ad94c; }
.btn.soft { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--on-primary); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; } .btn.dark:hover { background: #2b3138; }
.btn.danger { background: var(--red-bg); border-color: var(--red-bg); color: var(--red); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; } .btn.lg { min-height: 50px; padding: 0 24px; font-size: 15px; }
.btn.block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font-weight: 500; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }
.field input[type=date] { color-scheme: light; }
.inp { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font-weight: 500; outline: none; } .inp:focus { border-color: var(--primary); background: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { min-width: 130px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); } .tab b { font-weight: 600; opacity: .7; margin-left: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 13.5px; color: var(--text); font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary-dark); }
.switch { width: 44px; height: 26px; border-radius: 13px; border: 0; padding: 3px; background: #C3CAD1; cursor: pointer; display: flex; transition: background .15s; }
.switch i { width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { background: var(--green); } .switch.on i { transform: translateX(18px); }

/* ---- таблицы */
.tbl-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; } tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #FAFBFC; } tr.sel td { background: var(--primary-soft); }
td.r, th.r { text-align: right; } td.num, td.nw { white-space: nowrap; } .muted { color: var(--muted); } .small { font-size: 12px; } .faint { color: var(--faint); }
.plate { display: inline-flex; white-space: nowrap; align-items: stretch; border: 1.5px solid #11151A; border-radius: 4px; background: #F4F5F2; overflow: hidden; font-family: "IBM Plex Mono", "DejaVu Sans Mono", Menlo, monospace; font-weight: 700; color: #0B0E11; letter-spacing: .05em; line-height: 1; }
.plate i { background: #2B5FB8; color: #fff; font-size: 8px; padding: 0 4px; display: flex; align-items: center; font-style: normal; }
.plate b { padding: 4px 8px; font-size: 14px; font-weight: 700; } .plate.lg b { font-size: 24px; padding: 6px 12px; } .plate.lg i { font-size: 11px; padding: 0 6px; }
.chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); } .chip.orange { background: var(--orange-bg); color: var(--orange); }
.chip.blue { background: var(--blue-bg); color: var(--blue); } .chip.red { background: var(--red-bg); color: var(--red); } .chip.gray { background: var(--field); color: var(--muted); }
.chip.ink { background: var(--ink); color: #fff; }
.empty { padding: 28px; text-align: center; color: var(--faint); }

/* ---- пульт */
.lane { display: flex; flex-direction: column; gap: 12px; }
.lane .shot { position: relative; height: 180px; border-radius: 12px; background: #E9ECEF; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; }
.lane .shot img { width: 100%; height: 100%; object-fit: cover; }
.lane .shot .tag { position: absolute; left: 10px; top: 10px; background: rgba(28,33,39,.85); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.lane .shot .plate { position: absolute; left: 10px; bottom: 10px; } .lane .shot .chip { position: absolute; right: 10px; bottom: 12px; }
.lane .st { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lane .gate { font-size: 20px; font-weight: 800; letter-spacing: .05em; } .lane .gate.open { color: var(--green); }
.lane .manual { display: flex; gap: 8px; } .lane .manual input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); font-family: "IBM Plex Mono", monospace; font-weight: 600; text-transform: uppercase; }
.feed { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; }
.feed .ev { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.feed .ev:last-child { border-bottom: 0; } .feed .ev .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed .ev .why { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hours { display: flex; align-items: flex-end; gap: 5px; height: 120px; border-bottom: 1px solid var(--line); }
.hours div { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; font-size: 10px; color: var(--muted); }
.hours div i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: #D9DDE2; } .hours div.now i { background: var(--primary); }
.hours-x { display: flex; gap: 5px; margin-top: 4px; } .hours-x span { flex: 1 1 0; text-align: center; font-size: 10px; color: var(--faint); } .days + .hours-x span { max-width: 48px; }

/* ---- предупреждения пульта */
.alerts { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.alert { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 10px; align-items: start; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--ink); background: var(--blue-bg); }
.alert.warn { background: var(--orange-bg); } .alert.danger { background: var(--red-bg); } .alert:hover { text-decoration: none; filter: brightness(.97); }
.alert i { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; font-size: 12px; color: #fff; background: var(--blue); }
.alert.warn i { background: var(--orange); } .alert.danger i { background: var(--red); }
.vcard-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.vcard-head .info { flex: 1 1 260px; } .vcard-head .info b { font-size: 18px; color: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gallery div { position: relative; } .gallery .empty { grid-column: 1 / -1; } .gallery img { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; background: #E9ECEF; display: block; }
.gallery span { position: absolute; left: 6px; bottom: 6px; background: rgba(28,33,39,.8); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.msgs { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px 0; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--field); font-size: 13px; } .msg.admin { align-self: flex-end; background: var(--primary-soft); }
.msg .t { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 14px; background: var(--field); font-size: 12.5px; cursor: pointer; }
.chips label input { accent-color: var(--primary-dark); }
@media print { .side, .tools, .btn, .nav { display: none !important; } .main { padding: 0; } .modal { position: static; transform: none; width: auto; box-shadow: none; } .backdrop { display: none; } }

/* ---- шторка деталей, модалки */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; box-shadow: -8px 0 30px rgba(16,24,40,.12); padding: 22px 24px; overflow-y: auto; z-index: 30; display: flex; flex-direction: column; gap: 16px; }
.backdrop { position: fixed; inset: 0; background: rgba(22,25,29,.35); z-index: 25; }
.modal { position: fixed; z-index: 40; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(520px, 94vw); max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 20px; padding: 22px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.modal h2, .drawer h2 { font-size: 18px; }
.x { margin-left: auto; width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--field); cursor: pointer; font-size: 18px; line-height: 1; }
.tl { list-style: none; margin: 0; padding: 0; } .tl li { display: grid; grid-template-columns: 50px 12px minmax(0,1fr); gap: 10px; padding: 6px 0; }
.tl li .t { font-size: 12px; color: var(--muted); } .tl li i { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--faint); }
.tl li i.g { background: var(--green); } .tl li i.o { background: var(--orange); } .tl li i.r { background: var(--red); } .tl li i.b { background: var(--blue); }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; } .shots img, .shots .ph { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; background: #E9ECEF; display: block; }
.shots .ph { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; }
.sum { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sum .lbl { font-size: 10.5px; color: var(--muted); letter-spacing: .05em; font-weight: 600; } .sum .v { font-size: 20px; font-weight: 700; color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 500; z-index: 50; box-shadow: var(--shadow); }
.toast.err { background: var(--red); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login .brand { margin-bottom: 8px; }
.err { color: var(--red); font-size: 13px; }
.mbars { display: flex; height: 16px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 10px 0 12px; } .mbars i { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 8px; } .legend div { display: grid; grid-template-columns: 12px minmax(0,1fr) auto auto; gap: 10px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: block; }
.days { display: flex; align-items: flex-end; gap: 6px; height: 130px; border-bottom: 1px solid var(--line); } .days div { flex: 1 1 0; max-width: 48px; height: 100%; display: flex; align-items: flex-end; } .days div i { display: block; width: 100%; background: #D9DDE2; border-radius: 3px 3px 0 0; } .days div.now i { background: var(--primary); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; } .kv:last-child { border-bottom: 0; } .kv b { color: var(--ink); }
.hint { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  #app { flex-direction: column; }
  .side { width: auto; flex: none; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .side .nav { flex-direction: row; flex-wrap: wrap; } .side .nav a { min-height: 38px; padding: 0 10px; } .side .me { margin-top: 0; margin-left: auto; }
  .main { padding: 18px 16px 40px; } .head h1 { font-size: 21px; }
}

/* всплывающее окно проезда */
.pass-backdrop { position: fixed; inset: 0; background: rgba(12,14,17,.55); backdrop-filter: blur(2px); z-index: 60; animation: fadein .15s ease-out; }
.pass { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(960px, 94vw); background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.35); animation: pop .18s ease-out; }
.pass-img { position: relative; background: #0F1216; min-height: 220px; display: flex; align-items: center; justify-content: center; }
.pass-img img { display: block; width: 100%; max-height: min(66vh, 720px); object-fit: contain; }
.pass-img .ph { color: #8E96A0; font-size: 14px; padding: 90px 0; }
.pass-top { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; align-items: center; }
.pass-cam, .pass-time { background: rgba(28,33,39,.85); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.pass-bottom { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; }
.pass-bottom .plate.lg b { font-size: 40px; padding: 8px 18px; } .pass-bottom .plate.lg i { font-size: 14px; padding: 0 9px; }
.pass-bottom .plate { box-shadow: 0 6px 20px rgba(0,0,0,.4); } .pass-bottom .chip { font-size: 13px; height: 32px; padding: 0 14px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.pass-noplate { color: #fff; font-weight: 700; font-size: 18px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.pass-x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(28,33,39,.85); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.pass-x:hover { background: #fff; color: var(--ink); }
.pass-info { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.pass-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 15px; color: var(--ink); }
.pass-act { justify-content: flex-end; }
.pass-gate { font-size: 18px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; } .pass-gate.ok { color: var(--green); } .pass-gate.err { color: var(--red); } .pass-gate.wait { color: var(--blue); }
.pass-bar { height: 4px; background: var(--line); margin: 4px -20px 0; } .pass-bar i { display: block; height: 100%; width: 100%; background: var(--primary); }
.pass[data-decision="denied"] .pass-bar i { background: var(--red); }
@keyframes pop { from { transform: translate(-50%,-50%) scale(.96); opacity: 0; } to { transform: translate(-50%,-50%) scale(1); opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media print { .pass, .pass-backdrop { display: none !important; } }
