/* =====================================================================
   GBAO Transport Terminal — admin theme
   Palette grounded in the Pamir: deep night slate + high-altitude teal,
   warm amber for highlights. Operational clarity over decoration.
   ===================================================================== */
:root {
    --ink:        #0e1828;   /* deep night — sidebar */
    --ink-2:      #16243a;   /* raised night */
    --surface:    #eef2f7;   /* app background */
    --card:       #ffffff;
    --text:       #1b2735;   /* primary text on light */
    --text-soft:  #5b6b7e;   /* secondary text */
    --line:       #e1e7ef;   /* hairline borders */
    --primary:    #15788c;   /* Pamir lake teal */
    --primary-d:  #0f5a69;
    --primary-l:  #e3f1f3;
    --amber:      #d9912f;   /* sun on peaks */
    --amber-l:    #fbf0db;
    --green:      #1f9d57;
    --green-l:    #e3f5ea;
    --red:        #d23b3b;
    --red-l:      #fbe6e6;
    --blue:       #2f6fd0;
    --blue-l:     #e6effb;
    --slate:      #64748b;
    --slate-l:    #eef1f5;
    --radius:     12px;
    --radius-sm:  8px;
    --shadow:     0 1px 2px rgba(16,30,54,.06), 0 8px 24px rgba(16,30,54,.06);
    --shadow-sm:  0 1px 2px rgba(16,30,54,.08);
    --font:       'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display:    'Manrope', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
h1, h2, h3 { font-family: var(--display); color: var(--text); margin: 0; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 256px; flex-shrink: 0;
    background: var(--ink);
    color: #c7d2e0;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 20px; }
.brand__mark {
    width: 42px; height: 42px; border-radius: 10px;
    object-fit: contain; display: block; background: transparent;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { color: #fff; font-size: 16px; font-family: var(--display); }
.brand__text span { color: #7e8ea3; font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav__title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: #5e6f86; margin: 16px 10px 6px; font-weight: 600;
}
.nav__link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    color: #b9c5d6; font-weight: 500; font-size: 14px;
    transition: background .15s, color .15s;
}
.nav__link:hover { background: var(--ink-2); color: #fff; }
.nav__link.is-active { background: var(--primary); color: #fff; }
.nav__link.is-active .ico { opacity: 1; }
.nav__link .ico { width: 19px; height: 19px; opacity: .8; flex-shrink: 0; }
.nav__logout { margin-top: 8px; border-top: 1px solid var(--ink-2); padding-top: 14px; color: #93a2b8; }
.nav__logout:hover { background: transparent; color: #ff9c9c; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 0 24px; height: 62px; position: sticky; top: 0; z-index: 20;
}
.topbar__title h1 { font-size: 18px; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar__board {
    font-size: 13px; font-weight: 600; color: var(--primary);
    padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
}
.topbar__board:hover { background: var(--primary-l); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--ink); color: #fff; display: grid; place-items: center;
    font-weight: 700; font-family: var(--display); font-size: 15px;
}
.topbar__meta { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__meta strong { font-size: 13.5px; }
.topbar__meta span { font-size: 12px; color: var(--text-soft); }
.topbar__burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.topbar__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

.content { padding: 24px; flex: 1; max-width: 1280px; width: 100%; }
.appfoot {
    padding: 16px 24px; color: var(--text-soft); font-size: 12.5px;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { color: var(--text-soft); margin: 0; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- cards */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 20px; margin-bottom: 18px;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2 { font-size: 16px; }
.card h2 { font-size: 16px; }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 8px; }
.stat {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat__label { color: var(--text-soft); font-size: 13px; font-weight: 500; }
.stat__value { font-family: var(--display); font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat__sub { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }
.stat__ico {
    position: absolute; right: 14px; top: 16px; width: 38px; height: 38px;
    border-radius: 10px; display: grid; place-items: center; background: var(--primary-l); color: var(--primary);
}
.stat__ico .ico { width: 20px; height: 20px; }
.stat--amber .stat__ico { background: var(--amber-l); color: var(--amber); }
.stat--green .stat__ico { background: var(--green-l); color: var(--green); }
.stat--blue  .stat__ico { background: var(--blue-l);  color: var(--blue); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; }
table.data thead th {
    background: var(--slate-l); color: var(--text-soft);
    font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: #f7fafc; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .muted { color: var(--text-soft); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------------------------------------------------------------- pills */
.pill {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill--green  { background: var(--green-l); color: #137a40; }
.pill--red    { background: var(--red-l);   color: #b32424; }
.pill--amber  { background: var(--amber-l); color: #9a6213; }
.pill--blue   { background: var(--blue-l);  color: #20559c; }
.pill--slate  { background: var(--slate-l); color: #475569; }
.pill--teal   { background: var(--primary-l); color: var(--primary-d); }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--primary);
    background: var(--primary); color: #fff; font-weight: 600; font-size: 14px;
    font-family: var(--font); transition: background .15s, border-color .15s, transform .05s;
    line-height: 1; text-decoration: none;
}
.btn:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--slate-l); color: var(--text); border-color: var(--line); }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--danger { background: var(--red); border-color: var(--red); }
.btn--danger:hover { background: #b32424; border-color: #b32424; }
.btn--amber { background: var(--amber); border-color: var(--amber); }
.btn--amber:hover { background: #b9791f; border-color: #b9791f; color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--primary); cursor: pointer; font-weight: 600; font-size: 13px; padding: 6px 8px; }
.btn-link--danger { color: var(--red); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint, .field-hint { font-size: 12px; color: var(--text-soft); }
.field.full { grid-column: 1 / -1; }
input, select, textarea {
    font-family: var(--font); font-size: 14.5px; color: var(--text);
    padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,120,140,.15);
}
textarea { resize: vertical; min-height: 70px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* ---------------------------------------------------------------- alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; font-weight: 500; border: 1px solid transparent; }
.alert--success { background: var(--green-l); color: #137a40; border-color: #bfe6cd; }
.alert--error   { background: var(--red-l);   color: #b32424; border-color: #f1c4c4; }
.alert--info    { background: var(--blue-l);  color: #20559c; border-color: #c5dcf6; }
.alert--warning { background: var(--amber-l); color: #9a6213; border-color: #ecd7a8; }

/* empty / misc */
.empty { text-align: center; padding: 48px 20px; color: var(--text-soft); }
.empty h2 { margin-bottom: 8px; }
.muted { color: var(--text-soft); }
.tag-type { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters .field { margin: 0; }

/* card top bar (counts / totals) */
.card-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
    padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-h { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--text);
    margin: 0 0 12px; letter-spacing: -.01em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* payment summary + method picker */
.pay-summary { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; margin-bottom: 18px;
    background: var(--primary-l); border: 1px solid var(--line); border-radius: 12px; }
.pay-summary .amount { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--primary); }
.pay-summary .what { color: var(--text-soft); font-size: 14px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-card span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 10px;
    border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; color: var(--text-soft);
    cursor: pointer; transition: all .15s; }
.radio-card input:checked + span { border-color: var(--primary); background: var(--primary-l); color: var(--primary); }

/* ===================================================================
   LOGIN
   =================================================================== */
.login-wrap {
    min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
    background: var(--ink);
}
.login-aside {
    position: relative; padding: 48px; color: #fff; display: flex; flex-direction: column;
    justify-content: space-between; overflow: hidden;
    background:
        radial-gradient(120% 90% at 80% -10%, rgba(21,120,140,.55), transparent 60%),
        radial-gradient(90% 80% at -10% 110%, rgba(217,145,47,.30), transparent 55%),
        var(--ink);
}

/* Фоновая иллюстрация «умная парковка» */
.login-aside::before {
    content: ""; position: absolute; inset: 0;
    background: url("../img/smart-parking.svg") center bottom / cover no-repeat;
    opacity: .5;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 34%, #000 100%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 34%, #000 100%);
    pointer-events: none;
    z-index: 0;
}
.login-aside .ribbon { position: relative; z-index: 1; }
.login-aside .badge { display: inline-flex; align-items: center; gap: 10px; }
.login-aside .badge .brand__mark { width: 46px; height: 46px; }
.login-aside h2 { color: #fff; font-size: 30px; line-height: 1.15; margin: 28px 0 14px; max-width: 13ch; }
.login-aside p { color: #aebbcd; max-width: 40ch; position: relative; z-index: 1; }
.login-aside .peaks { position: relative; z-index: 1; display: flex; gap: 22px; flex-wrap: wrap; margin-top: 22px; }
.login-aside .peaks div { font-size: 13px; color: #8c9cb4; }
.login-aside .peaks strong { display: block; color: #fff; font-family: var(--display); font-size: 18px; }

.login-form-side { background: var(--surface); display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--text-soft); margin-bottom: 26px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.login-hint { margin-top: 18px; font-size: 12.5px; color: var(--text-soft); text-align: center; }

/* ===================================================================
   PUBLIC ONLINE BOARD
   =================================================================== */
.board-body { background: #0a1320; color: #e8eef7; font-family: var(--font); margin: 0; }
.board {
    max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px;
}
.board__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.board__brand { display: flex; align-items: center; gap: 14px; }
.board__brand .brand__mark { width: 52px; height: 52px; font-size: 15px; }
.board__brand h1 { color: #fff; font-size: 22px; }
.board__brand span { color: #8ba0bd; font-size: 14px; }
.board__clock { text-align: right; }
.board__clock .time { font-family: var(--display); font-size: 34px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.board__clock .date { color: #8ba0bd; font-size: 14px; }
.board__table { width: 100%; border-collapse: collapse; background: #0f1c30; border-radius: 14px; overflow: hidden; }
.board__table th {
    text-align: left; padding: 14px 16px; font-size: 12px; text-transform: uppercase;
    letter-spacing: .06em; color: #7e93b2; background: #13243d; border-bottom: 1px solid #1d3150;
}
.board__table td { padding: 16px; border-bottom: 1px solid #16273f; font-size: 16px; }
.board__table tr:last-child td { border-bottom: 0; }
.board__table .route { font-weight: 600; color: #fff; font-size: 17px; }
.board__table .plate {
    font-family: var(--display); font-weight: 700; letter-spacing: .04em;
    background: #1b2d49; padding: 4px 10px; border-radius: 7px; display: inline-block; color: #cfe0f5;
}
.board__table .time { font-family: var(--display); font-weight: 700; font-size: 19px; color: #fff; font-variant-numeric: tabular-nums; }
.b-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 5px 13px; border-radius: 999px; font-size: 13px; }
.b-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.b-waiting  { background: rgba(47,111,208,.16);  color: #6ea8ff; }
.b-departed { background: rgba(31,157,87,.16);   color: #58d68d; }
.b-delayed  { background: rgba(217,145,47,.18);  color: #f0b860; animation: blink 1.4s infinite; }
.b-cancelled{ background: rgba(210,59,59,.16);   color: #f08080; }
@keyframes blink { 50% { opacity: .55; } }
.board__foot { margin-top: 26px; color: #6f84a3; font-size: 13px; text-align: center; }
.board__empty { text-align: center; padding: 50px; color: #6f84a3; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 920px) {
    .sidebar {
        position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%);
        transition: transform .22s ease; box-shadow: 8px 0 30px rgba(0,0,0,.25);
    }
    .sidebar.is-open { transform: translateX(0); }
    .topbar__burger { display: flex; }
    .scrim { position: fixed; inset: 0; background: rgba(8,14,24,.5); z-index: 40; display: none; }
    .scrim.is-open { display: block; }
}
@media (max-width: 760px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .topbar__meta { display: none; }
    .content { padding: 16px; }
}

/* ===================================================================
   ОНЛАЙН-ТАБЛО — МОБИЛЬНАЯ ВЕРСИЯ
   =================================================================== */
@media (max-width: 720px) {
    .board { padding: 14px; }
    .board__top { flex-direction: column; gap: 10px; align-items: flex-start; }
    .board__clock .time { font-size: 28px; }
    .board__brand h1 { font-size: 18px; }
    /* Таблица -> карточки: скрываем шапку, каждая строка — блок */
    .board__table thead { display: none; }
    .board__table, .board__table tbody, .board__table tr, .board__table td { display: block; width: 100%; }
    .board__table tr {
        border: 1px solid #16273f; border-radius: 12px; margin-bottom: 10px;
        padding: 10px 12px; background: rgba(255,255,255,.02);
    }
    .board__table td { padding: 4px 0; border-bottom: 0; font-size: 15px; }
    .board__table td .time { font-size: 22px; }
    .board__table td .route { font-size: 16px; }
    .board__table td .plate { font-size: 13px; }
    /* Порядок: время и маршрут сверху, статус выделен */
    .board__table td:nth-child(1) { float: left; margin-right: 12px; }
    .board__table td:nth-child(5) { margin-top: 6px; }
    .b-status { font-size: 13px; padding: 5px 12px; }
}

/* ===== Переключатель языков ===== */
.lang-switch{display:inline-flex;gap:2px;align-items:center;background:var(--panel-2,#eef2f6);border:1px solid var(--line);border-radius:9px;padding:3px}
.lang-switch a{padding:4px 9px;border-radius:7px;font-size:12.5px;font-weight:700;color:var(--text-soft);text-decoration:none;letter-spacing:.02em}
.lang-switch a.cur{background:var(--primary);color:#fff}
.lang-switch a:not(.cur):hover{background:rgba(0,0,0,.06);color:var(--text)}
