/* =========================================================
   АЗС Панель — минималистичная плоская тема
   ========================================================= */

:root {
    --bg: #f3f6f2;
    --surface: #ffffff;
    --surface-2: #f8faf7;
    --surface-3: #eef3ee;
    --ink: #18241d;
    --ink-soft: #3e4f45;
    --muted: #708076;
    --line: #e2e9e2;
    --line-strong: #d3ded5;
    --brand: #1f7a4d;
    --brand-deep: #155f3b;
    --brand-dark: #173e2b;
    --brand-soft: #e8f4ed;
    --brand-tint: #f1f8f3;
    --amber: #c18724;
    --amber-soft: #fbf3df;
    --blue: #356b8c;
    --blue-soft: #eaf2f7;
    --danger: #b33e3e;
    --danger-soft: #fbeeee;
    --success: #1f7a4d;
    --success-soft: #e8f4ed;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow: 0 1px 2px rgba(20, 45, 32, 0.04);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
    margin: 0;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    letter-spacing: -0.02em;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-deep);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

img, svg {
    display: block;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

::selection {
    background: #cfe8d9;
    color: var(--brand-dark);
}

:focus-visible {
    outline: 3px solid rgba(31, 122, 77, 0.28);
    outline-offset: 2px;
}

.icon {
    flex: 0 0 auto;
}

.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.nowrap { white-space: nowrap; }
.required { color: var(--danger); }

/* ---------- Бренд ---------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    min-width: 0;
}

.brand:hover { color: var(--ink); }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 13px;
    background: var(--brand);
    color: #fff;
}

.brand-mark .icon {
    width: 23px;
    height: 23px;
}

.brand--light { color: #fff; }
.brand--light:hover { color: #fff; }

.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.brand-copy strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.brand-copy small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-top: 3px;
}

.brand--light .brand-copy small { color: #88a696; }

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 8px;
}

.eyebrow--light { color: #8fc2a8; }

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn .icon { width: 18px; height: 18px; }

.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn--primary:hover {
    background: var(--brand-deep);
    border-color: var(--brand-deep);
    color: #fff;
}

.btn--secondary {
    background: #fff;
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn--secondary:hover {
    background: var(--surface-2);
    border-color: #bfcfc3;
    color: var(--ink);
}

.btn--ghost {
    color: var(--ink-soft);
    border-color: transparent;
    background: transparent;
}

.btn--ghost:hover {
    background: var(--surface-3);
    color: var(--ink);
}

.btn--danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn--danger:hover {
    background: #963333;
    border-color: #963333;
    color: #fff;
}

.btn--block { width: 100%; }
.btn--lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn--small { height: 34px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn--small .icon { width: 16px; height: 16px; }

.btn:disabled,
.btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    background: var(--surface-3);
    color: var(--ink);
}

.icon-btn--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.icon-btn--light {
    color: #a9c2b4;
}

.icon-btn--light:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.icon-btn:disabled:hover {
    background: transparent;
    color: var(--muted);
}

.link-btn {
    border: 0;
    padding: 0;
    background: none;
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
}

.link-btn:hover { text-decoration: underline; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.link-arrow .icon { width: 16px; height: 16px; }

/* ---------- Формы ---------- */

.form { display: block; }

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    margin-bottom: 17px;
}

.field:last-child { margin-bottom: 0; }

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.3;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: #a2aea6; }

.field input:hover,
.field select:hover { border-color: #bfcfc3; }

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.13);
}

.field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23708076' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}

.field input[type="date"],
.field input[type="datetime-local"] {
    padding-right: 10px;
}

.field-error {
    color: var(--danger);
    font-size: 12.5px;
    line-height: 1.35;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.field--compact { margin-bottom: 0; }
.field--compact label { font-size: 12px; }
.field--compact input,
.field--compact select { min-height: 40px; font-size: 13.5px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.field--full { grid-column: 1 / -1; }

.field--port { max-width: none; }

.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: #91a097;
    pointer-events: none;
}

.input-wrap .input-icon .icon { width: 19px; height: 19px; }

.input-wrap input { padding-left: 42px; }

.input-wrap--search input { padding-left: 40px; }

.input-suffix {
    display: flex;
    align-items: stretch;
    position: relative;
}

.input-suffix input { padding-right: 46px; }

.input-suffix > span {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--muted);
    pointer-events: none;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-row {
    display: flex;
    gap: 10px;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 18px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.form-divider span { white-space: nowrap; }

.form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.form-footer--standalone {
    margin-top: 18px;
    padding: 18px 0 0;
}

.form-footer--inline {
    border-top: 0;
    padding-top: 0;
    margin-top: 20px;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    cursor: pointer;
}

.switch-row > span:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.switch-row strong { font-size: 14px; }
.switch-row small { color: var(--muted); font-size: 12.5px; }

.switch-row--card {
    margin: 4px 0 18px;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.switch-track {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: #cdd7d0;
    transition: background 0.18s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 45, 32, 0.2);
    transition: transform 0.18s ease;
}

.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(31, 122, 77, 0.25); outline-offset: 2px; }

/* ---------- Уведомления ---------- */

.flash-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(390px, calc(100vw - 32px));
    pointer-events: none;
}

.flash-stack--inline {
    position: static;
    width: 100%;
    margin-bottom: 18px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 0 8px 30px rgba(23, 62, 43, 0.1);
    font-size: 13.5px;
    line-height: 1.45;
    pointer-events: auto;
    animation: flash-in 0.25s ease both;
}

.flash--success { border-color: #cbe4d5; background: #f4fbf6; }
.flash--error { border-color: #f0d2d2; background: #fdf6f6; }
.flash-icon { color: var(--brand); margin-top: 1px; }
.flash--error .flash-icon { color: var(--danger); }
.flash-icon .icon { width: 18px; height: 18px; }
.flash > span:nth-child(2) { flex: 1; }

.flash-close {
    border: 0;
    background: none;
    color: var(--muted);
    padding: 1px;
    margin: -2px -3px 0 0;
}

.flash-close .icon { width: 15px; height: 15px; }

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 13.5px;
    line-height: 1.5;
}

.alert > .icon,
.alert-icon .icon { width: 19px; height: 19px; }
.alert-icon { flex: 0 0 auto; margin-top: 1px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert p { margin-top: 3px; }
.alert a { font-weight: 600; text-decoration: underline; }

.alert--danger { background: var(--danger-soft); border-color: #efd0d0; color: #7d2929; }
.alert--danger .alert-icon { color: var(--danger); }
.alert--warning { background: var(--amber-soft); border-color: #eedcb5; color: #6e5218; }
.alert--warning .alert-icon { color: var(--amber); }
.alert--success { background: var(--success-soft); border-color: #cbe4d5; color: #195737; }
.alert-list { margin: 4px 0 0; padding-left: 18px; }
.alert-list li { margin: 2px 0; }

/* ---------- Бейджи ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.badge .icon { width: 13px; height: 13px; }
.badge--success { background: var(--success-soft); color: #19623e; }
.badge--danger { background: var(--danger-soft); color: #922f2f; }
.badge--neutral { background: var(--surface-3); color: #54645a; }
.badge--brand { background: var(--brand-soft); color: var(--brand-deep); }

.fuel-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--amber-soft);
    color: #7c5a17;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.code-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px dashed var(--line-strong);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11.5px;
    letter-spacing: 0.03em;
}

.code-chip .icon { width: 14px; height: 14px; color: var(--muted); }
.code-chip:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-tint); }

.car-plate {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ---------- Аватары ---------- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    color: #d9e8de;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.avatar--sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-deep);
}

.mini-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--brand-tint);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
}

.person-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
}

.person-cell > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.person-cell strong { font-size: 13.5px; font-weight: 600; }
.person-cell small { color: var(--muted); font-size: 12px; }

.org-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.org-cell > span:last-child,
.org-cell > strong {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.org-cell small { color: var(--muted); font-size: 12px; }
.org-cell strong { font-size: 13.5px; font-weight: 600; }

.org-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 15px;
    font-weight: 700;
}

.org-logo .icon { width: 17px; height: 17px; }
.org-logo--amber { background: var(--amber-soft); color: var(--amber); }

/* =========================================================
   Экран входа
   ========================================================= */

.auth-body {
    background: #f5f7f4;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(440px, 1.04fr) minmax(460px, 0.96fr);
    min-width: 0;
    min-height: 100vh;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    background: var(--brand-dark);
    color: #fff;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 14%, rgba(88, 173, 125, 0.26), transparent 33%),
        radial-gradient(circle at 84% 88%, rgba(193, 135, 36, 0.14), transparent 36%),
        linear-gradient(150deg, #173e2b 0%, #102c1e 70%);
}

.auth-visual__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.orbit--1 { width: 680px; height: 680px; right: -250px; bottom: -310px; }
.orbit--2 { width: 480px; height: 480px; right: -150px; bottom: -210px; border-color: rgba(255, 255, 255, 0.06); }
.orbit--3 { width: 300px; height: 300px; left: -150px; top: 32%; border-color: rgba(255, 255, 255, 0.05); }

.auth-visual__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 44px clamp(34px, 5vw, 74px);
}

.auth-visual__content {
    margin: auto 0;
    padding: 48px 0;
    max-width: 560px;
}

.auth-visual__content h1 {
    font-size: clamp(32px, 3.2vw, 46px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.035em;
    margin-bottom: 18px;
}

.auth-lead {
    color: #b9cec1;
    font-size: 16px;
    line-height: 1.6;
    max-width: 470px;
    margin-bottom: 34px;
}

.auth-features {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.08);
    color: #9ed0b4;
}

.feature-icon .icon { width: 19px; height: 19px; }

.auth-features li > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.auth-features strong { font-size: 14px; font-weight: 600; }
.auth-features small { color: #9eb5a6; font-size: 12.5px; }

.auth-visual__footer {
    color: #7e9b8a;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 40px 24px;
}

.auth-card-wrap {
    width: 100%;
    max-width: 430px;
    min-width: 0;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 700;
}

.auth-card {
    width: 100%;
    padding: clamp(26px, 3vw, 36px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(23, 62, 43, 0.06);
}

.auth-form-head {
    margin-bottom: 24px;
}

.auth-form-head h2 {
    font-size: 27px;
    margin-bottom: 8px;
}

.auth-form-head p:last-child {
    color: var(--muted);
    font-size: 13.5px;
}

.auth-card .field { margin-bottom: 18px; }
.auth-card .form .btn { margin-top: 6px; }

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.auth-note .icon { width: 17px; height: 17px; color: var(--brand); margin-top: 1px; }

.auth-copyright {
    margin-top: 22px;
    color: #8b978f;
    text-align: center;
    font-size: 11.5px;
}

/* =========================================================
   Установщик
   ========================================================= */

.install-body {
    background: #f2f5f1;
}

.install-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px clamp(20px, 4vw, 48px);
}

.install-topbar__note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.install-layout {
    display: grid;
    grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 54px);
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding-bottom: 48px;
    align-items: start;
}

.install-aside {
    position: sticky;
    top: 24px;
    overflow: hidden;
    border-radius: 22px;
    background: var(--brand-dark);
    color: #fff;
}

.install-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 12%, rgba(88, 173, 125, 0.28), transparent 38%),
        linear-gradient(155deg, #173e2b, #102b1e);
}

.install-aside__inner {
    position: relative;
    z-index: 1;
    padding: 38px 34px;
}

.install-aside h1 {
    font-size: 31px;
    line-height: 1.12;
    margin-bottom: 14px;
}

.install-lead {
    color: #a9c1b2;
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.install-steps {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.install-step {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: #8ca597;
}

.install-step.is-current {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.install-step.is-done { color: #a9d3ba; }

.install-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 700;
}

.install-step.is-current .install-step__num { background: var(--brand); color: #fff; }
.install-step.is-done .install-step__num { background: rgba(88, 173, 125, 0.2); color: #b9e2c9; }
.install-step__num .icon { width: 15px; height: 15px; }

.install-step > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.install-step strong { font-size: 13.5px; font-weight: 600; }
.install-step small { font-size: 11.5px; color: #87a092; }
.install-step.is-current small { color: #a9c1b2; }

.install-aside__foot {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    color: #819b8c;
    font-size: 11.5px;
    line-height: 1.5;
}

.install-aside__foot .icon { width: 17px; height: 17px; color: #72a889; margin-top: 1px; }

.install-main { min-width: 0; }

.install-card {
    padding: clamp(24px, 3.2vw, 42px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.install-mobile-steps { display: none; }

.install-head { margin-bottom: 24px; }
.install-head h2 { font-size: 28px; margin-bottom: 8px; }
.install-head > p:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 580px; }

.requirements-box {
    margin: 18px 0 22px;
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
}

.requirements-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
}

.requirements-head strong { font-size: 12.5px; }
.requirements-head span { font-size: 11.5px; font-weight: 700; }

.requirement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 15px;
    border-top: 1px solid #edf1ed;
    font-size: 12.5px;
}

.requirement:first-of-type { border-top: 0; }
.requirement > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; }
.requirement strong { font-weight: 500; font-size: 12.5px; }
.requirement small { color: var(--muted); font-size: 11.5px; }
.requirement-icon { color: var(--muted); margin-top: 1px; }
.requirement-icon .icon { width: 15px; height: 15px; }
.requirement.is-ok .requirement-icon { color: var(--brand); }
.requirement.is-fail .requirement-icon { color: var(--danger); }
.requirement.is-fail strong { color: var(--danger); }
.requirement.is-warn .requirement-icon { color: var(--amber); }

.install-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.install-actions--split {
    justify-content: space-between;
    align-items: center;
}

.db-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid #cfe6d8;
    border-radius: 11px;
    background: var(--brand-tint);
    color: var(--brand-deep);
    font-size: 12px;
}

.db-summary .icon { width: 19px; height: 19px; }
.db-summary > div { display: flex; flex-direction: column; }
.db-summary strong { font-size: 12.5px; }
.db-summary span { color: #5d7f6b; font-size: 11.5px; }

.info-callout {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 20px;
    padding: 14px;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.5;
}

.info-callout .icon { width: 18px; height: 18px; color: var(--brand); margin-top: 1px; }

.install-success {
    text-align: center;
    padding: 18px 0 8px;
}

.success-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 22px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: 0 0 0 10px #f5faf7;
}

.success-ring .icon { width: 34px; height: 34px; }

.install-success h2 { font-size: 30px; margin-bottom: 10px; }
.install-success > p:not(.eyebrow) { max-width: 520px; margin: 0 auto; color: var(--muted); font-size: 13.5px; }

.success-credentials {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    margin: 24px auto;
    padding: 13px 26px;
    border: 1px dashed var(--line-strong);
    border-radius: 11px;
    background: var(--surface-2);
}

.success-credentials span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.success-credentials strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 18px; }

.install-success .install-actions { justify-content: center; }
.install-success__note { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--muted); font-size: 11.5px; }
.install-success__note .icon { width: 14px; height: 14px; }

/* =========================================================
   Каркас приложения
   ========================================================= */

.app-body { background: var(--bg); }

body.no-scroll { overflow: hidden; }

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: 270px;
    padding: 22px 16px 16px;
    background:
        radial-gradient(circle at 10% 0%, rgba(78, 151, 111, 0.16), transparent 32%),
        var(--brand-dark);
    color: #c2d3c9;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 8px 22px;
}

.sidebar-close { display: none; color: #98b1a2; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 16px;
}

.nav-section {
    padding: 20px 12px 7px;
    color: #6f8c7d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #b7cabf;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.14s ease, color 0.14s ease;
}

.nav-link .icon { width: 19px; height: 19px; color: #7d9a8a; transition: color 0.14s ease; }
.nav-link:hover { background: rgba(255, 255, 255, 0.055); color: #fff; }
.nav-link:hover .icon { color: #b6d5c2; }
.nav-link.is-active { background: rgba(82, 163, 118, 0.17); color: #fff; }
.nav-link.is-active .icon { color: #8ed1aa; }

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 4px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    padding: 4px;
    border-radius: 9px;
    color: #d6e4db;
}

.sidebar-user:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sidebar-user__copy { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user__copy strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user__copy small { color: #829d8e; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { flex: 0 0 auto; }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: rgba(12, 27, 18, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: 270px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 67px;
    padding: 10px clamp(18px, 3vw, 34px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.menu-btn { display: none; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.breadcrumb span:first-child { white-space: nowrap; }
.breadcrumb strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-sep { color: #c0cbc2; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-date {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    min-width: 0;
}

.topbar-user:hover { color: var(--ink); }
.topbar-user__copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar-user__copy strong { font-size: 12.5px; font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user__copy small { color: var(--muted); font-size: 10.5px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-wrap {
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: clamp(20px, 3vw, 34px);
}

/* ---------- Заголовки страниц ---------- */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-head h1 {
    font-size: clamp(25px, 2.5vw, 32px);
    letter-spacing: -0.035em;
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 13.5px;
    max-width: 640px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---------- Карточки ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.card-head h2 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.card-head p {
    color: var(--muted);
    font-size: 12px;
}

.card-head--table { padding-bottom: 14px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 16px 17px 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
}

.stat-icon .icon { width: 17px; height: 17px; }
.stat-icon--blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon--amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon--green { background: var(--brand-soft); color: var(--brand); }

.stat-value {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.stat-value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat-value--money { font-size: clamp(21px, 2vw, 26px); }
.stat-foot { margin-top: 5px; color: var(--muted); font-size: 11.5px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
    gap: 18px;
    margin-bottom: 18px;
}

.chart-card .card-head { border-bottom: 0; padding-bottom: 4px; }

.daily-chart {
    display: flex;
    align-items: flex-end;
    gap: clamp(8px, 1.6vw, 20px);
    height: 235px;
    padding: 16px 22px 20px;
}

.chart-col {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}

.chart-value {
    height: 18px;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.chart-track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    max-width: 42px;
    flex: 1;
    min-height: 40px;
}

.chart-bar {
    width: 100%;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, #3c9868, var(--brand));
    min-height: 3px;
    transition: height 0.3s ease;
}

.chart-col:hover .chart-bar { background: var(--brand-deep); }

.chart-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
    line-height: 1.25;
}

.chart-label strong { font-size: 11.5px; font-weight: 600; }
.chart-label span { color: var(--muted); font-size: 10px; text-transform: uppercase; }

.quick-card .card-head { border-bottom: 0; padding-bottom: 2px; }

.quick-list {
    display: flex;
    flex-direction: column;
    padding: 4px 12px 12px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 8px;
    border-radius: 10px;
    color: var(--ink);
}

.quick-link:hover { background: var(--surface-2); color: var(--ink); }
.quick-link > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.quick-link strong { font-size: 12.5px; font-weight: 600; }
.quick-link small { color: var(--muted); font-size: 11px; }
.quick-link > .icon { width: 15px; height: 15px; color: #b1beb5; }

.quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    flex: 0 0 auto;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
}

.quick-icon .icon { width: 17px; height: 17px; }
.quick-icon--amber { background: var(--amber-soft); color: var(--amber); }
.quick-icon--blue { background: var(--blue-soft); color: var(--blue); }

.setup-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 18px 16px;
    padding: 10px 11px;
    border-radius: 9px;
    background: var(--amber-soft);
    color: #72551b;
    font-size: 11.5px;
    line-height: 1.45;
}

.setup-note .icon { width: 15px; height: 15px; margin-top: 1px; }

/* ---------- Сводка ---------- */

.summary-strip {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    padding: 13px 20px;
    border-left: 1px solid var(--line);
}

.summary-item:first-child { border-left: 0; }
.summary-item--muted { flex: 0 0 auto; justify-content: center; }

.summary-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.summary-item strong {
    font-size: 18px;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.summary-item strong small { font-size: 11px; font-weight: 500; color: var(--muted); }

/* ---------- Фильтры ---------- */

.filter-card { margin-bottom: 16px; }

.filter-form { padding: 16px 18px; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.filter-grid--users { grid-template-columns: 1.2fr 1.3fr; }
.filter-grid--report { grid-template-columns: repeat(2, minmax(0, 180px)); }

.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 13px;
}

.filter-actions .btn { height: 38px; font-size: 13px; }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 540px;
}

.search-form .input-wrap { flex: 1; }
.search-form input { height: 40px; }
.search-form .btn { height: 40px; }
.toolbar-count { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Таблицы ---------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1ed;
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfa; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table td strong { font-weight: 600; }

.cell-sub {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 400;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    justify-content: flex-end;
}

.row-actions form { display: inline-flex; }

.table-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 25px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--brand-tint);
    font-weight: 600;
    font-size: 12px;
}

.table-note {
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
}

.table--refuels { min-width: 940px; }
.table--drivers { min-width: 860px; }
.table--organizations { min-width: 900px; }
.table--users { min-width: 900px; }
.table--stations { min-width: 680px; }

/* ---------- Пагинация ---------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 20px;
    border-top: 1px solid var(--line);
}

.pagination-info { color: var(--muted); font-size: 11.5px; }
.pagination-links { display: flex; align-items: center; gap: 3px; }

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
}

a.page-link:hover { background: var(--surface-3); color: var(--ink); }
.page-link.is-current { background: var(--brand); color: #fff; }
.page-link--arrow .icon { width: 16px; height: 16px; }
.page-link.is-disabled { color: #c3cec6; }
.page-ellipsis { padding: 0 2px; color: var(--muted); }

/* ---------- Пустые состояния ---------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 54px 24px;
    text-align: center;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: var(--surface-3);
    color: #92a398;
}

.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h2, .empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { max-width: 440px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.empty-card { margin-top: 10px; }
.empty-card p { max-width: 500px; }

/* ---------- Раскладки форм ---------- */

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.form-layout > .card:first-child { padding-bottom: 20px; }
.form-layout > .card:first-child .card-head { margin-bottom: 18px; }
.form-layout > .card:first-child > .form,
.form-layout > .card:first-child > .form-grid { padding: 0 20px; }

.form-layout .card > .form-grid { padding: 0 20px; }

.form-layout > .card:first-child > .form-footer { margin: 20px 20px 0; }

.form-section { margin-bottom: 18px; padding-bottom: 20px; }
.form-section .card-head { margin-bottom: 18px; }
.form-section .form-grid { padding: 0 20px; }

.side-note-card,
.total-card,
.qr-side-card {
    padding: 21px;
}

.side-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
}

.side-note-icon .icon { width: 21px; height: 21px; }
.side-note-card h2,
.total-card h2,
.qr-side-card h2 { font-size: 17px; margin-bottom: 8px; }
.side-note-card p,
.total-card > p:not(.eyebrow),
.qr-side-card p { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; }

.feature-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.45;
}

.feature-list .icon { width: 15px; height: 15px; color: var(--brand); margin-top: 1px; }

.total-card {
    position: sticky;
    top: 84px;
}

.total-preview {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--brand-dark);
    color: #fff;
}

.total-preview span { color: #98b7a5; font-size: 11px; }
.total-preview strong { font-size: 27px; line-height: 1.15; letter-spacing: -0.03em; }

.total-details {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 0 12px;
}

.total-details > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 12px;
}

.total-details dt { color: var(--muted); }
.total-details dd { font-weight: 600; }

.hint {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.hint--with-icon {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 14px;
}

.hint--with-icon .icon { width: 15px; height: 15px; color: var(--brand); margin-top: 1px; }

/* ---------- Права доступа ---------- */

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 20px;
}

.permission-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.permission-card:hover { border-color: #bfd2c3; }
.permission-card:focus-within { outline: 3px solid rgba(31, 122, 77, 0.18); outline-offset: 1px; }

.permission-card input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.permission-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin-top: 1px;
    border: 1.5px solid #c3d0c7;
    border-radius: 6px;
    background: #fff;
    color: transparent;
    transition: all 0.15s ease;
}

.permission-check .icon { width: 13px; height: 13px; }

.permission-card input:checked ~ .permission-check {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.permission-card:has(input:checked) {
    border-color: #b1d2bd;
    background: var(--brand-tint);
}

.permission-copy { display: flex; flex-direction: column; gap: 2px; }
.permission-copy strong { font-size: 12.5px; font-weight: 600; }
.permission-copy small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }

/* ---------- QR ---------- */

.qr-mini-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    margin-bottom: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 13px;
    background: var(--surface-2);
    padding: 12px;
}

.qr-mini-preview--empty { color: #b3c0b7; }
.qr-mini-preview--empty .icon { width: 58px; height: 58px; }
.qr-mini-preview canvas, .qr-mini-preview img { width: 170px !important; height: 170px !important; }

.qr-placeholder { color: #a9b8ae; }

.qr-code-value {
    padding: 9px 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: var(--surface-3);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-align: center;
}

.qr-side-card .btn { margin-top: 4px; }

/* ---------- Водитель: карточка отчёта ---------- */

.driver-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.driver-hero__main { display: flex; align-items: center; gap: 14px; min-width: 0; }

.driver-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border-radius: 15px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 17px;
    font-weight: 700;
}

.driver-hero__name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.driver-hero__name h2 { font-size: 20px; }
.driver-meta { display: flex; align-items: center; gap: 12px; margin-top: 5px; color: var(--muted); font-size: 11.5px; }

.qr-inline {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    text-align: left;
    color: var(--ink);
    flex: 0 0 auto;
}

.qr-inline:hover { border-color: #b9d0c0; background: var(--brand-tint); }
.qr-inline__icon { color: var(--brand); }
.qr-inline > span:nth-child(2) { display: flex; flex-direction: column; }
.qr-inline small { color: var(--muted); font-size: 10px; }
.qr-inline code { font-size: 11.5px; letter-spacing: 0.07em; }
.qr-inline > .icon { width: 15px; height: 15px; color: var(--muted); }

/* ---------- Организации, профиль, настройки ---------- */

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 18px;
    margin-bottom: 18px;
}

.settings-grid > .card { padding-bottom: 20px; }
.settings-grid > .card > .form { padding: 0 20px; }
.settings-grid > .card > .info-list { padding: 0 20px; }
.settings-grid .card-head { margin-bottom: 18px; }

.info-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.info-list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #edf1ed;
    font-size: 12.5px;
}

.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { font-weight: 600; text-align: right; word-break: break-word; }

.info-list--compact { margin: 16px 0; padding: 0 !important; }
.info-list--compact > div { padding: 7px 0; }

.stat-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 20px 20px 0;
}

.stat-mini-grid > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px;
    border-radius: 9px;
    background: var(--surface-2);
}

.stat-mini-grid strong { font-size: 16px; }
.stat-mini-grid span { color: var(--muted); font-size: 10px; line-height: 1.3; }

.security-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    margin-bottom: 18px;
}

.security-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
}

.security-card h2 { font-size: 15px; margin-bottom: 5px; }
.security-card p { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.security-card p + p { margin-top: 6px; }

.profile-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-summary {
    text-align: center;
    padding: 24px 20px;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 13px;
    border-radius: 20px;
    background: var(--brand-dark);
    color: #fff;
    font-size: 23px;
    font-weight: 700;
}

.profile-summary h2 { font-size: 19px; margin-bottom: 2px; }
.profile-login { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.profile-summary .btn { margin-top: 4px; }

.profile-grid > .card:last-child { padding-bottom: 20px; }
.profile-grid > .card:last-child .card-head { margin-bottom: 18px; }
.profile-grid > .card:last-child .form { padding: 0 20px; }

/* ---------- Модальные окна ---------- */

.modal {
    width: min(430px, calc(100% - 28px));
    max-height: calc(100vh - 40px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--ink);
    overflow: visible;
}

.modal--qr { width: min(400px, calc(100% - 28px)); }

.modal::backdrop {
    background: rgba(12, 27, 18, 0.56);
    backdrop-filter: blur(3px);
}

.modal-card {
    max-height: calc(100vh - 40px);
    padding: 22px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(13, 34, 22, 0.24);
}

.modal[open] .modal-card { animation: modal-in 0.18s ease both; }

@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-head .eyebrow { margin-bottom: 3px; }
.modal-title { font-size: 19px; }
.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.modal-icon--danger { background: var(--danger-soft); color: var(--danger); }
.modal-text { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.qr-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin: 4px 0 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.qr-canvas { width: 270px; height: 270px; display: flex; align-items: center; justify-content: center; }
.qr-canvas canvas, .qr-canvas img { width: 260px !important; height: 260px !important; }
.modal--qr .modal-text { margin-bottom: 0; }

/* ---------- Страницы ошибок ---------- */

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 0%, #e8f3ec, transparent 42%),
        var(--bg);
}

.error-card {
    width: min(500px, 100%);
    padding: 34px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.error-card .brand { justify-content: center; margin-bottom: 22px; }
.error-code { color: var(--brand); font-size: 58px; line-height: 1; font-weight: 700; letter-spacing: -0.05em; margin: 8px 0 10px; }
.error-card h1 { font-size: 22px; margin-bottom: 8px; }
.error-card p { color: var(--muted); font-size: 13px; line-height: 1.55; margin-bottom: 20px; }
.error-actions { display: flex; justify-content: center; }
.brand--center { display: inline-flex; }
.brand-mark--large { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 18px; }
.brand-mark--large .icon { width: 29px; height: 29px; }
.debug-box { padding: 12px; background: var(--surface-3); border-radius: 8px; text-align: left; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 18px; }

/* ---------- Адаптивность ---------- */

@media (max-width: 1240px) {
    .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-grid--users { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
    .topbar-date { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-layout { grid-template-columns: 1fr; }
    .total-card { position: static; }
    .qr-side-card { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
    .qr-side-card > .eyebrow,
    .qr-side-card > h2,
    .qr-side-card > .qr-code-value,
    .qr-side-card > .hint,
    .qr-side-card > .btn,
    .qr-side-card > .feature-list { grid-column: 2; }
    .qr-side-card > .qr-mini-preview { grid-row: 1 / span 6; grid-column: 1; margin-bottom: 0; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.23s ease;
        width: 280px;
    }

    .app-shell.nav-open .sidebar { transform: translateX(0); }
    .app-shell.nav-open .nav-overlay { display: block; opacity: 1; }
    .sidebar-close { display: inline-flex; }
    .main { margin-left: 0; }
    .menu-btn { display: inline-flex; }
    .topbar { min-height: 61px; }
    .topbar-user__copy { display: none; }

    .auth-layout { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-mobile-brand { display: inline-flex; }
    .auth-main { min-height: 100vh; padding: 30px 18px; }
    .auth-card { border-radius: 17px; }

    .install-layout { grid-template-columns: 1fr; width: min(720px, calc(100% - 28px)); }
    .install-aside { display: none; }
    .install-card { border-radius: 17px; }
    .install-mobile-steps {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }
    .install-mobile-steps span {
        padding: 5px 8px;
        border-radius: 6px;
        background: var(--surface-3);
        color: var(--muted);
        font-size: 10.5px;
        font-weight: 600;
    }
    .install-mobile-steps span.is-current { background: var(--brand); color: #fff; }
    .install-mobile-steps span.is-done { background: var(--brand-soft); color: var(--brand-deep); }

    .profile-grid { grid-template-columns: 1fr; }
    .profile-summary { text-align: left; }
    .profile-avatar { margin: 0 0 12px; }
}

@media (max-width: 720px) {
    .page-wrap { padding: 18px 14px 26px; }
    .topbar { padding: 8px 14px; }
    .breadcrumb span:first-child, .breadcrumb-sep { display: none; }
    .page-head { flex-direction: column; gap: 14px; margin-bottom: 18px; }
    .page-actions { width: 100%; justify-content: flex-start; }
    .page-actions .btn { flex: 1 1 auto; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 24px; }
    .summary-strip { flex-wrap: wrap; }
    .summary-item { flex: 1 1 50%; border-left: 1px solid var(--line); }
    .summary-item:nth-child(odd) { border-left: 0; }
    .summary-item:nth-child(n+3) { border-top: 1px solid var(--line); }
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .filter-grid--users { grid-template-columns: 1fr; }
    .filter-grid--report { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-layout .card > .form-grid,
    .form-layout > .card:first-child > .form { padding: 0 15px; }
    .form-layout > .card:first-child > .form-footer { margin: 18px 15px 0; }
    .permissions-grid { grid-template-columns: 1fr; padding: 0 15px; }
    .form-section .form-grid { padding: 0 15px; }
    .card-head { padding: 15px 16px; }
    .table th:first-child, .table td:first-child { padding-left: 16px; }
    .table th:last-child, .table td:last-child { padding-right: 16px; }
    .pagination { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }
    .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .search-form { max-width: none; }
    .toolbar-count { text-align: right; }
    .driver-hero { flex-direction: column; align-items: stretch; }
    .qr-inline { justify-content: flex-start; }
    .qr-side-card { display: block; }
    .qr-side-card > .qr-mini-preview { margin-bottom: 12px; }
    .settings-grid { gap: 12px; }
    .stat-mini-grid { grid-template-columns: 1fr 1fr; }
    .security-card { flex-direction: column; }
    .install-card { padding: 21px 17px; }
    .install-head h2 { font-size: 24px; }
    .requirements-box { margin-top: 15px; }
    .install-topbar__note { display: none; }
    .install-topbar { padding: 14px 16px; }
    .filter-actions { flex-wrap: wrap; }
    .auth-main { padding: 22px 14px; }
    .auth-card { padding: 23px 18px; }
    .daily-chart { height: 210px; padding: 12px 12px 16px; }
    .modal-card { padding: 18px; }
    .qr-canvas { width: 250px; height: 250px; }
    .qr-canvas canvas, .qr-canvas img { width: 240px !important; height: 240px !important; }
}

@media (max-width: 460px) {
    .stats-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr; }
    .summary-item { flex-basis: 100%; border-left: 0 !important; border-top: 1px solid var(--line); }
    .summary-item:first-child { border-top: 0; }
    .page-actions .btn { width: 100%; }
    .auth-main { align-items: flex-start; padding: 22px 14px; }
    .auth-card-wrap { max-width: 100%; }
    .auth-card { border: 0; box-shadow: none; background: transparent; padding: 14px 2px; }
    .auth-copyright { margin-top: 14px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
    .install-actions { flex-direction: column-reverse; gap: 9px; }
    .install-actions .btn { width: 100%; }
    .install-actions--split { flex-direction: column-reverse; }
    .qr-canvas { width: 220px; height: 220px; }
    .qr-canvas canvas, .qr-canvas img { width: 210px !important; height: 210px !important; }
}
