/* =========================
   RESET / BASE
========================= */

* {
    box-sizing: border-box;
}

:root {
    --primary: #f97c07;
    --primary-hover: #d65f0f;
    --primary-soft: #fff4ec;
    --text-main: #0f172a;
    --text-soft: #64748b;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
    --border-card: #edf2f7;
    --bg-page: #f7f9fc;
    --bg-card: #ffffff;
    --success: #22c55e;
    --danger: #ef4444;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    background-color: var(--bg-page);
    color: #222;
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

h1 {
    margin: 0 0 6px 0;
    font-size: 34px;
    line-height: 1.2;
    color: var(--text-main);
}

p.subtitle,
.subtitle {
    margin: 0;
    font-size: 18px;
    line-height: 1.45;
    color: #666;
}

.container {
    width: min(96%, 1600px);
    margin: 0 auto;
    padding: 30px 20px 40px;
}


/* =========================
   NAVBAR
========================= */

.navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    margin: 0 0 30px 0;
    padding: 18px 32px;
    background-color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.navbar-left {
    display: flex;
    align-items: center;
    z-index: 2;
}

.navbar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.navbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    pointer-events: none;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    z-index: 2;
}

.navbar-links a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.navbar-links a:hover {
    color: white;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    z-index: 3;
}

.navbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    border-radius: 999px;
    background: white;
}

.navbar-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-logo-link:hover {
    opacity: 0.8;
}

/* =========================
   BUTTONS
========================= */

.button-primary,
.button-danger,
.button-secondary,
.button-muted {
    display: inline-block;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.button-primary {
    background-color: var(--primary);
    color: white;
}

.button-primary:hover {
    background-color: var(--primary-hover);
}

.button-danger {
    background-color: #c62828;
    color: white;
}

.button-danger:hover {
    background-color: #a61f1f;
}

.button-secondary {
    color: #333;
}

.button-muted {
    background-color: #e8eef8;
    color: #1f57b8;
}

.button-muted:hover {
    background-color: #d9e5fb;
}

.button-small {
    padding: 8px 12px;
    font-size: 13px;
}

.small-link-button {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

/* =========================
   GENERIC TABLES
========================= */

.styled-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.styled-table th,
.styled-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.styled-table th {
    background-color: #f2f4f8;
}

.styled-table tr:hover {
    background-color: #fafcff;
}


/* =========================
   BADGES
========================= */

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-allow {
    background: #dcfce7;
    color: #166534;
}

.status-deny {
    background: #fee2e2;
    color: #991b1b;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}


/* =========================
   CARDS
========================= */

.card {
    max-width: none;
    padding: 22px;
    border-radius: 16px;
    background: var(--bg-card);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card h3 {
    margin-top: 0;
}

.panel-card {
    min-height: 100%;
    border: 1px solid var(--border-card);
}

.panel-card-wide {
    grid-column: 1 / -1;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 250px;
}

.lanes-card {
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.card-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.panel-header h3 {
    margin: 0 0 6px 0;
    font-size: 20px;
    color: var(--text-main);
}

.panel-header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-muted);
}


/* =========================
   PAGE HEADER
========================= */

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

.page-header-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    margin-left: auto;
    flex-wrap: wrap;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: white;
    font-size: 14px;
    color: #374151;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
}


/* =========================
   DASHBOARD LAYOUT
========================= */

.dashboard-top-grid {
    display: grid;
    grid-template-columns: 0.9fr 0.9fr 1.3fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}


/* =========================
   STAT BLOCKS
========================= */

.stat-label {
    display: inline-block;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
}

.stat-label-row,
.panel-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title-row h3 {
    margin: 0;
}

.stat-value {
    margin: 0;
    font-size: 46px;
    line-height: 1;
    color: var(--text-main);
}

.stat-subtitle {
    margin-top: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.stat-meta {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-soft);
}

.stat-description {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-muted);
}


/* =========================
   TOOLTIPS
========================= */

.tooltip-label {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted #9ca3af;
}

.tooltip-label:hover,
.tooltip-label:focus {
    border-bottom-color: #6b7280;
}

.tooltip-label .tooltip-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;

    min-width: 220px;
    max-width: min(260px, 90vw);

    padding: 10px 12px;
    border-radius: 10px;
    background: #111827;
    color: #ffffff;

    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;

    text-transform: none;
    letter-spacing: normal;

    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.tooltip-label:hover .tooltip-box,
.tooltip-label:focus .tooltip-box {
    opacity: 1;
    visibility: visible;
}

/* =========================
   DONUTS
========================= */

.donut-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.donut-block-centered {
    min-height: 0;
}

.donut-chart {
    --p: 100;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 152px;
    height: 152px;
    border-radius: 50%;
    background: conic-gradient(#2d6cdf calc(var(--p) * 1%), #e8eef8 0);
}

.donut-chart::before {
    content: "";
    position: absolute;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: white;
}

.donut-chart-clients {
    background: conic-gradient(#ef7215 calc(var(--p) * 1%), #9ca3af 0);
}

.donut-chart-access {
    background: conic-gradient(#ef7215 calc(var(--p) * 1%), #9ca3af 0);
}

.donut-chart-success {
    background: conic-gradient(var(--primary) calc(var(--p) * 1%), #e8eef8 0);
}

.donut-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.donut-inner span {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.donut-inner small {
    margin-top: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 180px;
    font-size: 14px;
    color: #475569;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
}

.legend-blue {
    background: #2d6cdf;
}

.legend-green {
    background: var(--primary);
}

.legend-red {
    background: #9ca3af;
}

.legend-gray {
    background: #9ca3af;
}


/* =========================
   LANES
========================= */

.lanes-panel-summary {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 18px;
}

.lanes-panel-number {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.lanes-panel-meta {
    font-size: 15px;
    color: var(--text-muted);
}


/* =========================
   DASHBOARD TABLES
========================= */

.dashboard-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.dashboard-table thead th,
.dashboard-table th {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
}

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

.dashboard-table tbody tr:last-child td,
.dashboard-table tr:last-child td {
    border-bottom: none;
}

.table-main-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.table-main-cell strong {
    font-size: 15px;
    color: var(--text-main);
}

.table-main-cell span {
    font-size: 13px;
    color: var(--text-muted);
}

.table-main-cell .lane-output-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
}

.empty-state-cell {
    padding: 28px 10px !important;
    text-align: center !important;
    color: var(--text-muted);
}


/* =========================
   CLIENTS PAGE
========================= */

.clients-header {
    align-items: flex-end;
}

.page-meta {
    margin: 6px 0 0 0;
    font-size: 14px;
    color: var(--text-soft);
}

.clients-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.clients-search-wrap {
    width: 100%;
    min-width: 280px;
    max-width: 360px;
}

.clients-search-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #fff;
    outline: none;
    font-size: 14px;
    color: var(--text-main);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clients-search-input:focus {
    border-color: #2d6cdf;
    box-shadow: 0 0 0 4px rgba(45, 108, 223, 0.10);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row td {
    transition: background-color 0.18s ease;
}

.clickable-row:hover td {
    background-color: #e5e7eb;
}

.clickable-row:hover td:first-child {
    border-left: 4px solid var(--primary);
    padding-left: 8px;
}

.clickable-row:active td {
    background-color: #e8f0fe;
}

.plate-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.muted-text {
    font-size: 14px;
    color: var(--text-muted);
}


/* =========================
   LICENSE PLATE BADGE
========================= */

.plate-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 28px;
    padding: 0.25rem 0.6rem 0.25rem 0.3rem;
    border: 1.5px solid #1f2937;
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    color: #111827;
}

.plate-badge__eu {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 18px;
    margin: -0.3rem 0 -0.3rem -0.35rem;
    border-top-left-radius: calc(0.5rem - 2px);
    border-bottom-left-radius: calc(0.5rem - 2px);
    background: #1d4ed8;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
}

.plate-badge__text {
    font-family: "Poppins", sans-serif;
}


/* =========================
   FORMS
========================= */

.form-card {
    max-width: 520px;
    padding: 24px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.form-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

.form-card input[type="text"],
.form-card input[type="password"],
.form-card input[type="date"],
.form-card select {
    width: 100%;
    margin-bottom: 16px;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.checkbox-line {
    margin-bottom: 14px;
    font-weight: normal;
}

.actions a {
    margin-right: 10px;
    text-decoration: none;
}

.actions a.delete-link {
    color: #c62828;
}


/* =========================
   MODERN FORM
========================= */

.form-card-modern {
    max-width: 720px;
    padding: 30px 30px 24px;
    border: 1px solid var(--border-card);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-section-header {
    margin-bottom: 4px;
}

.form-section-header h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: var(--text-main);
}

.form-section-header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-muted);
}

.form-divider {
    height: 1px;
    margin: 24px 0;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

.optional-field {
    transition: opacity 0.18s ease;
}

.optional-field.disabled {
    opacity: 0.5;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
    margin-bottom: 4px;
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    width: 0;
    height: 0;
    opacity: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 999px;
    background-color: #d1d5db;
    transition: 0.2s ease;
}

.slider:before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: 0.2s ease;
}

.switch input:checked + .slider {
    background-color: var(--primary);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.checkbox-line-modern {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    font-weight: 600;
    color: var(--text-main);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.form-actions .button-primary,
.form-actions .button-secondary {
    margin: 0;
}

.form-actions .button-secondary {
    padding: 10px 4px;
}


/* =========================
   MODAL
========================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.55);
}

.modal-content {
    width: 90%;
    max-width: 900px;
    margin-top: 0;
    border-radius: 0 0 12px 12px;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #ddd;
    background: white;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: #777;
}

.modal-close:hover {
    color: #222;
}

.modal-body {
    padding: 16px;
    text-align: center;
    background: #f7f7f7;
}

.modal-body img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    margin: 0 auto;
    background: white;
}


/* =========================
   TOAST
========================= */

.gate-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 9999;
    max-width: calc(100vw - 32px);
    padding: 14px 18px;
    border-radius: 999px;
    background: #111827;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: white;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gate-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.gate-toast.success {
    background: #166534;
}

.gate-toast.error {
    background: #991b1b;
}


/* =========================
   OPEN GATE BUTTONS
========================= */

.desktop-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    padding: 14px 20px;
    border-radius: 14px;
    background: #1d4ed8;
    box-shadow: 0 8px 20px rgba(198, 40, 40, 0.20);
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.desktop-open-button:hover {
    background: #1d4ed8;
}

.mobile-quick-open {
    display: none;
}

.mobile-open-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 10px 0 20px 0;
    padding: 14px 20px;
    border-radius: 14px;
    background: #2563eb;
    box-shadow: 0 8px 20px rgba(198, 40, 40, 0.20);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.mobile-open-button:hover {
    background: #1d4ed8;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {
    .dashboard-top-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lanes-card,
    .panel-card-wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1100px) {
    .navbar {
        padding: 16px 20px;
    }

    .navbar-title {
        position: static;
        transform: none;
        margin: 0 auto;
        text-align: center;
        font-size: 17px;
        pointer-events: auto;
    }

    .navbar-toggle {
        display: inline-flex;
        align-items: center;
    }

    .navbar-links {
        position: absolute;
        top: calc(100% + 8px);
        right: 20px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        min-width: 220px;
        padding: 10px 0;
        border-radius: 14px;
        background: white;
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
        overflow: hidden;
        z-index: 10;
    }

    .navbar-links.show {
        display: flex;
    }

    .navbar-links a {
        display: block;
        padding: 12px 16px;
        color: black;
        font-size: 14px;
        text-decoration: none;
        white-space: nowrap;
    }

    .navbar-links a:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 1024px) {
    .dashboard-top-grid,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

.form-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    font-size: 14px;
    font-weight: 600;
    color: #991b1b;
}

@media (max-width: 640px) {
    body {
        margin: 0;
        padding: 0;
    }

    .navbar {
        position: relative;
        min-height: auto;
        margin: 0 0 16px 0;
        padding: 14px 16px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
    }

    .navbar-left {
        display: flex;
        align-items: center;
    }

    .navbar-logo {
        height: 34px;
        width: auto;
    }

    .navbar-title {
        display: none;
    }

    .navbar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        margin-left: auto;
    }

    .navbar-links {
        top: calc(100% + 8px);
        left: 16px;
        right: 16px;
        min-width: 0;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 16px 16px 24px;
        overflow-x: hidden;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 14px;
    }

    .page-header-main {
        width: 100%;
        gap: 6px;
    }

    .header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        gap: 12px;
    }

    .header-badge {
        align-self: flex-start;
        max-width: 100%;
        margin-left: 0;
        padding: 10px 14px;
        font-size: 14px;
    }

    .desktop-open-button,
    .header-actions > a,
    .header-actions .button-danger {
        display: none !important;
    }

    .mobile-quick-open {
        display: block;
        width: 100%;
    }

    h1 {
        margin-bottom: 4px;
        font-size: 28px;
        line-height: 1.1;
    }

    p.subtitle,
    .subtitle {
        max-width: 100%;
        font-size: 15px;
        line-height: 1.35;
    }

    .mobile-open-button {
        margin: 8px 0 14px 0;
        padding: 13px 16px;
        border-radius: 16px;
        font-size: 16px;
        font-weight: 600;
    }

    .dashboard-top-grid,
    .dashboard-bottom-grid {
        width: 100%;
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .card,
    .stat-card,
    .panel-card,
    .panel-card-wide,
    .lanes-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: auto;
        padding: 16px 14px;
        border-radius: 18px;
        overflow: hidden;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value,
    .lanes-panel-number {
        font-size: 26px;
    }

    .stat-subtitle,
    .stat-meta,
    .stat-description,
    .lanes-panel-meta {
        font-size: 13px;
    }

    .donut-block,
    .donut-block-centered {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        width: 100%;
        margin-top: 14px;
        min-height: 0;
    }

    .donut-chart {
        width: 112px;
        height: 112px;
    }

    .donut-chart::before {
        width: 80px;
        height: 80px;
    }

    .donut-inner span {
        font-size: 24px;
    }

    .donut-inner small {
        margin-top: 4px;
        font-size: 10px;
    }

    .donut-legend {
        width: 100%;
        min-width: 0;
        gap: 8px;
        font-size: 13px;
    }

    .panel-header {
        margin-bottom: 14px;
    }

    .panel-header h3 {
        font-size: 24px;
        line-height: 1.2;
    }

    .panel-header p {
        font-size: 14px;
        line-height: 1.4;
    }

    .button-primary,
    .button-danger,
    .button-muted,
    .button-small {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 0 0 10px 0;
        padding: 14px 16px;
        border-radius: 12px;
        text-align: center;
        font-size: 17px;
    }

    .dashboard-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 12px 10px;
        white-space: nowrap;
        font-size: 14px;
    }

    .table-main-cell {
        min-width: 140px;
    }

    .lanes-panel-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .clients-header {
        align-items: flex-start;
    }

    .clients-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-search-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .page-meta {
        font-size: 13px;
        line-height: 1.4;
    }

    .plate-tags {
        gap: 6px;
    }

    .form-card-modern {
        max-width: 100%;
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .button-secondary {
        padding: 12px 16px;
        text-align: center;
    }

    .gate-toast {
        bottom: 18px;
        padding: 12px 16px;
        font-size: 14px;
    }
}

.events-summary-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.events-limit-inline {
    min-width: 78px;
    max-width: 90px;
    padding: 6px 10px;
    border: 1px solid #d9dee7;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    color: var(--text-main);
}

.status-neutral {
    background: #f3f4f6;
    color: #4b5563;
}

.logs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.logs-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logs-toolbar-left h3 {
    margin: 0;
}

.logs-toolbar-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.logs-filter-control {
    height: 42px;
    padding: 0 14px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.logs-filter-control:focus {
    border-color: #2d6cdf;
    box-shadow: 0 0 0 4px rgba(45, 108, 223, 0.10);
}

.logs-filter-small {
    min-width: 160px;
}

.logs-filter-search {
    min-width: 220px;
}

.logs-filter-date {
    min-width: 150px;
}

.logs-clear-button {
    height: 42px;
    padding: 0 14px;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .logs-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .logs-toolbar-right {
        justify-content: stretch;
    }

    .logs-filter-control,
    .logs-clear-button {
        width: 100%;
        min-width: 0;
    }
}

.navbar-user {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0.75rem;
    white-space: nowrap;
}

/* =========================
   LOGIN PAGE
========================= */

.login-page {
    min-height: 100vh;
    background: var(--bg-page);
}

.login-header {
    display: flex;
    align-items: center;
    height: 96px;
    padding: 0 40px;
    background: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.login-logo {
    height: 40px;
    width: auto;
}

.login-main {
    display: flex;
    justify-content: center;
    padding: 64px 20px;
}

.login-card {
    width: min(100%, 420px);
    padding: 32px;
    border: 1px solid var(--border-card);
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.login-card h1 {
    margin-bottom: 28px;
    font-size: 24px;
}

.login-button {
    display: inline-block;
}

.login-success {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #dcfce7;
    color: #166534;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .login-header {
        height: 72px;
        padding: 0 20px;
    }

    .login-logo {
        height: 34px;
    }

    .login-main {
        padding: 40px 16px;
    }
}