:root,
[data-theme="light"] {
    --ink: #102033;
    --muted: #3d5270;
    --paper: #e7f0fb;
    --panel: #ffffff;
    --line: #7f9db9;
    --accent: #0b4ea2;
    --ok: #0b7a32;
    --bad: #c42b1c;
    --field-bg: #ffffff;
    --field-fg: #102033;
    --hero: #08346e;
    --sidebar-ink: #06275a;
    --soft: #f4f8fd;
    color-scheme: light;
}

[data-theme="dark"] {
    --ink: #e6ebf2;
    --muted: #a9b4c4;
    --paper: #1a1d24;
    --panel: #242830;
    --line: #4d586a;
    --accent: #8eb6ff;
    --ok: #8ee0a8;
    --bad: #ff8d82;
    --field-bg: #12141a;
    --field-fg: #e6ebf2;
    --hero: #d5e4ff;
    --sidebar-ink: #e6ebf2;
    --soft: #1e222b;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: Tahoma, "Segoe UI", "Liberation Sans", sans-serif;
    font-size: 13px;
    color: var(--ink);
    background: #0b3f9a;
}

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

.icon {
    width: 16px;
    height: 16px;
    flex: none;
}

a { color: inherit; }

h1, h2, h3, p { margin-top: 0; }

.desktop {
    min-height: 100vh;
    padding: 0;
    background:
        radial-gradient(ellipse at 18% 78%, rgba(170, 214, 255, 0.55), transparent 36%),
        radial-gradient(ellipse at 78% 18%, rgba(70, 150, 255, 0.45), transparent 34%),
        radial-gradient(ellipse at 62% 70%, rgba(12, 70, 170, 0.35), transparent 40%),
        linear-gradient(155deg, #3d93ef 0%, #1664c8 38%, #0b3d96 72%, #082e78 100%);
}

[data-theme="dark"] .desktop {
    background:
        radial-gradient(ellipse at 16% 82%, rgba(48, 86, 160, 0.38), transparent 38%),
        radial-gradient(ellipse at 84% 12%, rgba(24, 40, 80, 0.55), transparent 36%),
        linear-gradient(160deg, #1a2230 0%, #10141c 48%, #07090d 100%);
}

.desktop.logon {
    position: relative;
    overflow: hidden;
    background: #07090d;
}

.desktop.logon::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url("../bg/lbg.jpg") center / cover no-repeat;
}

.desktop.logon > .page {
    position: relative;
    z-index: 1;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.page:has(.layout) {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
}

body:has(.layout) {
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 10px;
    color: #fff;
    background: linear-gradient(180deg, #5aa6f5 0%, #1d6ed0 46%, #145bb4 52%, #1a62c4 100%);
    border-bottom: 1px solid #08346e;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    position: relative;
    z-index: 6;
}

[data-theme="dark"] .topbar {
    color: #e8eef8;
    background: linear-gradient(180deg, #3a4d68 0%, #243044 46%, #1c2636 52%, #1a2330 100%);
    border-bottom-color: #0c1018;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    pointer-events: none;
    opacity: 0;
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 20%,
        #fff 50%,
        rgba(255, 255, 255, 0.55) 62%,
        transparent 100%
    );
    background-repeat: no-repeat;
    background-size: 42% 100%;
    background-position: -42% 0;
}

.topbar.is-loading::after {
    animation: topbar-load 0.85s ease-in-out;
}

@keyframes topbar-load {
    0% { background-position: -42% 0; opacity: 1; }
    78% { opacity: 1; }
    100% { background-position: 142% 0; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .topbar.is-loading::after { animation: none; }
}

@keyframes sidebar-swap {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.side-nav.is-swapping {
    animation: sidebar-swap 0.32s ease;
}

@media (prefers-reduced-motion: reduce) {
    .side-nav.is-swapping { animation: none; }
}

.topbar-name {
    margin: 0 4px 0 0;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: #fff;
}

.topbar-name span {
    position: relative;
    display: inline-block;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 1px 0 rgba(8, 52, 110, 0.35);
}

.topbar-name span::after {
    content: attr(data-shine);
    position: absolute;
    left: 0;
    top: 0;
    color: #fff;
    text-shadow: 0 0 6px #fff;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(
        105deg,
        transparent 0%,
        transparent 42%,
        #000 50%,
        transparent 58%,
        transparent 100%
    );
    mask-image: linear-gradient(
        105deg,
        transparent 0%,
        transparent 42%,
        #000 50%,
        transparent 58%,
        transparent 100%
    );
    -webkit-mask-size: 220% 100%;
    mask-size: 220% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 120% 0;
    mask-position: 120% 0;
    animation: topbar-name-shine 5.4s ease-in-out infinite;
}

@keyframes topbar-name-shine {
    0%, 62% {
        -webkit-mask-position: 120% 0;
        mask-position: 120% 0;
    }
    100% {
        -webkit-mask-position: -20% 0;
        mask-position: -20% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topbar-name span::after {
        content: none;
        animation: none;
    }
}

[data-theme="dark"] .topbar-name span {
    color: #e8eef8;
    text-shadow: none;
}

.history-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.28);
}

.history-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    box-shadow: none;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.history-button:hover:not(:disabled),
.history-button[aria-current="page"] {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
}

.history-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.hover-menu { position: relative; }

.menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.account-trigger { font-weight: 700; }

.account-open {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 700;
    cursor: pointer;
}

.account-open > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-keep { margin: 0; }

.session-timer {
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #08346e;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 4px;
    white-space: nowrap;
}

[data-theme="dark"] .session-timer {
    color: #d5e4ff;
    background: rgba(12, 16, 24, 0.45);
    border-color: rgba(255, 255, 255, 0.16);
}

.session-timer.is-ending { color: #c42b1c; }

[data-theme="dark"] .session-timer.is-ending { color: #ff8d82; }

body.is-locked .page {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.screen-lock {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(16, 32, 51, 0.28);
}

.screen-lock[hidden] { display: none; }

.screen-lock-card {
    width: min(360px, 100%);
    padding: 22px 20px 16px;
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 3px;
    box-shadow: 0 12px 32px rgba(8, 24, 48, 0.28);
}

.screen-lock-icon { display: block; margin: 0 auto 8px; }

.screen-lock-card h2 { margin: 0 0 6px; }

.screen-lock-card p { margin: 0 0 12px; }

.screen-lock-card .field { text-align: left; }

.screen-lock-card .button,
.screen-lock-card .text-button { margin-top: 4px; }

.screen-lock-card form + form { margin-top: 8px; }

.topbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.top-search {
    position: relative;
    flex: 1 1 180px;
    width: auto;
    max-width: 240px;
    min-width: 0;
}

.top-search form { margin: 0; position: relative; }

.top-search-icon {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    pointer-events: none;
}

.top-search input {
    width: 100%;
    height: 28px;
    padding: 4px 8px 4px 28px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 4px;
    color: #102033;
    box-shadow: inset 1px 1px 2px rgba(0, 30, 60, 0.12);
}

[data-theme="dark"] .top-search input {
    background: var(--field-bg);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--field-fg);
}

.top-search input:focus { outline: 1px dotted var(--ink); outline-offset: 2px; }

.top-search-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: min(360px, 78vw);
    max-height: min(70vh, 440px);
    overflow: auto;
    padding: 4px;
    background: #ffffff66;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--line);
    box-shadow: 0 10px 22px rgba(4, 24, 70, 0.18);
    z-index: 9;
    color: #102033;
}

.top-search-heading {
    margin: 6px 8px 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0b4ea2;
}

.top-search-panel a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    text-decoration: none;
    color: #102033;
    border-radius: 3px;
}

.top-search-panel a.is-active,
.top-search-panel a:hover { background: #f4f8fd; }

.top-search-panel a span { display: block; min-width: 0; }
.top-search-panel small { display: block; color: #3d5270; font-size: 11px; font-weight: 400; }
.top-search-empty { margin: 8px; color: #3d5270; }

[data-theme="dark"] .top-search-panel {
    background: #1a1d2466;
    color: #e6ebf2;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .top-search-heading { color: #8eb6ff; }

[data-theme="dark"] .top-search-panel a { color: #e6ebf2; }

[data-theme="dark"] .top-search-panel a.is-active,
[data-theme="dark"] .top-search-panel a:hover { background: rgba(255, 255, 255, 0.08); }

[data-theme="dark"] .top-search-panel small,
[data-theme="dark"] .top-search-empty { color: #a9b4c4; }

.search-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.search-hits a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    text-decoration: none;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 3px;
}
.search-hits a:hover { border-color: var(--accent); }

.topnav {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.topnav a,
.topnav span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 8px;
    text-decoration: none;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    white-space: nowrap;
}

.topnav a:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.topnav a.is-current {
    background: linear-gradient(180deg, #ffffff 0%, #d7e8fb 100%);
    border-color: rgba(255, 255, 255, 0.9);
    color: #08346e;
    font-weight: 700;
    box-shadow: inset 0 1px 0 #fff;
}

[data-theme="dark"] .topnav a,
[data-theme="dark"] .topnav span { color: #e8eef8; }

[data-theme="dark"] .topnav a.is-current {
    background: linear-gradient(180deg, #2a3548 0%, #1a212c 100%);
    border-color: #6d82a3;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.topnav span { color: var(--muted); }
.topnav em { font-style: normal; font-size: 10px; text-transform: uppercase; }

.hover-menu.align-end { margin-left: 0; flex: none; }

.hover-panel,
.hover-panel.side-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 10px 22px rgba(4, 24, 70, 0.18);
    z-index: 8;
}

.hover-menu.align-end .hover-panel { left: auto; right: 0; }

.hover-menu:hover .hover-panel,
.hover-menu:focus-within .hover-panel,
.hover-menu:hover .hover-panel.side-nav,
.hover-menu:focus-within .hover-panel.side-nav { display: grid; gap: 4px; }

.menu-role {
    margin: 0 4px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.hover-panel .menu-link + .menu-role { margin-top: 10px; }

.menu-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid transparent;
    border-radius: 3px;
}

.help-doc {
    white-space: pre-wrap;
    line-height: 1.5;
}

.menu-link:hover,
.menu-link.is-current {
    background: var(--soft);
    border-color: var(--line);
    font-weight: 700;
}

.layout {
    display: grid;
    grid-template-columns: 228px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--paper);
}

.sidebar {
    margin: 0;
    padding: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    color: var(--ink);
    background: var(--panel);
    border-right: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: none;
    position: relative;
    align-self: stretch;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

[data-theme="dark"] .sidebar {
    background: var(--panel);
    border-right-color: var(--line);
    box-shadow: none;
}

.sidebar::before {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 96px;
    width: 250px;
    height: 250px;
    background: url("../icons/XPS%20Viewer.png") center / contain no-repeat;
    filter: grayscale(1);
    opacity: 0.10;
    pointer-events: none;
    z-index: 0;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.side-heading {
    margin: 0 0 6px;
    padding: 12px 14px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border-bottom: 1px solid var(--line);
}

.brand-kicker {
    margin: 0 0 6px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sidebar-ink);
}

.side-nav {
    display: grid;
    gap: 2px;
    align-content: start;
    padding: 0 8px;
    min-height: 0;
    overflow: auto;
}

.side-foot {
    margin: auto 0 0;
    flex-shrink: 0;
    padding: 10px 14px 2px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: var(--muted);
}

.nav-label {
    margin: 14px 6px 4px;
    padding: 0 2px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(11, 78, 162, 0.16);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.nav-label:first-child { margin-top: 2px; }

[data-theme="dark"] .nav-label { border-bottom-color: rgba(232, 238, 248, 0.12); }

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.side-nav a,
.side-nav span,
.side-nav .nav-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    text-decoration: none;
    color: var(--sidebar-ink);
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.side-nav form { margin: 0; }

.side-nav span { justify-content: space-between; }

.side-nav a:hover,
.side-nav .nav-action:hover {
    background: var(--soft);
    border-color: var(--line);
}

[data-theme="dark"] .side-nav a:hover,
[data-theme="dark"] .side-nav .nav-action:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.side-nav a:focus-visible,
.side-nav .nav-action:focus-visible {
    outline: 1px dotted var(--sidebar-ink);
    outline-offset: 1px;
}

.side-nav a.is-current {
    background: linear-gradient(180deg, #ffffff 0%, #d7e8fb 100%);
    border-color: #5d8bc4;
    color: #08346e;
    font-weight: 700;
    box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(8, 52, 110, 0.06);
}

[data-theme="dark"] .side-nav a.is-current {
    background: linear-gradient(180deg, #2a3548 0%, #1a212c 100%);
    border-color: #6d82a3;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}


.side-nav span { color: var(--muted); }
.side-nav em { font-style: normal; font-size: 10px; text-transform: uppercase; }

.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; }

.user-chip { display: flex; gap: 8px; align-items: center; padding: 0 4px; }
.user-chip strong, .user-chip span { display: block; }
.user-chip span { color: var(--muted); font-size: 11px; }

.avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #5aa2f0, #1a62c4);
    color: #fff;
    font-weight: 700;
    border: 1px solid #08346e;
    border-radius: 3px;
}

.topbar .avatar {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(8, 52, 110, 0.28);
}

.main {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background: var(--paper);
}

.content {
    padding: 14px 16px 18px;
    display: grid;
    gap: 12px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.racid-qr {
    flex: none;
    align-self: start;
    width: max-content;
    margin: 0;
    padding: 8px 8px 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.racid-qr .qr { display: block; width: 148px; height: 148px; }

.racid-qr figcaption {
    margin-top: 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #102033;
}

.hero h1,
.login-card h2,
.panel h2 {
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--hero);
}

.modules h3 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.crumbs [aria-current="page"] {
    color: var(--hero);
    font-weight: 700;
}

.crumb-sep { color: var(--muted); }

.hero p,
.lede,
.panel-head p,
.cell-sub,
.events span,
.stats span,
.empty { color: var(--muted); }

.lede { margin: 0 0 12px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.stats article,
.stats a,
.panel,
.alert {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: none;
}

[data-theme="dark"] .stats article,
[data-theme="dark"] .stats a,
[data-theme="dark"] .panel,
[data-theme="dark"] .alert {
    box-shadow: none;
}

.stats article,
.stats a { padding: 10px 12px; }
.stats a { display: block; text-decoration: none; color: inherit; }
.stats a:hover,
.stats a:focus-visible { border-color: var(--accent); }
.stats p, .stats span { margin: 0; }
.stats p { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.stats strong {
    display: block;
    margin: 4px 0 2px;
    font-size: 22px;
    font-weight: 700;
    color: var(--hero);
}
.stat-text { font-size: 16px !important; }

.columns { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 8px; }
.panel { padding: 12px; }

#nowy-pojazd {
    position: relative;
    overflow: hidden;
}

#nowy-pojazd::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: min(280px, 46%);
    background: url("../icons/Wizard.png") right center / contain no-repeat;
    filter: grayscale(1);
    opacity: 0.14;
    pointer-events: none;
}

[data-theme="dark"] #nowy-pojazd::before { opacity: 0.22; }

#nowy-pojazd > * {
    position: relative;
    z-index: 1;
}
.panel-head p { margin: 0 0 10px; }

.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
}

.facts > div {
    padding: 8px 10px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 3px;
}

.facts dt {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
}

.facts dd {
    margin: 2px 0 0;
    color: var(--hero);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.facts .cell-sub { font-weight: 400; }

.bays, .events, .modules, .accounts, .history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.bays, .modules { grid-template-columns: 1fr 1fr; }

.bays > li,
.events > li,
.modules > li,
.accounts > li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 8px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 3px;
}

.events > li { justify-content: flex-start; }
.events strong, .events span, .cell-sub { display: block; }
.bays strong { color: var(--ok); font-weight: 700; }
.bays strong.is-busy { color: var(--accent); }
.bays strong a { color: inherit; text-decoration: none; }

.attention-group { margin-top: 12px; }
.attention-group h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--hero); }
.attention-group h3 a { color: inherit; text-decoration: none; }
.attention-group h3 a:hover { text-decoration: underline; }
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.notice-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 8px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 3px;
}
.notice-list li.is-late { border-color: var(--bad); }
.notice-list a { color: inherit; font-weight: 700; text-decoration: none; }
.notice-list a:hover { text-decoration: underline; }
.notice-list .cell-sub { text-align: right; }
.attention-more { margin: 4px 0 0; }

.dot { width: 9px; height: 9px; flex: none; border-radius: 2px; }
.dot.is-ok { background: var(--ok); }
.dot.is-bad { background: var(--bad); }

.modules h3 { margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--hero); }
.modules h3 a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.modules p { margin: 0; color: var(--muted); }
.modules li span,
.modules .module-link {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 10px;
    color: #6d100c;
    background: #fff4f2;
    border-color: #e7b2ac;
}
.alert .icon { margin-top: 1px; flex: none; }
[data-theme="dark"] .alert { color: #ffd0cb; background: #3a2222; border-color: #6d3030; }
.alert-ok {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #0b4a22;
    background: #f3fff6;
    border-color: #9dcfb0;
}
.alert-ok .icon { margin-top: 1px; }
[data-theme="dark"] .alert-ok { color: #c8f5d6; background: #1a3324; border-color: #2f6a44; }
.alert-warn {
    color: #6a4b00;
    background: #fff8dc;
    border-color: #e2c15a;
}
[data-theme="dark"] .alert-warn { color: #ffe3a3; background: #3d3014; border-color: #8a6a28; }

.field { display: grid; gap: 3px; margin-bottom: 10px; }
.field .req { color: var(--bad); font-weight: 700; }

.owner-label {
    display: flex;
    align-items: center;
    gap: 2px;
}

.field .owner-label label {
    font-size: 12px;
    color: var(--muted);
}

body.window-client .layout { grid-template-columns: 1fr; }

.field input,
.field select,
.field textarea,
.row-form select,
.row-form input,
.stack-form select,
.stack-form textarea {
    width: 100%;
    background: var(--field-bg);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 4px 6px;
    color: var(--field-fg);
    box-shadow: inset 1px 1px 2px rgba(0, 30, 60, 0.12);
}

.field input::placeholder,
.row-form input::placeholder { color: #8aa0b8; }

.button,
.text-button,
.nav-button {
    appearance: none;
    cursor: pointer;
    color: #102033;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 3px;
    border: 1px solid #3d6eae;
    background: linear-gradient(180deg, #ffffff 0%, #e4eefb 46%, #c5daf3 48%, #f7fbff 100%);
    box-shadow: inset 0 1px 0 #fff;
}

[data-theme="dark"] .button,
[data-theme="dark"] .text-button,
[data-theme="dark"] .nav-button {
    color: var(--ink);
    border-color: #2a3140;
    background: linear-gradient(180deg, #3a4252 0%, #2a303c 48%, #222733 52%, #2e3544 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.button:hover,
.text-button:hover,
.nav-button:hover {
    filter: brightness(1.05);
}

.button:focus,
.text-button:focus,
input:focus,
select:focus { outline: 1px dotted var(--ink); outline-offset: 2px; }

.text-button,
.nav-button { padding: 3px 10px; }

.logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.logout { width: 100%; }

.choice {
    margin: 0;
    padding: 8px 12px 10px;
    border: 1px solid var(--line);
    border-radius: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

#cepik > .stack-form > .choice {
    width: 100%;
    min-width: 0;
    display: block;
}

.choice legend { padding: 0 4px; font-weight: 700; color: var(--accent); }

.wizard-head h2 .icon {
    width: 32px;
    height: 32px;
}

.wizard-steps {
    position: relative;
    display: flex;
    gap: 0;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.wizard-steps::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 10px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #8eadd4;
}

[data-theme="dark"] .wizard-steps::before { background: #5c6b86; }

.wizard-steps li {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.wizard-steps a,
.wizard-steps .wizard-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
}

.wizard-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #6f93c8;
    border-radius: 50%;
    background: var(--panel);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.wizard-name {
    font-size: 11px;
    line-height: 1.2;
}

.wizard-steps .is-done .wizard-dot { background: #e5f0fc; }

.wizard-steps .is-current .wizard-dot {
    background: #1a62c4;
    border-color: #08346e;
    color: #fff;
}

.wizard-steps .is-current .wizard-name { font-weight: 700; }

[data-theme="dark"] .wizard-steps .is-done .wizard-dot {
    background: #2a3344;
    color: #e6ebf2;
}

[data-theme="dark"] .wizard-steps .is-current .wizard-dot {
    background: #3a6cb5;
    border-color: #8eb6ff;
    color: #fff;
}

.wizard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wizard-nav button[value="wstecz"] { order: -1; }

.page.auth {
    width: auto;
    min-height: 100vh;
    margin: 0;
    background: transparent;
    overflow: visible;
    align-items: flex-start;
}

.login-card {
    position: relative;
    width: min(420px, 100%);
    min-height: 100vh;
    margin: 0;
    padding: 72px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: color-mix(in srgb, var(--paper) 38%, transparent);
    border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    backdrop-filter: blur(16px) saturate(1.25);
    -webkit-backdrop-filter: blur(16px) saturate(1.25);
}

.login-card .button,
.login-card .text-button {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.login-card .icon { filter: grayscale(1); }

.login-card .logon-back .icon { filter: none; }

.login-card .button:hover:not(:disabled) .icon { filter: none; }

.logon-stage {
    position: relative;
    width: 100%;
}

.logon-stage.is-animating {
    overflow: hidden;
    transition: height 200ms linear;
}

.logon-stage.is-animating .logon-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
}

.logon-panel.is-enter { animation: logon-fade-in 200ms linear; }
.logon-panel.is-leave { animation: logon-fade-out 200ms linear forwards; pointer-events: none; }

@keyframes logon-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes logon-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .logon-stage.is-animating { transition: none; }
    .logon-panel.is-enter,
    .logon-panel.is-leave { animation: none; }
}

.logon-choices {
    display: grid;
    gap: 10px;
    width: 100%;
}

.logon-choice {
    align-self: stretch;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    text-align: left;
}

.logon-choice .icon {
    width: 32px;
    height: 32px;
}

.logon-back { margin-top: 14px; }

.login-card [hidden] { display: none; }
.login-card .webauthn-login { margin-top: 8px; }
.webauthn-note { margin: 10px 0 0; color: var(--muted); }

@font-face {
    font-family: "Libre Franklin";
    src: url("../fonts/LibreFranklin-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

.logon-app {
    position: absolute;
    z-index: 2;
    top: 60px;
    right: 110px;
    margin: 0;
    font-family: "Libre Franklin", "Franklin Gothic Medium", "Franklin Gothic", Arial, sans-serif;
    font-size: 65px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: #c9d7f1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    white-space: nowrap;
}

.logon-app > span {
    position: relative;
    display: inline-block;
    color: #c9d7f1;
    line-height: 1.1;
}

.logon-app > span::after {
    content: attr(data-shine);
    position: absolute;
    left: 0;
    top: 0;
    color: #fff;
    text-shadow: 0 0 8px #fff;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(
        105deg,
        transparent 0%,
        transparent 42%,
        #000 50%,
        transparent 58%,
        transparent 100%
    );
    mask-image: linear-gradient(
        105deg,
        transparent 0%,
        transparent 42%,
        #000 50%,
        transparent 58%,
        transparent 100%
    );
    -webkit-mask-size: 220% 100%;
    mask-size: 220% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 120% 0;
    mask-position: 120% 0;
    animation: topbar-name-shine 5.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .logon-app > span::after {
        content: none;
        animation: none;
    }
}

.logon-app-mark {
    color: #f54a4e;
    font-size: 0.48em;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    vertical-align: super;
}

[data-logon-choice] h2 {
    font-size: 24px;
    color: #f54a4e;
}

.logon-foot {
    position: absolute;
    z-index: 2;
    left: 28px;
    bottom: 20px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0;
    pointer-events: none;
}

.logon-foot p {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    color: var(--muted);
}

.logon-brand {
    font-weight: 600;
    letter-spacing: 0.01em;
}

[data-theme="dark"] .login-card { border-right-color: #3c4658; }

.row-form, .form-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-grid { align-items: end; }
.form-grid .field { margin: 0; min-width: min(100%, 180px); flex: 1; }
.stack-form { display: grid; gap: 12px; justify-items: start; }
.panel .stack-form + .stack-form,
.panel .facts + .stack-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.stack-fields { display: grid; gap: 12px; justify-items: start; min-width: 0; }

.stack-form:has(.racid-qr) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

.stack-form:has(.racid-qr) .stack-fields { flex: 1 1 280px; }
.stack-form .racid-qr { margin-left: auto; }

.preview-sheet {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.preview-sheet .facts { flex: 1 1 280px; }
.preview-sheet .racid-qr { margin-left: auto; }
.check { display: inline-flex; gap: 6px; align-items: center; }

.cepik-status {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin: 0;
}

.cepik-mark {
    position: relative;
    flex: none;
    width: 34px;
    height: 34px;
}

.cepik-mark .icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cepik-copy { min-width: 0; }

.cepik-state {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
}

.cepik-status.is-ok .cepik-state { color: var(--ok); }
.cepik-status.is-bad .cepik-state { color: var(--bad); }
.cepik-status.is-off .cepik-state { color: #8a5a00; }

[data-theme="dark"] .cepik-status.is-off .cepik-state { color: #f0c36a; }

.cepik-detail {
    margin: 0;
    color: var(--muted);
    font-weight: 400;
}
.row-form select, .row-form input { width: auto; }

.accounts > li { display: grid; gap: 8px; align-items: start; }

.records {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.records > li {
    display: grid;
    gap: 8px;
    padding: 8px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 3px;
}

.records .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.table-wrap { overflow-x: auto; }

.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 8px;
}

.bulk-count { margin: 0; color: var(--muted); }

.grid .bulk-col {
    width: 28px;
    text-align: center;
    vertical-align: middle;
}

.grid .bulk-col input { margin: 0; }

.grid {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
}

.grid th,
.grid td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.grid th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--soft);
}

.grid td.wrap { white-space: normal; }

.grid th.actions,
.grid td.actions {
    text-align: right;
    width: 1%;
    vertical-align: middle;
}

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

.row-icons form,
.grid td form { margin: 0; }

.grid select.template-pick {
    width: auto;
    min-width: 9rem;
    max-width: 16rem;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--line);
}

[data-theme="dark"] .icon-button:hover { background: rgba(255, 255, 255, 0.08); }

.grid tbody tr:hover td { background: color-mix(in srgb, var(--soft) 65%, var(--paper)); }

.grid tr.is-off td { color: var(--muted); }

.status-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.order-status {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-weight: 400;
    line-height: 1.55;
    white-space: nowrap;
    vertical-align: middle;
}

.order-status.is-przyjete { color: #08346e; background: #d6e6fb; border-color: #7f9db9; }
.order-status.is-diagnostyka { color: #0b5560; background: #d7f3f6; border-color: #6aafb8; }
.order-status.is-akceptacja { color: #7a4e00; background: #fff0cc; border-color: #e0b44a; }
.order-status.is-czesci { color: #5a3d86; background: #efe6f8; border-color: #b79ad4; }
.order-status.is-wstrzymane { color: #3e4654; background: #e7ebf0; border-color: #a8b0bc; }
.order-status.is-w_trakcie { color: #0b3f86; background: #dce8ff; border-color: #7ea2d6; }
.order-status.is-kontrola { color: #1e3f78; background: #e3e9ff; border-color: #8ea0d4; }
.order-status.is-gotowe { color: #0b7a32; background: #d9f5e3; border-color: #7dca96; }
.order-status.is-wydane { color: #245c46; background: #e5f3ec; border-color: #9dc4b0; }
.order-status.is-anulowane { color: #9d2218; background: #fde2de; border-color: #e7a49c; }

[data-theme="dark"] .order-status.is-przyjete { color: #d6e6fb; background: #16345c; border-color: #4d6f99; }
[data-theme="dark"] .order-status.is-diagnostyka { color: #c8f4f8; background: #12383e; border-color: #3d7d86; }
[data-theme="dark"] .order-status.is-akceptacja { color: #ffe3a3; background: #3d3014; border-color: #8a6a28; }
[data-theme="dark"] .order-status.is-czesci { color: #eadbff; background: #2c2240; border-color: #6d568f; }
[data-theme="dark"] .order-status.is-wstrzymane { color: #d5dbe3; background: #2a303a; border-color: #5c6674; }
[data-theme="dark"] .order-status.is-w_trakcie { color: #d6e4ff; background: #1a3058; border-color: #4d6fa8; }
[data-theme="dark"] .order-status.is-kontrola { color: #dde4ff; background: #222848; border-color: #5a679c; }
[data-theme="dark"] .order-status.is-gotowe { color: #c8f5d8; background: #143524; border-color: #3d8a5c; }
[data-theme="dark"] .order-status.is-wydane { color: #d5ebe2; background: #1c332b; border-color: #4d7564; }
[data-theme="dark"] .order-status.is-anulowane { color: #ffd0ca; background: #4a221e; border-color: #a85a52; }

.grid a { color: var(--accent); }

span.plate {
    display: inline-block;
    box-sizing: content-box;
    height: 32px;
    padding: 2px 12px 2px 18px;
    border: 2px solid #000;
    border-radius: 3px;
    background: #fff url("../plates/pl.png") no-repeat 0 -5px;
    color: #000;
    font-family: "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", Monaco, monospace;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 32px;
    white-space: nowrap;
    vertical-align: middle;
}

span.plate a,
span.plate a:visited,
span.plate a:hover {
    color: #000;
    font-family: inherit;
    font-weight: 400;
    text-decoration: none;
}

.vin-code {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid #d2ccbe;
    border-radius: 5px;
    background: #f4f1e6;
    color: #1a1a1a;
    font-family: "Liberation Mono", "DejaVu Sans Mono", "Lucida Console", Monaco, monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.4;
    vertical-align: middle;
}

.facts dd .plate,
.facts dd .vin-code { font-weight: 400; color: #000; }
.facts dd .vin-code { color: #1a1a1a; }

[data-theme="dark"] .vin-code {
    background: #1b212b;
    border-color: #3c4656;
    color: #e6f0e4;
}

[data-theme="dark"] .facts dd .vin-code { color: #e6f0e4; }
.history { margin-top: 6px; }
.history li {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: 12px;
    justify-content: flex-start;
}

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button { display: none; }

@media (min-width: 900px) {
    .accounts > li { grid-template-columns: minmax(180px, 260px) 1fr; align-items: center; }
}

a.button { display: inline-block; text-decoration: none; }

.panel-tools { margin: 0 0 8px; }

.tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0 0 12px;
}

.tab-row a {
    display: inline-block;
    padding: 4px 10px;
    text-decoration: none;
    border: 1px solid var(--line);
    background: var(--soft);
}

.tab-row a.is-current {
    background: var(--paper);
    font-weight: 700;
}

.client-block {
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: var(--paper);
}

.client-block legend { padding: 0 4px; font-weight: 700; }

.client-links { margin: 0 0 12px; padding-left: 18px; }

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 10px 0 0;
}

.field textarea { min-height: 64px; resize: vertical; }

.note { margin: 12px 0; }
.note p { margin: 0 0 6px; white-space: pre-wrap; }

.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.photo-grid img {
    display: block;
    width: 160px;
    height: 120px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: var(--soft);
}

.cal-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.cal-nav a.is-current {
    background: #316ac5;
    color: #fff;
    border-color: #214e8a;
}

.o-cal,
.o-month {
    border: 1px solid #7f9db9;
    background: #fff;
    overflow-x: auto;
}

.o-head,
.o-body {
    display: grid;
    grid-template-columns: 54px repeat(var(--o-cols, 7), minmax(92px, 1fr));
    min-width: 760px;
}

.o-cal.is-day .o-head,
.o-cal.is-day .o-body {
    grid-template-columns: 54px minmax(0, 1fr);
    min-width: 280px;
}

.o-gutter,
.o-times {
    background: #f7f9fc;
    border-right: 1px solid #c5d4e4;
}

.o-colhead {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 2px 4px 4px;
    border-left: 1px solid #c5d8ee;
    border-bottom: 1px solid #7f9db9;
    background: linear-gradient(#f8fbff, #d7e7f8);
    color: #1c3d6e;
    text-decoration: none;
    line-height: 1.15;
}

.o-colhead span { font-size: 11px; }

.o-colhead strong {
    font-size: 16px;
    font-weight: 400;
}

.o-colhead.is-today {
    background: #316ac5;
    color: #fff;
}

.o-colhead.is-today strong {
    min-width: 22px;
    padding: 0 4px;
    border-radius: 2px;
    background: #fff;
    color: #316ac5;
    text-align: center;
}

.o-colhead.is-off:not(.is-today) { color: #6d7c8d; }

.o-hour,
.o-slot { height: 42px; box-sizing: border-box; }

.o-hour {
    position: relative;
    border-top: 1px solid #d0d7e2;
    color: #5c6b7c;
    font-size: 11px;
    text-align: right;
}

.o-hour span {
    position: relative;
    top: -7px;
    padding-right: 4px;
    background: #f7f9fc;
}

.o-col {
    position: relative;
    border-left: 1px solid #d7e0ea;
    background: #fff;
}

.o-slot {
    border-top: 1px solid #c5ced9;
    background-image: linear-gradient(to bottom, transparent 20px, #e4e9f0 20px, #e4e9f0 21px, transparent 21px);
}

button.o-slot,
button.o-mhit {
    margin: 0;
    padding: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    appearance: none;
}

button.o-slot {
    display: block;
    width: 100%;
    background-color: transparent;
}

button.o-slot:hover,
button.o-slot:focus {
    background-color: rgba(49, 106, 197, 0.12);
}

.o-mday { position: relative; }

button.o-mhit {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}

button.o-mhit:hover,
button.o-mhit:focus { background: rgba(49, 106, 197, 0.08); }

.o-mnum,
.o-mchip,
.o-more { position: relative; z-index: 1; }

.o-pop {
    position: fixed;
    z-index: 40;
    width: min(280px, calc(100vw - 16px));
    padding: 10px 10px 8px;
    border: 1px solid #7f9db9;
    border-radius: 12px;
    background: #fff;
    box-shadow: 2px 3px 0 rgba(16, 48, 96, 0.18);
}

.o-pop[hidden] { display: none; }

.o-pop-when {
    margin: 0 0 8px;
    color: #08346e;
    font-weight: 700;
}

.o-pop .field { margin: 0 0 6px; }

.o-pop .field span {
    display: block;
    margin-bottom: 2px;
}

.o-pop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 8px 0 0;
}

[data-theme="dark"] .o-pop {
    background: #1b2838;
    border-color: #3d5470;
    color: #e7eef8;
}

[data-theme="dark"] .o-pop-when { color: #d6e6fb; }

.o-col.is-today { background: #fff8dc; }
.o-col.is-off { background: #f2f3f5; }
.o-col.is-today.is-off { background: #f6f0d4; }
.o-col.is-today .o-slot,
.o-col.is-off .o-slot { background-color: transparent; }

.o-appt {
    position: absolute;
    z-index: 2;
    overflow: hidden;
    box-sizing: border-box;
    padding: 1px 4px 1px 5px;
    border: 1px solid #6f93c3;
    border-left-width: 4px;
    border-radius: 2px;
    background: #e4f0fc;
    color: #102033;
    font-size: 11px;
    line-height: 1.25;
    text-decoration: none;
}

.o-appt strong,
.o-appt span {
    display: block;
    overflow: hidden;
    font-weight: 400;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.o-appt strong { font-weight: 700; }

.o-appt.is-wstepna { border-left-color: #7d8794; background: #f4f6f8; }
.o-appt.is-potwierdzona,
.o-mchip.is-potwierdzona { border-left-color: #316ac5; background: #e3f0fc; }
.o-appt.is-przyjeta,
.o-mchip.is-przyjeta { border-left-color: #0e7c86; background: #e5f6f8; }
.o-appt.is-zakonczona,
.o-mchip.is-zakonczona { border-left-color: #2f8f4e; background: #e7f6ec; }
.o-appt.is-przelozona,
.o-mchip.is-przelozona { border-left-color: #c48a12; background: #fff6df; }
.o-appt.is-anulowana,
.o-mchip.is-anulowana { border-left-color: #b42318; background: #fdeceb; }

.o-now {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 3;
    height: 0;
    border-top: 2px solid #e11d2e;
    pointer-events: none;
}

.o-now::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -1px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e11d2e;
}

.o-month-head,
.o-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 640px; }

.o-month-head div {
    padding: 4px 0;
    border-bottom: 1px solid #7f9db9;
    border-left: 1px solid #d5e2f2;
    background: linear-gradient(#f8fbff, #d7e7f8);
    color: #1c3d6e;
    font-size: 11px;
    text-align: center;
}

.o-mday {
    min-height: 96px;
    padding: 2px 3px 4px;
    border-top: 1px solid #d5deea;
    border-left: 1px solid #d5deea;
    background: #fff;
}

.o-mday.is-out { background: #f4f6f8; }
.o-mday.is-today { background: #fff8dc; }

.o-mnum {
    display: block;
    margin-bottom: 2px;
    color: #316ac5;
    font-size: 12px;
    text-align: right;
    text-decoration: none;
}

.o-mday.is-today .o-mnum {
    display: inline-block;
    float: right;
    min-width: 18px;
    padding: 0 3px;
    border-radius: 2px;
    background: #316ac5;
    color: #fff;
    text-align: center;
}

.o-mchip,
.o-more {
    display: block;
    overflow: hidden;
    margin: 1px 0;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-decoration: none;
}

.o-mchip {
    padding: 0 3px 0 4px;
    border-left: 3px solid #7d8794;
    background: #f4f6f8;
    color: #102033;
}

.o-more { color: #0b4ea2; }

.appointment-status {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-weight: 400;
    line-height: 1.55;
    white-space: nowrap;
}

.appointment-status.is-wstepna { color: #3e4654; background: #e7ebf0; border-color: #a8b0bc; }
.appointment-status.is-potwierdzona { color: #08346e; background: #d6e6fb; border-color: #7f9db9; }
.appointment-status.is-przyjeta { color: #0b5560; background: #d7f3f6; border-color: #6aafb8; }
.appointment-status.is-zakonczona { color: #0b7a32; background: #d9f5e3; border-color: #7dca96; }
.appointment-status.is-przelozona { color: #7a4e00; background: #fff0cc; border-color: #e0b44a; }
.appointment-status.is-anulowana { color: #9d2218; background: #fde2de; border-color: #e7a49c; }

[data-theme="dark"] .o-cal,
[data-theme="dark"] .o-month,
[data-theme="dark"] .o-col,
[data-theme="dark"] .o-mday { background: #1b2838; color: #e7eef8; border-color: #3d5470; }

[data-theme="dark"] .o-gutter,
[data-theme="dark"] .o-times {
    background: #152232;
    border-right-color: #3d5470;
}

[data-theme="dark"] .o-hour {
    border-top-color: #3d5470;
    color: #c5d4e6;
}

[data-theme="dark"] .o-hour span { background: #152232; color: #c5d4e6; }

[data-theme="dark"] .o-slot,
[data-theme="dark"] button.o-slot {
    border-top-color: #3d5470;
    background-image: linear-gradient(to bottom, transparent 20px, #2c4158 20px, #2c4158 21px, transparent 21px);
}

[data-theme="dark"] .o-col { border-left-color: #3d5470; }

[data-theme="dark"] .o-colhead,
[data-theme="dark"] .o-month-head div {
    background: #23405f;
    color: #e7eef8;
    border-color: #3d5470;
}

[data-theme="dark"] .o-mday {
    border-top-color: #3d5470;
    border-left-color: #3d5470;
}

[data-theme="dark"] .o-mnum,
[data-theme="dark"] .o-more { color: #8eb6ff; }

[data-theme="dark"] .o-col.is-today,
[data-theme="dark"] .o-mday.is-today { background: #3a3420; }

[data-theme="dark"] .o-col.is-off,
[data-theme="dark"] .o-mday.is-out { background: #141c28; }

[data-theme="dark"] .o-appt,
[data-theme="dark"] .o-mchip { color: #102033; }

[data-theme="dark"] .appointment-status.is-wstepna { color: #d5dbe3; background: #2a303a; border-color: #5c6674; }
[data-theme="dark"] .appointment-status.is-potwierdzona { color: #d6e6fb; background: #16345c; border-color: #4d6f99; }
[data-theme="dark"] .appointment-status.is-przyjeta { color: #c8f4f8; background: #12383e; border-color: #3d7d86; }
[data-theme="dark"] .appointment-status.is-zakonczona { color: #c8f5d8; background: #143524; border-color: #3d8a5c; }
[data-theme="dark"] .appointment-status.is-przelozona { color: #ffe3a3; background: #3d3014; border-color: #8a6a28; }
[data-theme="dark"] .appointment-status.is-anulowana { color: #ffd0ca; background: #4a221e; border-color: #a85a52; }

@media print {
    .topbar, .sidebar, .screen-lock, .tab-row, .panel-tools, .no-print, form { display: none !important; }
    .page, .desktop, .main, .content, .panel, .layout {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        filter: none !important;
    }
    body.is-locked .page { filter: none !important; }
    span.plate, .vin-code { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

@media (max-width: 980px) {
    .layout, .stats, .columns, .modules, .bays, .facts { grid-template-columns: 1fr; }
    .notice-list li { flex-direction: column; align-items: flex-start; }
    .notice-list .cell-sub { text-align: left; }
    .hero { flex-direction: column; align-items: stretch; }
    .sidebar {
        display: none;
        position: absolute;
        z-index: 5;
        width: min(86vw, 260px);
        height: calc(100vh - 48px);
        max-height: calc(100vh - 48px);
        min-height: 240px;
        box-shadow: 4px 6px 16px rgba(0, 20, 50, 0.28);
    }
    .page { position: relative; }
    .nav-toggle:checked ~ .desktop .sidebar { display: flex; }
    .nav-button { display: inline-block; }
    .content { padding: 12px; }
    .top-search { width: min(140px, 28vw); min-width: 96px; }
}
