
@font-face {
    font-family: "Cal Sans UI";
    src:
        local("Cal Sans UI"),
        local("CalSans UI"),
        url("/assets/fonts/CalSansUI-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
}

@font-face {
    font-family: "Cal Sans UI";
    src:
        local("Cal Sans UI Semibold"),
        local("CalSans UI Semibold"),
        url("/assets/fonts/CalSansUI-Semibold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600 900;
    font-display: swap;
}

:root {
    --accent: #00539f;
    --accent-rgb: 0, 83, 159;
    --accent-dark: color-mix(in srgb, var(--accent) 80%, #001d3b);
    --accent-soft: color-mix(in srgb, var(--accent) 11%, #ffffff);
    --tesco-red: #e21b2d;
    --navy: #071d49;
    --page-bg: #f2f4f7;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --surface-3: #e9edf2;
    --text: #182230;
    --muted: #667085;
    --line: #dfe4ea;
    --success: #14804a;
    --warning: #a15c00;
    --danger: #b42318;
    --info: #175cd3;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 11px;
    --shadow-card: 0 8px 28px rgba(16, 24, 40, .07);
    --content-gap: 22px;
    --sidebar-width: 276px;
}

html[data-theme="dark"] {
    --page-bg: #0c1118;
    --surface: #161d26;
    --surface-2: #1d2631;
    --surface-3: #293441;
    --text: #f2f4f7;
    --muted: #aab4c0;
    --line: #303c49;
    --shadow-card: none;
    --accent-soft: color-mix(in srgb, var(--accent) 26%, #161d26);
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        --page-bg: #0c1118;
        --surface: #161d26;
        --surface-2: #1d2631;
        --surface-3: #293441;
        --text: #f2f4f7;
        --muted: #aab4c0;
        --line: #303c49;
        --shadow-card: none;
        --accent-soft: color-mix(in srgb, var(--accent) 26%, #161d26);
    }
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Cal Sans UI", Arial, "Helvetica Neue", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.icon { width: 21px; height: 21px; flex: 0 0 auto; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.35rem, 2vw, 1.8rem); letter-spacing: -.025em; }
h2 { margin-bottom: .45rem; font-size: 1.22rem; letter-spacing: -.018em; }
p { line-height: 1.55; }
code { padding: 2px 6px; border-radius: 6px; background: var(--surface-3); }

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}
html[data-sidebar="dark"] .portal-sidebar {
    --text: #ffffff;
    --muted: #a9b8d3;
    --line: rgba(255,255,255,.12);
    --surface-2: rgba(255,255,255,.08);
    background: var(--navy);
}

.portal-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 10px 28px;
    text-decoration: none;
}
.portal-logo-symbol {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), var(--accent-dark));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 30%, transparent);
    font-size: 1.45rem;
    font-weight: 900;
}
.portal-logo-text strong,
.portal-logo-text small { display: block; }
.portal-logo-text strong {
    color: var(--navy);
    font-size: 1.04rem;
    letter-spacing: .025em;
}
html[data-sidebar="dark"] .portal-logo-text strong { color: #fff; }
.portal-logo-text small { margin-top: 3px; color: var(--muted); font-size: .72rem; }

.portal-nav { display: grid; gap: 5px; }
.nav-section-label {
    padding: 14px 12px 7px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.portal-nav-link {
    min-height: 48px;
    display: grid;
    grid-template-columns: 22px 1fr 18px;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-radius: 13px;
    color: var(--muted);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 700;
    transition: background .15s, color .15s, transform .15s;
}
.portal-nav-link .icon:last-child { width: 16px; height: 16px; opacity: .4; }
.portal-nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
    transform: translateX(2px);
}
.portal-nav-link.active {
    color: var(--accent-dark);
    background: var(--accent-soft);
}
.portal-nav-link.active::before {
    content: "";
    position: absolute;
}
html[data-sidebar="dark"] .portal-nav-link.active {
    color: #fff;
    background: color-mix(in srgb, var(--accent) 65%, transparent);
}

.sidebar-account-card {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border-radius: 15px;
    background: var(--surface-2);
}
.sidebar-account-card strong,
.sidebar-account-card small { display: block; }
.sidebar-account-card strong {
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .86rem;
}
.sidebar-account-card small { margin-top: 2px; color: var(--muted); font-size: .72rem; }

.portal-main { min-width: 0; }
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px clamp(20px, 3.3vw, 46px);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px);
}
.topbar-title-group { display: flex; align-items: center; gap: 12px; }
.page-kicker, .card-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.round-action {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    background: var(--surface);
}
.notification-dot {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--tesco-red);
}
.topbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    text-decoration: none;
    background: var(--surface-2);
}
.topbar-profile-text strong,
.topbar-profile-text small { display: block; }
.topbar-profile-text strong { font-size: .82rem; }
.topbar-profile-text small { margin-top: 2px; color: var(--muted); font-size: .68rem; }

.avatar {
    width: 38px;
    height: 38px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-weight: 900;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small { width: 36px; height: 36px; }

.mobile-menu-button {
    display: none;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    color: var(--text);
    background: var(--surface-2);
}

.portal-content {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: clamp(22px, 3.5vw, 48px);
    padding-bottom: 108px;
}

.welcome-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
    margin-bottom: 24px;
}
.welcome-title { margin-bottom: 7px; font-size: clamp(1.65rem, 3vw, 2.45rem); }
.welcome-row p { margin-bottom: 0; color: var(--muted); }
.dashboard-controls { display: flex; gap: 10px; flex-wrap: wrap; }

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: .72rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 800;
    line-height: 1;
}
.button .icon { width: 18px; height: 18px; }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: var(--accent-soft); }
.button-ghost { color: var(--text); border-color: var(--line); background: var(--surface); }
.button-white { color: var(--accent-dark); background: #fff; }
.button-danger { color: #fff; background: var(--danger); }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--content-gap);
    align-items: start;
}
.widget-slot { grid-column: span 4; min-width: 0; }
.widget-slot:has(.widget-wide) { grid-column: span 8; }
.widget-slot.is-hidden-widget { display: none; }

.dashboard-widget,
.content-card,
.toolbar-card,
.document-category,
.profile-header-card,
.logout-card {
    position: relative;
    min-height: 100%;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}
.dashboard-widget { min-height: 260px; }
.widget-wide { min-height: 300px; }
.widget-header, .content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}
.icon-tile, .document-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-soft);
}
.widget-accent {
    overflow: hidden;
    color: #fff;
    border: 0;
    background:
        linear-gradient(120deg, var(--accent-dark), var(--accent));
}
.widget-accent .card-label { color: rgba(255,255,255,.7); }
.widget-accent h2 { max-width: 780px; font-size: clamp(1.6rem, 3vw, 2.55rem); }
.widget-accent p { max-width: 730px; color: rgba(255,255,255,.82); }
.accent-card-content { position: relative; z-index: 2; }
.accent-card-decoration {
    position: absolute;
    right: -80px;
    bottom: -110px;
    width: 330px;
    height: 330px;
    border: 38px solid rgba(255,255,255,.1);
    border-radius: 50%;
}
.accent-card-decoration::after {
    content: "";
    position: absolute;
    inset: 42px;
    border: 28px solid rgba(255,255,255,.08);
    border-radius: 50%;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}
.shortcut-grid a {
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 9px;
    padding: 13px;
    border-radius: 14px;
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 800;
}
.shortcut-grid a:hover { color: var(--accent-dark); background: var(--accent-soft); }
.shortcut-grid .icon { color: var(--accent); }

.vehicle-number, .large-value {
    margin-top: 25px;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -.06em;
    color: var(--accent);
}
.widget-muted { color: var(--muted); }
.small-text { font-size: .8rem; }
.inline-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    color: var(--accent-dark);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 900;
}
.inline-link .icon { width: 17px; height: 17px; }

.empty-card, .centered-empty {
    display: grid;
    justify-items: center;
    text-align: center;
    color: var(--muted);
}
.empty-card {
    min-height: 135px;
    align-content: center;
    margin-top: 10px;
}
.empty-card .icon, .centered-empty > .icon {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    color: var(--accent);
}
.empty-card strong, .empty-card span { display: block; }
.empty-card span { max-width: 280px; margin-top: 5px; font-size: .78rem; }

.count-pill, .status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: .7rem;
    font-weight: 900;
}
.compact-details, .detail-list { margin: 18px 0 0; }
.compact-details div, .detail-list div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}
.compact-details dt, .compact-details dd,
.detail-list dt, .detail-list dd { margin: 0; }
.compact-details dt, .detail-list dt { color: var(--muted); font-size: .82rem; }
.compact-details dd, .detail-list dd { text-align: right; font-weight: 800; }

.system-status-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: .84rem;
}
.status-light {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 50%;
}
.status-light.online { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }
.status-light.offline { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }

.widget-drag-handle, .widget-hide-button { display: none; }
.dashboard-editing .dashboard-widget {
    outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: -7px;
}
.dashboard-editing .widget-drag-handle {
    position: absolute;
    z-index: 5;
    top: 12px;
    left: 12px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: var(--text);
    background: var(--surface);
    cursor: grab;
    box-shadow: var(--shadow-card);
}
.dashboard-editing .widget-hide-button {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 11px;
    color: var(--danger);
    background: var(--surface);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}
.dashboard-editing .widget-slot { cursor: grab; }
.dashboard-editing .widget-slot.dragging { opacity: .45; }

.dashboard-edit-bar, .widget-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
    border-radius: 16px;
    background: var(--accent-soft);
}
.dashboard-edit-bar[hidden], .widget-picker[hidden] { display: none; }
.dashboard-edit-bar > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
.dashboard-edit-bar strong, .dashboard-edit-bar span,
.widget-picker strong, .widget-picker span { display: block; }
.dashboard-edit-bar span, .widget-picker span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.widget-picker { align-items: flex-start; }
.widget-picker-items { display: flex; gap: 8px; flex-wrap: wrap; }
.widget-picker-items button {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
}

.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    line-height: 1.5;
}
.notice-warning { color: #7a4a00; background: #fff1c7; }
.notice-error { color: #8f1d13; background: #fee4e2; }
.notice-success { color: #065f36; background: #dff7e9; }
.notice-info { color: #174ea6; background: #e3efff; }

.section-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    margin-bottom: var(--content-gap);
    padding: clamp(24px, 4vw, 42px);
    border-radius: var(--radius-lg);
}
.blue-hero { color: #fff; background: linear-gradient(115deg, var(--navy), var(--accent)); }
.blue-hero .card-label { color: rgba(255,255,255,.65); }
.blue-hero p { margin-bottom: 0; color: rgba(255,255,255,.82); }
.hero-icon .icon { width: 84px; height: 84px; opacity: .2; }

.page-grid { display: grid; gap: var(--content-gap); }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.main-aside { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); }
.action-stack { display: grid; gap: 9px; margin-top: 20px; }

.toolbar-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: var(--content-gap);
}
.date-form { display: flex; align-items: center; gap: 8px; }
input, select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    background: var(--surface-2);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { resize: vertical; }
.schedule-card {
    display: grid;
    grid-template-columns: 104px 1fr auto;
    align-items: center;
    gap: 24px;
}
.schedule-date {
    display: grid;
    place-items: center;
    min-height: 96px;
    border-radius: 16px;
    color: #fff;
    background: var(--accent);
}
.schedule-date strong { font-size: 2rem; }
.schedule-date span { font-size: .65rem; font-weight: 900; }
.schedule-main p { margin-bottom: 0; color: var(--muted); }
.schedule-time { text-align: right; }
.schedule-time strong, .schedule-time span { display: block; }
.schedule-time strong { font-size: 1.55rem; }
.schedule-time span { margin-top: 5px; color: var(--muted); }

.centered-empty { min-height: 330px; align-content: center; padding: 40px; }
.compact-empty { min-height: 250px; }
.centered-empty p { max-width: 460px; margin-bottom: 0; }
.filter-list { display: grid; gap: 7px; margin-top: 18px; }
.filter-list button {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border: 0;
    border-radius: 11px;
    color: var(--muted);
    background: var(--surface-2);
    cursor: pointer;
    font-weight: 800;
}
.filter-list button.active { color: var(--accent-dark); background: var(--accent-soft); }

.portal-form { display: grid; gap: 15px; margin-top: 20px; }
.portal-form label, .settings-fields label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
}
.mini-empty { padding: 26px 0; color: var(--muted); text-align: center; }
.report-list { display: grid; gap: 10px; margin-top: 15px; }
.report-list article {
    display: grid;
    gap: 5px;
    padding: 13px;
    border-radius: 12px;
    background: var(--surface-2);
}
.report-list small { color: var(--muted); }

.document-grid { display: grid; gap: 14px; margin-bottom: 20px; }
.document-category {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 16px;
}
.document-category h2 { margin-bottom: 4px; }
.document-category p { margin-bottom: 0; color: var(--muted); }

.profile-header-card {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: var(--content-gap);
    color: #fff;
    background: linear-gradient(120deg, var(--navy), var(--accent));
}
.profile-header-card .card-label { color: rgba(255,255,255,.65); }
.profile-header-card p { margin-bottom: 0; color: rgba(255,255,255,.8); }
.profile-avatar-large {
    width: 86px;
    height: 86px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 4px solid rgba(255,255,255,.28);
    border-radius: 50%;
    color: var(--accent);
    background: #fff;
    font-size: 2rem;
    font-weight: 900;
}
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.logout-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: var(--content-gap);
}
.logout-card strong, .logout-card span { display: block; }
.logout-card span { margin-top: 4px; color: var(--muted); font-size: .82rem; }

.settings-layout { display: grid; gap: var(--content-gap); }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.choice-card {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
}
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-preview { height: 84px; border-radius: 10px; border: 1px solid var(--line); }
.theme-preview-light { background: linear-gradient(90deg, #fff 30%, #f2f4f7 30%); }
.theme-preview-dark { background: linear-gradient(90deg, #151d26 30%, #0c1118 30%); }
.theme-preview-system { background: linear-gradient(135deg, #fff 50%, #151d26 50%); }
.color-options { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.color-options label { display: grid; justify-items: center; gap: 7px; cursor: pointer; }
.color-options input { position: absolute; opacity: 0; pointer-events: none; }
.color-options span {
    width: 44px;
    height: 44px;
    border: 4px solid var(--surface);
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: 0 0 0 1px var(--line);
}
.color-options label:has(input:checked) span { box-shadow: 0 0 0 3px var(--accent); }
.color-options small { color: var(--muted); font-size: .64rem; }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.settings-submit { display: flex; gap: 10px; }

.mobile-bottom-nav { display: none; }
.mobile-scrim { display: none; }

html[data-density="compact"] {
    --content-gap: 14px;
    --radius-lg: 18px;
}
html[data-density="compact"] .portal-content { padding-top: 28px; }
html[data-density="compact"] .dashboard-widget,
html[data-density="compact"] .content-card { padding: 18px; }
html[data-density="compact"] .dashboard-widget { min-height: 220px; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 5% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 35%),
        linear-gradient(135deg, #f5f7fa, #e9edf3);
}
.login-shell {
    width: min(100%, 1060px);
    display: grid;
    grid-template-columns: 1.25fr 430px;
    overflow: hidden;
    border-radius: 30px;
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(7,29,73,.18);
}
.login-brand {
    min-height: 610px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: #fff;
    background:
        radial-gradient(circle at 110% 90%, rgba(255,255,255,.16) 0 22%, transparent 22% 29%, rgba(255,255,255,.10) 29% 37%, transparent 37%),
        linear-gradient(145deg, var(--navy), var(--accent));
}
.login-brand-row { display: flex; align-items: center; gap: 12px; }
.login-brand-copy h1 { max-width: 520px; margin-bottom: 15px; font-size: clamp(2rem, 4vw, 3.6rem); }
.login-brand-copy p { max-width: 480px; color: rgba(255,255,255,.78); }
.login-card { padding: 48px 38px; align-self: center; }
.login-card h1 { font-size: 2rem; }
.login-card form { display: grid; gap: 15px; margin-top: 28px; }
.login-card label { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 900; }
.login-help { margin: 18px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.alert { margin-bottom: 16px; padding: 13px 14px; border-radius: 12px; }
.alert-danger { color: #8f1d13; background: #fee4e2; }
.button-block { width: 100%; }

@media (max-width: 1180px) {
    .widget-slot { grid-column: span 6; }
    .widget-slot:has(.widget-wide) { grid-column: span 12; }
}
@media (max-width: 920px) {
    :root { --sidebar-width: 255px; }
    .page-grid.two-columns, .main-aside { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .portal-shell { display: block; }
    .portal-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(88vw, 320px);
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 18px 0 50px rgba(0,0,0,.22);
    }
    body.sidebar-open .portal-sidebar { transform: translateX(0); }
    .mobile-scrim {
        position: fixed;
        inset: 0;
        z-index: 25;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(6,15,30,.48);
        transition: opacity .2s;
    }
    body.sidebar-open .mobile-scrim { visibility: visible; opacity: 1; }
    .mobile-menu-button { display: grid; }
    .portal-topbar { min-height: 72px; padding: 11px 15px; }
    .topbar-profile-text { display: none; }
    .topbar-profile { padding: 4px; }
    .round-action { width: 42px; height: 42px; }
    .portal-content { padding: 20px 15px 100px; }
    .welcome-row { align-items: flex-start; flex-direction: column; }
    .dashboard-controls { width: 100%; }
    .dashboard-controls .button { flex: 1; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
    .widget-slot, .widget-slot:has(.widget-wide) { grid-column: auto; }
    .dashboard-widget, .widget-wide { min-height: auto; }
    .widget-accent h2 { font-size: 1.7rem; }
    .shortcut-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-edit-bar, .widget-picker {
        align-items: stretch;
        flex-direction: column;
    }
    .dashboard-edit-bar > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
    .schedule-card { grid-template-columns: 74px 1fr; }
    .schedule-time { grid-column: 2; text-align: left; }
    .toolbar-card { align-items: stretch; flex-direction: column; }
    .date-form { width: 100%; }
    .date-form input { min-width: 0; }
    .document-category { grid-template-columns: 46px 1fr; }
    .document-category .count-pill { grid-column: 2; justify-self: start; }
    .choice-grid { grid-template-columns: 1fr; }
    .settings-fields { grid-template-columns: 1fr; }
    .settings-submit { display: grid; }
    .logout-card { align-items: stretch; flex-direction: column; }
    .mobile-bottom-nav {
        position: fixed;
        z-index: 24;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        padding: 7px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        box-shadow: 0 12px 36px rgba(16,24,40,.18);
        backdrop-filter: blur(16px);
    }
    .mobile-bottom-nav a {
        display: grid;
        justify-items: center;
        gap: 3px;
        padding: 7px 3px;
        border-radius: 13px;
        color: var(--muted);
        text-decoration: none;
        font-size: .64rem;
        font-weight: 800;
    }
    .mobile-bottom-nav a.active { color: var(--accent-dark); background: var(--accent-soft); }
    .mobile-bottom-nav .icon { width: 20px; height: 20px; }
    .login-page { padding: 0; }
    .login-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
    .login-brand { min-height: 245px; padding: 28px 24px; }
    .login-brand-copy h1 { font-size: 2rem; }
    .login-brand-copy p { margin-bottom: 0; }
    .login-card { width: 100%; padding: 32px 24px 42px; }
}


/* ============================================================
   IGOTRANSIT Driver 0.4.0 — branding, app motion and modules
   ============================================================ */

html {
    background: var(--page-bg);
    overscroll-behavior-y: none;
    scroll-behavior: smooth;
}

body {
    padding-top: env(safe-area-inset-top, 0);
    transition: background-color .24s ease, color .24s ease;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

.portal-content,
.login-card,
.login-brand-copy,
.legal-shell {
    animation: app-page-enter .34s cubic-bezier(.22, .78, .25, 1) both;
}

@keyframes app-page-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-page-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: var(--page-bg);
    transition: opacity .16s ease, visibility 0s linear .16s;
}

body.page-leaving .app-page-transition {
    visibility: visible;
    opacity: .64;
    transition-delay: 0s;
}

.portal-sidebar,
.portal-topbar,
.dashboard-widget,
.content-card,
.document-card,
.document-category,
.button,
.portal-nav-link,
.mobile-bottom-nav,
.topbar-profile,
.round-action {
    transition:
        transform .22s cubic-bezier(.22, .78, .25, 1),
        opacity .2s ease,
        background-color .2s ease,
        border-color .2s ease,
        color .2s ease,
        box-shadow .2s ease;
}

.dashboard-widget:hover,
.content-card:hover,
.document-card:hover,
.document-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 38px rgba(16, 24, 40, .10);
}

.button:active,
.portal-nav-link:active,
.mobile-bottom-nav a:active,
.round-action:active {
    transform: scale(.97);
}

.portal-logo {
    display: grid;
    gap: 7px;
    align-items: center;
    padding: 4px 9px 25px;
}

.portal-logo-image {
    width: 190px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}


.portal-logo-caption {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.portal-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-content {
    flex: 1 0 auto;
}

.portal-footer {
    flex: 0 0 auto;
    min-height: 96px;
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.4fr) minmax(210px, .8fr);
    align-items: center;
    gap: 24px;
    padding: 20px clamp(22px, 3.3vw, 46px);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.portal-footer-brand {
    display: grid;
    gap: 5px;
}

.portal-footer-brand img {
    width: 150px;
    height: auto;
}


.portal-footer-brand span,
.portal-footer-copy small {
    color: var(--muted);
    font-size: .68rem;
}

.portal-footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.portal-footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: .75rem;
    font-weight: 800;
}

.portal-footer-links a:hover {
    color: var(--accent);
}

.portal-footer-copy {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right;
}

.portal-footer-copy span {
    font-size: .78rem;
    font-weight: 900;
}

.login-brand-row {
    display: grid;
    gap: 10px;
    align-items: start;
}

.login-brand-logo {
    width: min(100%, 270px);
    height: auto;
}

.login-portal-label {
    color: rgba(255,255,255,.72);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login-card-logo {
    width: 180px;
    max-width: 70%;
    height: auto;
    margin-bottom: 28px;
}

.login-brand-meta {
    display: flex;
    gap: 10px 20px;
    flex-wrap: wrap;
    color: rgba(255,255,255,.62);
    font-size: .68rem;
    font-weight: 800;
}

.remember-row {
    grid-template-columns: auto 1fr !important;
    align-items: start;
    gap: 11px !important;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    cursor: pointer;
}

.remember-row input,
.checkbox-line input {
    width: 19px;
    height: 19px;
    min-height: 0;
    margin: 1px 0 0;
    accent-color: var(--accent);
}

.remember-row span {
    display: grid;
    gap: 3px;
}

.remember-row strong {
    color: var(--text);
    font-size: .8rem;
}

.remember-row small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 500;
    line-height: 1.45;
}

.login-legal {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.login-legal a {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    text-decoration: none;
}

.login-legal a:hover {
    color: var(--accent);
}

/* Dokumenty */

.documents-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    margin-bottom: 20px;
    padding: clamp(25px, 4vw, 42px);
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 92% 20%, rgba(255,255,255,.18), transparent 25%),
        linear-gradient(120deg, var(--navy), var(--accent));
    box-shadow: var(--shadow-card);
}

.documents-hero h2 {
    max-width: 720px;
    margin-bottom: 9px;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.documents-hero p {
    max-width: 760px;
    margin-bottom: 0;
    color: rgba(255,255,255,.8);
}

.documents-hero .card-label {
    color: rgba(255,255,255,.66);
}

.document-search-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(190px, 280px) auto;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.document-search-input {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}

.document-search-input .icon {
    position: absolute;
    left: 13px;
    z-index: 1;
    color: var(--muted);
}

.document-search-input input {
    padding-left: 42px;
}

.document-category-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.document-category-strip a {
    min-width: 158px;
    display: grid;
    gap: 5px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    text-decoration: none;
    box-shadow: var(--shadow-card);
}

.document-category-strip a.active {
    color: var(--accent-dark);
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    background: var(--accent-soft);
}

.document-category-strip strong {
    font-size: .8rem;
}

.document-category-strip small {
    color: var(--muted);
    font-size: .66rem;
}

.document-category-symbol {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 4px;
    border-radius: 11px;
    color: var(--accent);
    background: var(--accent-soft);
}

.document-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--content-gap);
}

.document-card {
    min-width: 0;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
    box-shadow: var(--shadow-card);
}

.document-card-top {
    min-height: 30px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.document-file-type {
    display: inline-flex;
    min-width: 42px;
    min-height: 27px;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 8px;
    color: #fff;
    background: var(--accent);
    font-size: .65rem;
    font-weight: 900;
}

.document-file-type-large {
    min-width: 70px;
    min-height: 44px;
    font-size: .82rem;
}

.document-required-badge {
    padding: 5px 8px;
    border-radius: 999px;
    color: #8a4b00;
    background: #fff0c2;
    font-size: .6rem;
    font-weight: 900;
}

.document-card-icon,
.document-detail-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 28px 0 20px;
    border-radius: 17px;
    color: var(--accent);
    background: var(--accent-soft);
}

.document-card-icon .icon,
.document-detail-icon .icon {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
}

.document-card-content small {
    color: var(--accent);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.document-card-content h2 {
    margin-top: 6px;
    font-size: 1.08rem;
}

.document-card-content p {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 0;
    color: var(--muted);
    font-size: .78rem;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.document-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .66rem;
}

.document-card-meta strong {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: var(--accent);
    font-size: .7rem;
}

.document-card-meta .icon {
    width: 15px;
    height: 15px;
}

.document-detail-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    margin: 14px 0 20px;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.document-detail-hero .document-detail-icon {
    margin: 0;
}

.document-detail-hero p {
    margin-bottom: 0;
    color: var(--muted);
}

.back-link {
    display: inline-flex;
    margin-bottom: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 900;
}

.document-actions {
    display: flex;
    gap: 9px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.acknowledged-panel {
    display: grid;
    gap: 5px;
    padding: 15px;
    border-radius: 13px;
    color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

.acknowledged-panel span {
    color: var(--muted);
    font-size: .72rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-line {
    display: grid !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px !important;
    color: var(--text) !important;
    cursor: pointer;
}

.category-admin-list {
    display: flex;
    gap: 7px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.category-admin-list span {
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: .68rem;
    font-weight: 800;
}

/* Profil i upload zdjęcia */

.avatar-upload-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.file-drop {
    position: relative;
    min-height: 142px;
    display: grid !important;
    place-items: center;
    align-content: center;
    gap: 5px !important;
    padding: 18px;
    overflow: hidden;
    border: 2px dashed color-mix(in srgb, var(--accent) 36%, var(--line));
    border-radius: 16px;
    color: var(--text) !important;
    background: var(--accent-soft);
    text-align: center;
    cursor: pointer;
}

.file-drop:hover,
.file-drop.is-dragging {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.file-drop input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-size: 1.4rem;
}

.file-drop small {
    color: var(--muted);
    font-size: .68rem;
}

.avatar-remove-form {
    margin-top: 10px;
}

/* Strony prawne */

.legal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
}

.legal-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px clamp(20px, 5vw, 70px);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.legal-header img {
    width: 165px;
}

.legal-header span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.legal-shell {
    width: min(100%, 920px);
    flex: 1 0 auto;
    margin: 0 auto;
    padding: clamp(26px, 6vw, 70px) 18px;
}

.legal-card {
    padding: clamp(25px, 5vw, 52px);
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.legal-card h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 3.1rem);
}

.legal-card h2 {
    margin: 30px 0 8px;
}

.legal-card p {
    color: var(--muted);
}

.legal-card .legal-lead {
    max-width: 760px;
    color: var(--text);
    font-size: 1.05rem;
}

.legal-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px clamp(20px, 5vw, 70px);
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface);
    font-size: .72rem;
}

.legal-footer nav {
    display: flex;
    gap: 15px;
}

.legal-footer a {
    color: inherit;
    text-decoration: none;
    font-weight: 800;
}

/* Aplikacja mobilna i safe area */

@media (display-mode: standalone) {
    .portal-topbar {
        padding-top: max(11px, env(safe-area-inset-top));
    }

    .mobile-bottom-nav {
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    .login-page {
        min-height: 100dvh;
    }
}

@media (max-width: 1180px) {
    .document-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-category-strip {
        grid-template-columns: repeat(5, minmax(150px, 1fr));
    }
}

@media (max-width: 760px) {
    body {
        padding-top: 0;
    }

    .portal-footer {
        display: none;
    }

    .portal-logo-image {
        width: 190px;
    }

    .documents-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .documents-hero .button {
        width: 100%;
    }

    .document-search-bar {
        grid-template-columns: 1fr;
    }

    .document-list-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .document-card {
        min-height: 290px;
    }

    .document-category-strip {
        display: flex;
        margin-right: -15px;
        padding-right: 15px;
    }

    .document-detail-hero {
        grid-template-columns: auto 1fr;
    }

    .document-detail-hero .document-file-type {
        grid-column: 2;
        justify-self: start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .login-card-logo {
        display: none;
    }

    .login-brand-logo {
        width: 210px;
    }

    .legal-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .legal-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .legal-footer nav {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* ============================================================
   IGOTRANSIT Driver 0.4.1 — profile layout and access hotfix
   ============================================================ */

.content-card,
.toolbar-card,
.document-category,
.profile-header-card,
.logout-card {
    min-height: 0;
}

.portal-main {
    min-height: 100vh;
}

.portal-content {
    min-height: 0;
    flex: 1 0 auto;
    position: relative;
    z-index: 1;
}

.portal-footer {
    position: relative;
    z-index: 0;
    clear: both;
}

.profile-header-card {
    min-height: 168px;
    height: auto;
    align-items: center;
    margin-top: 0;
    padding: clamp(26px, 3vw, 38px);
}

.profile-header-card > div:last-child {
    min-width: 0;
}

.profile-header-card h2 {
    margin-bottom: 6px;
    font-size: clamp(1.55rem, 2.7vw, 2.35rem);
}

.profile-page-grid {
    grid-auto-flow: row;
    grid-auto-rows: auto;
    align-items: start;
}

.profile-page-grid > .content-card {
    min-height: 0;
    height: auto;
    align-self: start;
}

.avatar-upload-form {
    display: grid;
    gap: 12px;
}

.avatar-remove-form {
    margin-top: 10px;
}

@media (min-width: 921px) {
    .profile-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .profile-header-card {
        min-height: 0;
        align-items: flex-start;
        padding: 22px;
    }

    .profile-avatar-large {
        width: 72px;
        height: 72px;
        flex: 0 0 72px;
    }
}


/* ============================================================
   IGOTRANSIT Driver 0.4.2 — automatyczny wariant logo
   ============================================================ */

/*
 * Menu boczne:
 * - kolorowe logo na jasnym tle,
 * - białe logo na ciemnym menu lub w ciemnym motywie.
 */
.portal-logo-color {
    display: block;
}

.portal-logo-white {
    display: none;
}

html[data-sidebar="dark"] .portal-logo-color,
html[data-theme="dark"] .portal-logo-color {
    display: none;
}

html[data-sidebar="dark"] .portal-logo-white,
html[data-theme="dark"] .portal-logo-white {
    display: block;
}

/*
 * Tryb systemowy reaguje automatycznie na motyw urządzenia.
 */
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .portal-logo-color {
        display: none;
    }

    html[data-theme="system"] .portal-logo-white {
        display: block;
    }
}

/*
 * Stopka:
 * - czarne logo na jasnej powierzchni,
 * - białe logo na ciemnej powierzchni.
 *
 * Tryb bocznego menu nie wpływa na stopkę, ponieważ jej tło
 * zależy od motywu strony, a nie od sidebar_mode.
 */
.adaptive-footer-logo {
    display: block;
    width: 150px;
    min-height: 42px;
}

.footer-logo-variant {
    width: 150px;
    height: auto;
}

.footer-logo-white {
    display: none;
}

html[data-theme="dark"] .footer-logo-black {
    display: none;
}

html[data-theme="dark"] .footer-logo-white {
    display: block;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .footer-logo-black {
        display: none;
    }

    html[data-theme="system"] .footer-logo-white {
        display: block;
    }
}

/*
 * Na tłach akcentowych i gradientach zawsze używany jest wariant biały.
 */
.login-brand-logo,
.brand-logo-on-accent {
    filter: none;
}

/*
 * Łagodna zmiana wariantu podczas podglądu ustawień.
 */
.portal-logo-image,
.footer-logo-variant {
    transition:
        opacity 180ms ease,
        filter 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
    .portal-logo-image,
    .footer-logo-variant {
        transition: none;
    }
}


/* ============================================================
   IGOTRANSIT Driver 0.5.0 — language selection
   ============================================================ */

.language-menu {
    position: relative;
}

.language-menu > summary {
    list-style: none;
}

.language-menu > summary::-webkit-details-marker {
    display: none;
}

.language-menu-button {
    min-width: 54px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    font-weight: 900;
}

.language-menu-button .icon {
    width: 14px;
    height: 14px;
    color: var(--muted);
    transition: transform 160ms ease;
}

.language-menu[open] .language-menu-button .icon {
    transform: rotate(90deg);
}

.language-code {
    font-size: .74rem;
    letter-spacing: .06em;
}

.language-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 9px);
    z-index: 80;
    min-width: 180px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(16, 24, 40, .18);
}

.language-menu-panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.language-menu-panel a:hover,
.language-menu-panel a.active {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.language-menu-panel small {
    color: var(--muted);
    font-size: .65rem;
    letter-spacing: .08em;
}

.sidebar-language {
    display: none;
    margin-top: 10px;
}

.sidebar-language-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    padding: 0 8px;
}

.sidebar-language-options a {
    display: grid;
    place-items: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: .72rem;
    font-weight: 900;
}

.sidebar-language-options a.active {
    color: var(--accent-dark);
    border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
    background: var(--accent-soft);
}

.language-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.language-choice-card {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-2);
    cursor: pointer;
}

.language-choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.language-choice-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px color-mix(
        in srgb,
        var(--accent) 13%,
        transparent
    );
}

.language-choice-flag {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #fff;
    background: var(--navy);
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.language-choice-card > span:last-child strong,
.language-choice-card > span:last-child small {
    display: block;
}

.language-choice-card > span:last-child small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .72rem;
}

.login-language-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin: -10px 0 18px;
}

.login-language-switcher a {
    display: grid;
    place-items: center;
    min-width: 42px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: .7rem;
    font-weight: 900;
}

.login-language-switcher a.active {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
}

.compact-notice {
    margin-top: 14px;
    margin-bottom: 0;
    padding: 11px 13px;
    font-size: .8rem;
}

@media (max-width: 760px) {
    .topbar-actions .language-menu {
        display: none;
    }

    .sidebar-language {
        display: block;
    }

    .language-choice-grid {
        grid-template-columns: 1fr;
    }
}
