@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
    /* ELTRANS brand ? ksi?ga znaku */
    --eltrans-petrol: #004040;
    --eltrans-petrol-deep: #002e2e;
    --eltrans-ink: #2c4450;
    --eltrans-teal: #1f8a82;
    --eltrans-cyan: #2aa89a;
    --eltrans-cyan-soft: #e6f6f4;
    --eltrans-slate: #3c505e;

    --app-bg-0: #eef3f3;
    --app-bg-1: #f5f8f8;
    --app-bg-2: #e8f0f0;
    --app-ink: #1a2a30;
    --app-muted: #5a6d73;
    --app-border: #d2e0e0;
    --app-surface: #ffffff;
    --app-accent: var(--eltrans-teal);
    --app-accent-soft: var(--eltrans-cyan-soft);
    --app-shadow: 0 10px 28px rgba(0, 64, 64, 0.08);
    --app-radius: 12px;
    --app-input-radius: 10px;
    --app-input-border: #d4deef;
    --app-input-focus-ring: 0 0 0 3px rgba(42, 168, 154, 0.18);
    --app-font: "Source Sans 3", "Segoe UI", sans-serif;
    --app-font-display: "Montserrat", "Segoe UI", sans-serif;
    --app-page-pad: 1.2rem;
    --app-sticky-offset: 3.4rem;
}

body {
    font-family: var(--app-font);
    margin: 0;
    background:
        radial-gradient(1100px 480px at 8% -12%, rgba(42, 168, 154, 0.12), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(0, 64, 64, 0.08), transparent 52%),
        linear-gradient(165deg, var(--app-bg-0) 0%, var(--app-bg-1) 48%, var(--app-bg-2) 100%);
    color: var(--app-ink);
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--app-page-pad);
}

.app-shell input[type="text"],
.app-shell input[type="search"],
.app-shell input[type="date"],
.app-shell input[type="number"],
.app-shell input[type="tel"],
.app-shell input[type="email"],
.app-shell input[type="password"],
.app-shell select,
.app-shell textarea {
    border-radius: var(--app-input-radius);
}

.app-shell input[type="text"]:focus,
.app-shell input[type="search"]:focus,
.app-shell input[type="date"]:focus,
.app-shell input[type="number"]:focus,
.app-shell input[type="tel"]:focus,
.app-shell input[type="email"]:focus,
.app-shell input[type="password"]:focus,
.app-shell select:focus,
.app-shell textarea:focus {
    border-color: var(--eltrans-cyan);
    box-shadow: var(--app-input-focus-ring);
}

.app-top-nav {
    display: flex;
    align-items: center;
    gap: 0.65rem 0.85rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
    margin: calc(-1 * var(--app-page-pad)) calc(-1 * var(--app-page-pad)) 1rem;
    padding: 0.5rem var(--app-page-pad);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    background: linear-gradient(135deg, var(--eltrans-petrol-deep) 0%, var(--eltrans-petrol) 55%, #0a5550 100%);
    box-shadow: 0 8px 24px rgba(0, 46, 46, 0.28);
    overflow: visible;
    /* Shared top-nav item typography (module switcher + section links). */
    --app-nav-item-font-size: 0.74rem;
    --app-nav-item-font-weight: 600;
    --app-nav-item-letter-spacing: 0.01em;
    --app-nav-item-line-height: 1.2;
    --app-nav-item-padding-y: 0.38rem;
    --app-nav-item-padding-x: 0.72rem;
}

.app-top-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    padding: 0.15rem 0.25rem;
    text-decoration: none;
    color: #fff;
    line-height: 1;
}

.app-top-logo {
    display: block;
    height: 1.35rem;
    width: auto;
}

.app-top-product {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: var(--app-nav-item-padding-y, 0.38rem) var(--app-nav-item-padding-x, 0.72rem);
    border-left: 1px solid rgba(255, 255, 255, 0.28);
    margin-left: 0.1rem;
    padding-left: 0.55rem;
    font-family: var(--app-font-display);
    font-size: var(--app-nav-item-font-size, 0.74rem);
    font-weight: var(--app-nav-item-font-weight, 600);
    letter-spacing: var(--app-nav-item-letter-spacing, 0.01em);
    line-height: var(--app-nav-item-line-height, 1.2);
    text-transform: none;
    color: var(--eltrans-cyan);
}

.app-top-nav .planner-section-nav {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.app-top-user-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

.app-today-override-form {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.35rem;
    margin: 0;
}

.app-today-override-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.68rem;
    line-height: 1.1;
}

.app-today-override-input {
    width: 8.6rem;
    padding: 0.2rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f2733;
    font: inherit;
    font-size: 0.76rem;
}

.app-today-override-reset {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: inherit;
    font-size: 0.72rem;
    padding: 0.28rem 0.45rem;
    cursor: pointer;
}

.app-today-override-reset:hover {
    background: rgba(255, 255, 255, 0.18);
}

.app-top-user-form {
    margin-left: 0;
    flex-shrink: 0;
}

.app-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.app-top-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font: inherit;
    appearance: none;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-top-icon-btn:hover,
.app-top-icon-btn.is-active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.app-top-icon-btn:focus-visible {
    outline: 2px solid #9ec5ff;
    outline-offset: 2px;
}

.app-top-icon {
    display: block;
    flex-shrink: 0;
}

.app-top-icon-btn.app-top-login-btn {
    width: auto;
    min-width: 2.15rem;
    height: 2.35rem;
    padding: 0 0.85rem 0 0.65rem;
    gap: 0.4rem;
}

.app-top-login-label {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.app-top-user-menu {
    position: relative;
    flex-shrink: 0;
}

.app-top-user-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    min-width: 11rem;
    max-width: 16rem;
    min-height: 2.15rem;
    padding: 0.28rem 0.55rem 0.28rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--eltrans-ink);
    font-family: var(--app-font);
    cursor: pointer;
    text-align: left;
}

.app-top-user-toggle:hover,
.app-top-user-toggle[aria-expanded="true"] {
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(42, 168, 154, 0.22);
}

.app-top-user-toggle:focus-visible {
    outline: 2px solid #9ec5ff;
    outline-offset: 2px;
}

.app-top-user-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 0.02rem;
    min-width: 0;
    flex: 1 1 auto;
}

.app-top-user-name {
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--eltrans-ink);
}

.app-top-user-role {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.1;
    color: #5a6b82;
    text-transform: none;
    letter-spacing: 0;
}

.app-top-user-chevron {
    flex-shrink: 0;
    color: #5a6b82;
    transition: transform 0.15s ease;
}

.app-top-user-toggle[aria-expanded="true"] .app-top-user-chevron {
    transform: rotate(180deg);
}

.app-top-user-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 90;
    width: min(16rem, calc(100vw - 1.5rem));
    display: flex;
    flex-direction: column;
    border: 1px solid #c8d4ea;
    border-radius: 12px;
    background: #fff;
    color: #1f2733;
    box-shadow: 0 14px 36px rgba(31, 39, 51, 0.18);
    overflow: hidden;
}

.app-top-user-dropdown[hidden] {
    display: none !important;
}

.app-top-user-dropdown-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #e4ebf7;
}

.app-top-user-dropdown-header strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.app-top-user-dropdown-header span {
    font-size: 0.78rem;
    color: #5a6b82;
}

.app-top-user-dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem;
}

.app-top-user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #1f2733;
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.app-top-user-dropdown-item.is-active {
    background: #e7f6f3;
    color: #0f4f4a;
    font-weight: 700;
}

.app-top-user-logout-form {
    margin: 0;
}

.app-top-user-logout {
    color: #b42318;
}

.trip-modal-panel:has(.auth-modal) {
    width: min(28rem, calc(100vw - 1.5rem));
}

.trip-modal-body .auth-modal .form-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.app-top-user-form select {
    min-width: 11rem;
    max-width: 16rem;
    padding: 0.38rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--eltrans-ink);
    font-family: var(--app-font);
    font-size: 0.84rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.app-top-user-form select:focus {
    outline: none;
    border-color: var(--eltrans-cyan);
    box-shadow: 0 0 0 3px rgba(42, 168, 154, 0.28);
}

.driver-list-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.driver-list-heading h2 {
    margin: 0;
}

.driver-list-heading-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.driver-list-filter-summary {
    margin: 0;
    font-size: 0.82rem;
    color: var(--app-muted);
    line-height: 1.35;
}

.driver-list-heading-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.driver-list-heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-shrink: 0;
}

.driver-scope-switch-form {
    display: inline-flex;
    margin: 0;
}

.driver-scope-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.22rem;
    border-radius: 999px;
    background: rgba(4, 57, 54, 0.06);
    border: 1px solid var(--app-border);
}

.driver-scope-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.42rem 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--eltrans-ink);
    font-family: var(--app-font-display);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.driver-scope-switch-btn:hover {
    background: rgba(42, 168, 154, 0.14);
}

.driver-scope-switch-btn.is-active {
    background: var(--eltrans-petrol);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 64, 64, 0.18);
}

.driver-scope-switch-btn.is-active:hover {
    background: var(--eltrans-petrol);
    color: #fff;
}

.driver-scope-switch-form--compact .driver-scope-switch-btn {
    min-height: 1.85rem;
    padding: 0.3rem 0.72rem;
    font-size: 0.76rem;
}

.driver-list-heading-actions .board-driver-scope-form {
    margin: 0;
}

body.board-page .app-top-nav {
    margin-bottom: 0.55rem;
}

.app-page-header {
    margin: 0 0 1.1rem;
}

.app-page-header h1 {
    margin: 0;
    font-family: var(--app-font-display);
    font-size: clamp(1.55rem, 2.2vw, 1.95rem);
    font-weight: 780;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--eltrans-petrol);
}

.page-lede {
    margin: 0.45rem 0 0;
    max-width: 46rem;
    color: var(--app-muted);
    font-size: 0.98rem;
    line-height: 1.45;
    font-weight: 500;
}

.page-lede--compact {
    margin-top: 0.35rem;
    font-size: 0.88rem;
    max-width: 52rem;
}

.reports-page .app-page-header,
.app-page-header.app-page-header--split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.trip-vehicle-segments ul,
.trip-vehicle-segments-list {
    margin: 0.25rem 0 0.55rem;
    padding-left: 1.15rem;
}

.trip-vehicle-swap-note {
    display: block;
    color: var(--app-muted);
    font-size: 0.86em;
}

.report-modal-form fieldset.report-modal-field {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.report-modal-form fieldset.report-modal-field legend {
    font-weight: 650;
    margin-bottom: 0.35rem;
}

.report-modal-form fieldset.report-modal-field ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.route-swap-kind-field > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.route-swap-kind-field > div > div,
.route-swap-kind-field li {
    width: auto;
    max-width: 100%;
}

.route-swap-kind-field label {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: auto;
    margin: 0;
    font-weight: 500;
}

.route-swap-kind-field input[type="radio"] {
    appearance: auto;
    width: 1.05rem;
    height: 1.05rem;
    min-width: 1.05rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    box-shadow: none;
    flex: 0 0 auto;
}

.report-description-cell {
    width: 42%;
    min-width: 16rem;
    max-width: none;
}

.report-description-preview {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-toolbar {
    margin-top: 0.35rem;
}

.reports-table {
    width: 100%;
}

.reports-table th,
.reports-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.reports-table th.report-description-col,
.reports-table td.report-description-cell {
    white-space: nowrap;
}

.reports-table td.report-date-cell {
    white-space: nowrap;
}

.report-date-updated {
    color: var(--app-muted);
    font-weight: 500;
}

.reports-table th.report-actions-col,
.reports-table td.report-actions-cell {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.reports-table td.report-actions-cell .button.tiny {
    margin-top: 0;
}

.driver-count-scope-notice {
    margin: 0.55rem 0 0;
    max-width: 52rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(42, 168, 154, 0.28);
    background: rgba(230, 246, 244, 0.65);
    color: var(--app-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.driver-count-scope-notice strong {
    color: var(--eltrans-ink);
    font-weight: 650;
}

.driver-count-scope-notice a {
    color: var(--eltrans-teal);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.driver-count-scope-notice a:hover {
    text-decoration: underline;
}

.page-lede time {
    font-weight: 700;
    color: var(--eltrans-ink);
    font-variant-numeric: tabular-nums;
}

.page-lede-sep {
    margin: 0 0.35rem;
    color: #9aa8bc;
    font-weight: 500;
}

.app-profile-bar {
    border-color: var(--app-border);
}

.planner-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    padding: 0.28rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 2px 10px rgba(0, 64, 64, 0.04);
}

.planner-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: var(--app-nav-item-padding-y, 0.38rem) var(--app-nav-item-padding-x, 0.72rem);
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.82);
    background: transparent;
    font-family: var(--app-font-display);
    font-weight: var(--app-nav-item-font-weight, 600);
    font-size: var(--app-nav-item-font-size, 0.74rem);
    letter-spacing: var(--app-nav-item-letter-spacing, 0.01em);
    line-height: var(--app-nav-item-line-height, 1.2);
    text-transform: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.planner-nav-link:hover {
    background: rgba(42, 168, 154, 0.18);
    color: #fff;
}

.planner-nav-link.is-active {
    background: var(--eltrans-cyan);
    color: #043531;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(42, 168, 154, 0.35);
}

.planner-nav-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.planner-nav-menu-toggle {
    gap: 0.28rem;
    cursor: pointer;
    /* Keep typography from .planner-nav-link / .app-top-product — do not font:inherit
       (that would pick up body size and make dropdown triggers look larger). */
    appearance: none;
    -webkit-appearance: none;
}

button.planner-nav-link,
button.app-top-product {
    font-family: var(--app-font-display);
    font-size: var(--app-nav-item-font-size, 0.74rem);
    font-weight: var(--app-nav-item-font-weight, 600);
    letter-spacing: var(--app-nav-item-letter-spacing, 0.01em);
    line-height: var(--app-nav-item-line-height, 1.2);
    text-transform: none;
}

.planner-nav-menu-chevron {
    flex-shrink: 0;
    width: 0.75rem;
    height: 0.75rem;
    opacity: 0.85;
    transition: transform 0.15s ease;
}

.planner-nav-menu.is-open .planner-nav-menu-chevron,
.planner-nav-menu-toggle[aria-expanded="true"] .planner-nav-menu-chevron {
    transform: rotate(180deg);
}

.planner-nav-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 11.5rem;
    padding: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: linear-gradient(160deg, #064a46 0%, #043936 100%);
    box-shadow: 0 12px 28px rgba(0, 30, 28, 0.45);
}

.planner-nav-menu-dropdown[hidden] {
    display: none;
}

.planner-nav-menu-item {
    display: block;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--app-font-display);
    font-size: var(--app-nav-item-font-size, 0.74rem);
    font-weight: var(--app-nav-item-font-weight, 600);
    letter-spacing: var(--app-nav-item-letter-spacing, 0.01em);
    line-height: 1.25;
    text-transform: none;
    white-space: nowrap;
}

.planner-nav-menu-item:hover {
    background: rgba(42, 168, 154, 0.22);
    color: #fff;
}

.planner-nav-menu-item.is-active {
    background: var(--eltrans-cyan);
    color: #043531;
}

.board-top-bar .planner-nav-menu-dropdown {
    min-width: 10.5rem;
}

.app-version-footer {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0.2rem;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-family: var(--app-font-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: none;
}

.app-version-footer:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(42, 168, 154, 0.28);
}

.board-top-bar .planner-section-nav {
    padding: 0.18rem;
    gap: 0.2rem;
}

.board-top-bar .planner-nav-link {
    padding: 0.26rem 0.55rem;
    /* Keep same type size as the rest of top nav — only tighten padding on the board. */
    font-size: var(--app-nav-item-font-size, 0.74rem);
    font-weight: var(--app-nav-item-font-weight, 600);
    letter-spacing: var(--app-nav-item-letter-spacing, 0.01em);
}

.driver-text-search-field {
    min-width: 14rem;
    flex: 1 1 14rem;
}

.driver-text-search-field input[type="search"],
.driver-text-search-field input.board-filter-search {
    width: 100%;
    min-width: 12rem;
    padding: 0.42rem 0.65rem;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: #fff;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.driver-text-search-field input[type="search"]:focus,
.driver-text-search-field input.board-filter-search:focus {
    outline: none;
    border-color: var(--eltrans-cyan);
    box-shadow: 0 0 0 3px rgba(42, 168, 154, 0.18);
}

.kpi-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.kpi-quick-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 64, 64, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi-quick-link:hover {
    transform: translateY(-1px);
    border-color: #9dcec8;
    box-shadow: 0 8px 18px rgba(0, 64, 64, 0.08);
}

.kpi-quick-link strong {
    color: var(--eltrans-petrol);
    font-size: 0.95rem;
}

.kpi-quick-link span {
    color: var(--app-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.fleet-kpi-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.fleet-kpi-card--link:hover {
    transform: translateY(-1px);
    border-color: #9dcec8;
    box-shadow: 0 8px 18px rgba(0, 64, 64, 0.08);
}

.top-bar,
.navigation,
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.table-wrap {
    overflow: auto;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(56, 93, 158, 0.07);
}

table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid #edf1f8;
    min-width: 0;
    vertical-align: top;
    padding: 0.3rem;
}

th {
    background: #f3f8f7;
}

.sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    white-space: nowrap;
}

.sticky-col small {
    display: block;
    margin-top: 0.15rem;
    color: #5a6b82;
    line-height: 1.25;
}

.planner-table th,
.planner-table td {
    min-width: 0;
    padding: 0.18rem 0.22rem;
    overflow-wrap: anywhere;
}

.planner-table .sticky-col {
    min-width: unset;
    max-width: unset;
}

.planner-table .sticky-col small {
    font-size: 0.74rem;
    word-break: break-word;
}

.planner-table tbody tr {
    height: 36px;
}

.board-table-wrap {
    max-height: calc(100vh - 170px);
}

body.board-page {
    height: 100vh;
    overflow: hidden;
}

body.trip-modal-open {
    overflow: hidden;
}

.trip-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.trip-modal[hidden] {
    display: none;
}

.trip-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.trip-modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: min(92vh, 900px);
    overflow: auto;
    background: #fff;
    border: 1px solid #dbe4f5;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.trip-modal-panel:has(.rating-history-modal) {
    width: min(1140px, 96vw);
}

.trip-modal-content {
    padding: 1rem 1.1rem 1.2rem;
}

.trip-modal-panel:has(.report-modal-content) {
    width: min(560px, 96vw);
}

.report-modal-form {
    display: grid;
    gap: 0.85rem;
}

.report-modal-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.report-modal-field > span:first-child {
    font-weight: 600;
    color: var(--eltrans-ink);
}

.report-modal-form .driver-search-field {
    min-width: 0;
    width: 100%;
}

.report-modal-form input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.report-modal-form select,
.report-modal-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--app-input-border);
    border-radius: 8px;
    padding: 0.48rem 0.55rem;
    font: inherit;
}

.report-modal-form textarea {
    min-height: 8.5rem;
    resize: vertical;
}

.report-modal-vehicles {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
}

.route-swap-trips {
    grid-template-columns: minmax(0, 1fr);
}

.report-modal-form .help {
    font-size: 0.78rem;
    color: #5a6b82;
    line-height: 1.3;
}

@media (max-width: 560px) {
    .report-modal-vehicles {
        grid-template-columns: minmax(0, 1fr);
    }
}

.trip-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.trip-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.trip-modal-header .subtitle {
    margin: 0.25rem 0 0;
}

.trip-modal-close {
    border: none;
    background: #eef2f8;
    color: #334155;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.trip-modal-close:hover {
    background: #e2e8f0;
}

.trip-modal-body .form-actions {
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
}

.trip-modal-loading {
    padding: 2rem 1.2rem;
    text-align: center;
    color: #64748b;
}

.trip-save-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.55);
}

.trip-save-overlay[hidden] {
    display: none;
}

body.trip-save-busy {
    cursor: progress;
}

.trip-save-overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    max-width: 22rem;
    padding: 1.35rem 1.5rem 1.25rem;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
    text-align: center;
}

.trip-save-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #dbe4f5;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: trip-save-spin 0.7s linear infinite;
}

@keyframes trip-save-spin {
    to {
        transform: rotate(360deg);
    }
}

.trip-save-overlay-title {
    margin: 0.35rem 0 0;
    font-size: 1.05rem;
    font-weight: 650;
    color: #0f172a;
}

.trip-save-overlay-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #475569;
}

.trip-modal-body .trip-legend,
.trip-modal-body .trip-calendar-hint {
    margin-bottom: 0.75rem;
}

.trip-modal-body .trip-event-summary {
    margin-bottom: 0.75rem;
}

.trip-modal-body .trip-timeline {
    margin-bottom: 0.85rem;
}

.assignment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.assignment-actions form {
    margin: 0;
}

.driver-vehicle-cell {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.driver-vehicle-reg {
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
}

.driver-vehicle-action-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}

.driver-vehicle-attach-form {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.driver-vehicle-attach-form .button {
    align-self: flex-start;
}

.driver-vehicle-attach-search {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
}

.driver-vehicle-attach-search .driver-search {
    min-width: 0;
    width: 100%;
}

.driver-vehicle-attach-search .driver-search-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.72rem;
    padding: 0.28rem 0.4rem;
}

.driver-vehicle-attach-search .driver-search-results {
    z-index: 60;
    max-height: 200px;
    min-width: 11rem;
    width: max(100%, 11rem);
}

.driver-vehicle-attach-form select {
    max-width: 7.2rem;
    font-size: 0.72rem;
}

.driver-vehicle-hint {
    font-size: 0.7rem;
    color: var(--app-muted);
}

.driver-vehicle-permanent {
    font-size: 0.72rem;
    color: var(--app-muted);
    white-space: nowrap;
}

.driver-qualification-editor {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 11rem;
    max-width: 16rem;
}

.driver-qualification-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    width: 100%;
}

.driver-qualification-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.driver-qualification-add-row select {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.72rem;
    box-sizing: border-box;
}

.driver-qualification-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.qualification-badges-collapsed {
    position: relative;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.15rem;
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
}

.qualification-badges-collapsed > .badge,
.qualification-badges-collapsed > .driver-qualification-chip-form {
    flex: 0 0 auto;
}

.badge-driver-qualification-more {
    cursor: pointer;
    background: #e2e8f0;
    color: #0b1f3a;
    border-color: #cbd5e1;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.05rem 0.28rem;
    font-size: 0.62rem;
    line-height: 1.15;
}

.badge-driver-qualification-more:hover {
    background: #cbd5e1;
}

.qualification-overflow {
    position: absolute;
    top: calc(100% + 0.15rem);
    left: 0;
    z-index: 80;
    display: none;
    flex-wrap: wrap;
    gap: 0.2rem;
    min-width: 7rem;
    max-width: 14rem;
    padding: 0.3rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    white-space: normal;
}

.qualification-overflow[hidden] {
    display: none !important;
}

.qualification-badges-collapsed.is-open > .qualification-overflow {
    display: flex;
}

.qualification-overflow.is-ported {
    position: fixed;
    z-index: 4600;
    display: flex;
}

.qualification-badges-collapsed.is-open > .badge-driver-qualification-more {
    background: #0b1f3a;
    color: #f8fafc;
    border-color: #0b1f3a;
}

.driver-qualification-chip-form {
    margin: 0;
    display: inline-flex;
}

.badge-driver-qualification {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: #0b1f3a;
    color: #f8fafc;
    border: 1px solid #0b1f3a;
    padding: 0.05rem 0.28rem;
    border-radius: 5px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.15;
    white-space: nowrap;
}

.badge-driver-qualification-adr,
.badge-driver-qualification-wiza,
.badge-driver-qualification-kartapobytu,
.badge-driver-qualification-jeździnaanglie {
    background: #0b1f3a;
    color: #f8fafc;
    border-color: #0b1f3a;
}

.badge-driver-qualification.is-ok {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.badge-driver-qualification.is-soon {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.badge-driver-qualification.is-overdue {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.badge-driver-qualification.is-ok .driver-qualification-remove,
.badge-driver-qualification.is-soon .driver-qualification-remove,
.badge-driver-qualification.is-overdue .driver-qualification-remove {
    color: inherit;
    opacity: 0.75;
}

.board-qualification-badges {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.15rem;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
}

body.board-page .board-frozen-scroll tbody td.frozen-qualifications-col {
    overflow: visible;
}

body.board-page .board-frozen-scroll tbody td.frozen-qualifications-col .frozen-cell-content {
    overflow: visible;
}

body.board-page .board-frozen-scroll tbody td.frozen-qualifications-col .qualification-badges-collapsed {
    max-width: 100%;
}

body.board-page .board-frozen-scroll tbody td.frozen-qualifications-col .badge-driver-qualification-more {
    max-width: none;
}

.driver-qualification-remove {
    appearance: none;
    border: 0;
    background: transparent;
    color: #5a6b82;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0 0.15rem;
    border-radius: 999px;
}

.driver-qualification-remove:hover {
    color: #b91c1c;
    background: #fee2e2;
}

.driver-details-table th.col-qualifications,
.driver-details-table td.col-qualifications {
    white-space: nowrap;
    min-width: 4.25rem;
    width: 7.5rem;
    max-width: 9.5rem;
    vertical-align: middle;
}

.driver-details-table td.col-qualifications .driver-qualification-badges {
    gap: 0.2rem;
}

.driver-details-table td.col-qualifications .driver-qualification-editor {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.driver-details-table td.col-qualifications .badge-driver-qualification-more {
    max-width: none;
}

.fleet-vehicle-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.3rem;
    align-items: stretch;
}

.driver-details-table-wrap {
    overflow: auto;
    max-width: 100%;
}

.driver-details-table tbody tr {
    height: auto;
    min-height: 2.4rem;
}

.driver-details-table th,
.driver-details-table td {
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.35rem 0.45rem;
}

.driver-details-table td.col-driver-name,
.driver-details-table td.col-work-system {
    white-space: normal;
}

.driver-details-table td.col-driver-name {
    min-width: 10rem;
}

.driver-details-table td.col-work-system {
    min-width: 7rem;
}

.driver-details-table th.col-vehicle,
.driver-details-table td.col-vehicle {
    white-space: normal;
    min-width: 7.25rem;
    max-width: 9rem;
    width: 8rem;
    vertical-align: top;
    overflow: visible;
}

.driver-details-table td.col-vehicle .driver-vehicle-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.driver-details-table td.col-vehicle .driver-vehicle-attach-form {
    width: 100%;
}

.driver-details-table td.col-vehicle .driver-vehicle-attach-form select {
    max-width: 6.5rem;
}

.driver-details-table th.col-event-status,
.driver-details-table td.col-event-status {
    min-width: 4.8rem;
    width: 5.4rem;
    white-space: normal;
    vertical-align: top;
}

.driver-details-table th.col-assignment-status,
.driver-details-table td.col-assignment-status {
    min-width: 10rem;
    max-width: 12.5rem;
    width: 11rem;
    white-space: normal;
    vertical-align: top;
    overflow: visible;
}

.driver-details-table td.col-assignment-status .badge {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.driver-details-table th.col-actions,
.driver-details-table td.col-actions {
    position: sticky;
    right: 0;
    z-index: 4;
    min-width: 6.25rem;
    width: 6.75rem;
    max-width: 7.25rem;
    background: #fff;
    box-shadow: -6px 0 10px rgba(15, 40, 60, 0.07);
    white-space: normal;
    overflow: visible;
    vertical-align: top;
    padding: 0.3rem 0.3rem;
}

.driver-details-table thead th.col-actions {
    z-index: 9;
    background: #f8fbff;
}

.driver-details-table .assignment-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.18rem;
    width: 100%;
}

.driver-details-table .assignment-actions .button {
    width: 100%;
    white-space: nowrap;
    box-sizing: border-box;
    min-height: 1.55rem;
    line-height: 1.1;
    padding: 0.12rem 0.28rem;
    font-size: 0.68rem;
    margin-top: 0;
}

.driver-details-table .assignment-actions select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.68rem;
}

.driver-details-table .transfer-driver-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    min-width: 0;
}

.driver-details-table th.col-rating,
.driver-details-table td.col-rating {
    min-width: 9.25rem;
    width: 9.5rem;
    max-width: none;
    white-space: normal;
    vertical-align: top;
    overflow: visible;
}

.driver-details-table .rating-summary-cell {
    min-width: 9rem;
}

.driver-details-table .rating-summary-row {
    gap: 0.18rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.driver-details-table .rating-summary-label {
    min-width: 2.1rem;
}

.driver-details-table .rating-summary-value {
    min-width: 1.7rem;
    font-size: 0.78rem;
}

.driver-details-table .star-display-icon {
    font-size: 0.78rem;
}

.driver-details-table .rating-summary-link {
    display: inline-block;
    margin-top: 0.15rem;
}

.driver-details-table .badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    white-space: normal;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: #eef2f7;
    color: #334155;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-neutral {
    background: #eef2f7;
    color: #334155;
    font-size: 0.75rem;
    line-height: 1.25;
    white-space: normal;
    text-align: left;
}

.badge-driver-tag {
    font-weight: 700;
    letter-spacing: 0.03em;
}

.badge-driver-tag-kraj {
    background: #dcfce7;
    color: #166534;
}

.badge-driver-tag-mdz {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-driver-tag-kraj-rus {
    background: #fef3c7;
    color: #92400e;
}

.driver-tag-form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    flex-wrap: wrap;
}

.driver-tag-form select {
    border: 1px solid #d4deef;
    border-radius: 8px;
    padding: 0.22rem 0.35rem;
    background: #fff;
    font: inherit;
    font-size: 0.78rem;
}

.driver-work-system-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 11rem;
    margin: 0;
}

.driver-work-system-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.driver-work-system-field {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}

.driver-work-system-field input {
    width: 4.2rem;
    border: 1px solid #d4deef;
    border-radius: 8px;
    padding: 0.22rem 0.35rem;
    background: #fff;
    font: inherit;
    font-size: 0.78rem;
}

.driver-work-system-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.driver-work-system-preview {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f172a;
}

.driver-work-system-local {
    font-size: 0.65rem;
}

.driver-work-system-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.driver-work-extra {
    margin: 0.45rem 0 0;
    padding: 0.4rem 0.6rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    min-width: 0;
}

.driver-work-extra legend {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
    padding: 0 0.2rem;
    margin: 0;
}

.driver-work-extra-options {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.trip-form-stack .driver-work-extra-option,
.driver-work-extra-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    width: auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.trip-form-stack .driver-work-extra-option input,
.driver-work-extra-option input {
    width: auto;
    height: 0.95rem;
    margin: 0;
    flex: 0 0 auto;
}

.badge-event {
    border: 1px solid transparent;
    font-weight: 600;
    white-space: nowrap;
}

.badge-event-departure {
    background: linear-gradient(160deg, #ffe6bf, #ffbf66);
    border-color: #f08c00;
    color: #7a3e00;
}

.badge-event-driving {
    background: linear-gradient(160deg, #d3e8ff, #9ec5ff);
    border-color: #1e88e5;
    color: #0d47a1;
}

.badge-event-return {
    background: linear-gradient(160deg, #fff3c4, #ffe082);
    border-color: #fbc02d;
    color: #7a5d00;
}

.badge-event-departure-return {
    background: linear-gradient(90deg, #ffbf66 0%, #ffbf66 50%, #ffe082 50%, #ffe082 100%);
    border-color: #f08c00;
    color: #7a3e00;
}

.badge-event-return-departure {
    background: linear-gradient(90deg, #ffe082 0%, #ffe082 50%, #ffbf66 50%, #ffbf66 100%);
    border-color: #f08c00;
    color: #7a3e00;
}

.badge-event-vacation {
    background: linear-gradient(160deg, #f3e8ff, #e9d5ff);
    border-color: #a855f7;
    color: #6b21a8;
}

.badge-event-default {
    background: #eef2f7;
    border-color: #cbd5e1;
    color: #334155;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.delegation-list {
    margin: 0;
    padding-left: 1rem;
}

.transfer-driver-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.team-drivers-row td {
    background: #f8fafc;
    font-size: 0.9rem;
}

.team-sync-form {
    margin-bottom: 0.75rem;
}

.team-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.team-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.team-form-grid p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.team-form-checkbox {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem !important;
}

.team-member-pickers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.team-member-picker {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #f8fbff;
    padding: 0.85rem 0.95rem;
}

.team-member-picker h3 {
    margin: 0 0 0.55rem;
}

.team-member-picker ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.45rem;
}

.team-member-picker li label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.team-driver-picker {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
}

.team-driver-picker [data-team-driver-filter] {
    width: 100%;
    box-sizing: border-box;
}

.team-driver-picker .subtitle {
    margin: 0 0 0.55rem;
}

.team-driver-picker-list {
    max-height: 18rem;
    overflow: auto;
    padding-right: 0.25rem;
}

.team-driver-picker-list ul {
    margin-top: 0.45rem;
}

.team-list-cards {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.75rem;
}

.team-card {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #fff;
    padding: 0.95rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 64, 64, 0.05);
}

.team-reset-card {
    border-color: #f0c4c7;
    background: #fff8f8;
}

.team-reset-card .button.danger {
    margin-top: 0.35rem;
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.team-card-header h3 {
    margin: 0;
}

.team-card-members,
.team-driver-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.team-card-members {
    margin-top: 0.75rem;
}

.team-member-pill,
.team-driver-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    border: 1px solid #d7e3f5;
    border-radius: 999px;
    background: #f8fbff;
    padding: 0.45rem 0.7rem;
}

.team-driver-chip {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding-right: 0.35rem;
}

.team-driver-remove-form {
    margin: 0;
    display: inline-flex;
}

.team-driver-remove {
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8a97ab;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.team-driver-remove:hover {
    background: #fde8e8;
    color: #b42318;
}

.team-member-pill--temporary {
    border-style: dashed;
    background: #fffbeb;
}

.ops-gap-card {
    margin-bottom: 1rem;
    scroll-margin-top: 5.5rem;
}

.ops-gap-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.ops-gap-summary::-webkit-details-marker {
    display: none;
}

.ops-gap-summary-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.ops-gap-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: inherit;
}

.ops-gap-toggle-hint {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid #8a97ab;
    border-bottom: 2px solid #8a97ab;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-right: 0.2rem;
}

.ops-gap-card[open] > .ops-gap-summary .ops-gap-toggle-hint {
    transform: rotate(225deg);
    margin-top: 0.25rem;
}

.ops-gap-body {
    margin-top: 0.55rem;
}

.ops-gap-count {
    display: inline-flex;
    min-width: 1.6rem;
    justify-content: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #fde8e8;
    color: #b42318;
    font-size: 0.85rem;
    font-weight: 700;
}

.ops-gap-jump-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    margin: 0.35rem 0 0.55rem;
}

.ops-gap-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.28rem 0.65rem;
    border: 1px solid #f0c7c7;
    border-radius: 999px;
    background: #fff8f8;
    color: #9f1239;
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.25;
}

.ops-gap-jump:hover {
    background: #ffe8e8;
    border-color: #e8a0a0;
}

.ops-gap-jump-label {
    min-width: 0;
}

.ops-gap-jump-count {
    display: inline-flex;
    min-width: 1.45rem;
    justify-content: center;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #fde8e8;
    color: #b42318;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

body.fleet-vehicles-page .vehicle-list-heading-main .ops-gap-jump {
    margin: 0.15rem 0 0.45rem;
}

.ops-gap-card.is-empty .ops-gap-count {
    background: #eef3f8;
    color: #5b6b80;
}

.ops-gap-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-height: 16rem;
    overflow: auto;
    margin-top: 0.75rem;
}

.ops-gap-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    border: 1px solid #f0c7c7;
    border-radius: 12px;
    background: #fff8f8;
    padding: 0.4rem 0.7rem;
    color: inherit;
    text-decoration: none;
    max-width: 18rem;
}

a.ops-gap-chip:hover {
    border-color: #e08a8a;
    background: #fff1f1;
}

.ops-gap-chip span {
    color: #8a97ab;
    font-size: 0.8rem;
}

.ops-gap-card .page-lede--compact {
    margin: 0.35rem 0 0;
}

.ops-gaps-section {
    margin-bottom: 1.75rem;
}

.ops-gaps-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.ops-gaps-section-head::-webkit-details-marker {
    display: none;
}

.ops-gaps-section-head-main {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
}

.ops-gaps-section-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.ops-gaps-section[open] > .ops-gaps-section-head .ops-gap-toggle-hint {
    transform: rotate(225deg);
    margin-top: 0.25rem;
}

.ops-gaps-group {
    padding: 0.85rem 1rem 0.4rem;
}

.ops-gaps-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.ops-gaps-group-head::-webkit-details-marker {
    display: none;
}

.ops-gaps-group-head-main {
    min-width: 0;
}

.ops-gaps-group-head-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.ops-gaps-group-title {
    margin: 0;
    font-size: 1.08rem;
}

.ops-gaps-group-sub {
    margin: 0.2rem 0 0;
    color: var(--app-muted);
    font-size: 0.85rem;
}

.ops-gaps-group[open] > .ops-gaps-group-head .ops-gap-toggle-hint {
    transform: rotate(225deg);
    margin-top: 0.25rem;
}

.ops-gaps-group .ops-gap-card {
    margin-bottom: 0.65rem;
}

.driver-vehicle-attach-permanent {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--app-muted, #64748b);
    white-space: nowrap;
}

.ops-gap-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    border: 1px solid #f0c7c7;
    border-radius: 12px;
    background: #fff8f8;
    padding: 0.4rem 0.7rem;
    color: inherit;
    text-decoration: none;
    max-width: 18rem;
}

a.ops-gap-chip:hover {
    border-color: #e08a8a;
    background: #fff1f1;
}

.ops-gap-chip span {
    color: #8a97ab;
    font-size: 0.8rem;
}

.ops-gap-card .page-lede--compact {
    margin: 0.35rem 0 0;
}

.team-member-pill strong,
.team-driver-chip {
    font-size: 0.84rem;
}

.team-member-pill span {
    font-size: 0.74rem;
    color: #64748b;
}

.team-card-drivers {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.team-driver-assign-form {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: flex-end;
}

.team-driver-search-field {
    flex: 1 1 18rem;
    min-width: 16rem;
}

.team-audit-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-audit-entry {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 0.8rem 0.95rem;
    background: #fbfdff;
}

.team-audit-entry-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.team-audit-entry p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.profile-page-header {
    align-items: flex-start;
    gap: 1rem;
}

.profile-page-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-switch-card {
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.profile-switch-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.profile-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-action-grid--ops {
    grid-template-columns: 1fr;
}

.profile-action-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}

.profile-action-card-header h2 {
    margin-bottom: 0.35rem;
}

.profile-action-card--absence .profile-action-card-header .button {
    flex-shrink: 0;
}

.profile-absence-active-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid color-mix(in srgb, var(--eltrans-teal) 35%, transparent);
    background: color-mix(in srgb, var(--eltrans-teal) 8%, white);
    color: var(--eltrans-petrol);
}

.profile-absence-active-banner-note {
    color: var(--text-muted, #5a6672);
}

.profile-absence-active-banner-hint {
    flex-basis: 100%;
    font-size: 0.88rem;
    color: var(--text-muted, #5a6672);
}

.profile-absence-empty {
    margin-top: 0.25rem;
}

.profile-ops-shortcuts-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.profile-ops-shortcuts h2 {
    margin-top: 0;
    margin-bottom: 0.65rem;
}

.profile-action-card h2 {
    margin-top: 0;
}

.profile-absence-list {
    margin-top: 1rem;
}

.profile-end-absence-form {
    margin-top: 0.75rem;
}

.profile-action-card .profile-end-absence-form .button.danger {
    width: auto;
}

.profile-absence-list h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.compact-table td,
.compact-table th {
    font-size: 0.82rem;
}

.absence-modal-content .absence-delegation-panel {
    margin-top: 0.5rem;
}

.required-mark {
    color: #c62828;
}

.profile-drivers-card h2 {
    margin-top: 0;
}

.profile-drivers-toolbar {
    margin-bottom: 0;
}

.inline-role-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.rating-modal-content .trip-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rating-modal-content .form-grid {
    gap: 0.75rem;
}

.rating-modal-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0.35rem 0 0;
}

.rating-modal-content ul li {
    display: inline-flex;
    align-items: center;
    margin-right: 0.75rem;
}

.star-rating-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.star-rating-label {
    font-weight: 600;
    color: #1a2b44;
}

.star-rating-group {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.star-btn {
    border: none;
    background: transparent;
    color: #c5cdd8;
    font-size: 1.65rem;
    line-height: 1;
    padding: 0.1rem 0.15rem;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.1s ease;
}

.star-btn:hover,
.star-btn:focus-visible {
    color: #f5b301;
    transform: scale(1.08);
    outline: none;
}

.star-btn.is-active {
    color: #f5b301;
}

.star-display {
    display: inline-flex;
    align-items: center;
    gap: 0.05rem;
    vertical-align: middle;
}

.star-display-icon {
    color: #d5dbe3;
    font-size: 0.95rem;
    line-height: 1;
}

.star-display-icon.is-filled {
    color: #f5b301;
}

.rating-section-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.rating-criteria {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid #e3e9f2;
    border-radius: 8px;
    background: #fafcff;
}

.rating-summary-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 8.5rem;
}

.rating-summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #5a6b82;
    min-width: 2.3rem;
}

.rating-summary-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.rating-summary-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a2b44;
    min-width: 2rem;
}

.rating-summary-count {
    font-size: 0.78rem;
    color: #5a6b82;
}

.rating-summary-link {
    font-size: 0.78rem;
    color: #1f6feb;
    text-decoration: none;
    margin-top: 0.15rem;
}

.rating-summary-link:hover {
    text-decoration: underline;
}

.rating-summary-empty {
    color: #8a96a8;
}

.rating-period-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.rating-period-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #d7e0ec;
    background: #fff;
    color: #1a2b44;
    font-size: 0.82rem;
    text-decoration: none;
}

.rating-period-tab.is-active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #fff;
}

.rating-history-summary p {
    margin: 0.25rem 0;
}

.rating-history-table-wrap {
    margin-top: 0.75rem;
    overflow-x: visible;
}

.rating-history-table {
    width: 100%;
    table-layout: fixed;
}

.rating-history-table td,
.rating-history-table th {
    vertical-align: top;
    font-size: 0.8rem;
    line-height: 1.3;
}

.rating-history-table th:nth-child(1),
.rating-history-table td:nth-child(1) {
    width: 7.6rem;
}

.rating-history-table th:nth-child(2),
.rating-history-table td:nth-child(2) {
    width: 5.25rem;
}

.rating-history-table th.rating-criterion-col,
.rating-history-table td.rating-score-cell {
    width: 5.4rem;
}

.rating-history-table th.rating-comment-col,
.rating-history-table td.rating-comment-cell {
    width: 14rem;
}

.rating-history-table th.rating-trips-col,
.rating-history-table td.rating-trips-col {
    width: 12rem;
}

.rating-history-table th.rating-criterion-col {
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: normal;
    hyphens: auto;
}

.rating-score-cell-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
}

.rating-score-cell-inner .star-display-icon {
    font-size: 0.72rem;
}

.rating-comment-cell {
    max-width: none;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.rating-trip-ref {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.rating-comment-hint {
    color: #b45309;
}

.training-modal-content .training-score-list,
.training-modal-content .training-recommendation-list {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.training-modal-content .training-score-item,
.training-modal-content .training-recommendation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-right: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid #d9e1ea;
    border-radius: 8px;
    background: #f8fafc;
}

.training-score-item.is-weak,
.training-recommendation.is-primary {
    border-color: #f0c36d;
    background: #fff8e8;
}

.training-score-label,
.training-recommendation-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.training-score-value {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.training-message-preview {
    width: 100%;
    min-height: 8.5rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
}

.rankings-page .ranking-category-card,
.rankings-page .ranking-overall-card {
    margin-bottom: 1.25rem;
}

.rankings-page .ranking-overall-card {
    margin-top: 0.5rem;
    border-top: 3px solid #2563eb;
}

.ranking-period-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.ranking-block-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #334155;
}

.ranking-block-average {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.ranking-block-average-meta {
    color: #64748b;
    font-size: 0.85rem;
}

.ranking-empty {
    margin: 0;
    color: #64748b;
    font-style: italic;
}

.ranking-table th:first-child,
.ranking-table td:first-child {
    width: 2.5rem;
    text-align: center;
}

@media (max-width: 900px) {
    .ranking-period-grid {
        grid-template-columns: 1fr;
    }
}

body.fleet-page {
    height: 100vh;
    overflow: hidden;
}

body.fleet-ops-page {
    height: auto;
    overflow: auto;
}

body.fleet-ops-page .container {
    min-height: 100vh;
    overflow: visible;
}

.fleet-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.fleet-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.fleet-kpi-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: linear-gradient(160deg, #fbfffe, #eef7f6);
    box-shadow: 0 2px 8px rgba(0, 64, 64, 0.05);
}

.fleet-kpi-card--alert {
    border-color: #fed7aa;
    background: linear-gradient(160deg, #fffbf5, #fff3e0);
}

.kpi-home-page .fleet-kpi-value {
    font-variant-numeric: tabular-nums;
}

.fleet-kpi-label {
    font-family: var(--app-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-muted);
}

.fleet-kpi-value {
    font-family: var(--app-font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--eltrans-petrol);
    line-height: 1;
}

.fleet-kpi-card--alert .fleet-kpi-value {
    color: #b45309;
}

.fleet-kpi-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.trip-balance-section {
    margin-bottom: 1rem;
}

.trip-balance-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
    margin: 0.85rem 0 1rem;
}

.trip-balance-card {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    background: #fbfdff;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.trip-balance-line {
    margin: 0;
    font-size: 0.9rem;
}

.trip-balance-value {
    font-family: var(--app-font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--eltrans-petrol);
}

.trip-balance-value.is-negative,
.trip-balance-days-table td.is-negative {
    color: #b45309;
}

.trip-balance-value.is-positive,
.trip-balance-days-table td.is-positive {
    color: #0f766e;
}

.trip-balance-days-title {
    margin: 0.5rem 0 0.55rem;
    font-size: 1rem;
}

.trip-balance-days-table tr.is-today {
    background: #eef8f7;
}

.fleet-weekly-trips-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.fleet-weekly-trips-filters {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.fleet-base-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(4, 57, 54, 0.06);
    border: 1px solid var(--app-border);
}

.fleet-base-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.6rem;
    padding: 0.42rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--app-font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--eltrans-ink);
    background: transparent;
}

.fleet-base-switch-btn:hover {
    background: rgba(42, 168, 154, 0.14);
}

.fleet-base-switch-btn.is-active {
    background: var(--eltrans-petrol);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 64, 64, 0.18);
}

.fleet-week-nav {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.fleet-weekly-board-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.fleet-weekly-board-head h2,
.fleet-weekly-board-head h3 {
    margin: 0;
}

.fleet-terminy-kind {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0 0 1.35rem;
}

.fleet-terminy-kind-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.fleet-terminy-kind-head h2 {
    margin: 0;
}

.fleet-terminy-kind .fleet-weekly-board {
    margin-bottom: 0;
}

.fleet-weekly-board-count {
    font-family: var(--app-font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--eltrans-petrol);
}

.fleet-weekly-scroll {
    overflow-x: visible;
}

.fleet-weekly-trips-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.fleet-weekly-trips-table th,
.fleet-weekly-trips-table td {
    vertical-align: top;
    width: 14.28%;
    padding: 0.45rem 0.35rem;
    word-break: break-word;
}

.fleet-weekly-scroll.is-wide {
    overflow-x: scroll;
}

.fleet-weekly-trips-table.is-span-2,
.fleet-weekly-trips-table.is-span-3 {
    table-layout: fixed;
}

.fleet-weekly-trips-table.is-span-2 {
    width: 200%;
    min-width: 200%;
}

.fleet-weekly-trips-table.is-span-3 {
    width: 300%;
    min-width: 300%;
}

.fleet-weekly-trips-table.is-span-2 th,
.fleet-weekly-trips-table.is-span-2 td,
.fleet-weekly-trips-table.is-span-3 th,
.fleet-weekly-trips-table.is-span-3 td {
    width: auto;
}

.fleet-weekly-trips-table th {
    text-align: left;
    background: rgba(4, 57, 54, 0.04);
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.fleet-weekly-trips-table th.is-today,
.fleet-weekly-trips-table td.is-today {
    background: rgba(42, 168, 154, 0.1);
}

.fleet-weekly-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
}

.fleet-weekly-day-main {
    min-width: 0;
}

.fleet-weekly-day-name {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--eltrans-petrol);
}

.fleet-weekly-day-date {
    display: block;
    font-family: var(--app-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.fleet-weekly-day-count {
    display: inline-block;
    margin-top: 0.18rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: rgba(42, 168, 154, 0.16);
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--eltrans-petrol);
}

.fleet-weekly-day-available {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.08rem;
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 0.45rem;
    border-left: 1px solid rgba(15, 92, 92, 0.16);
    font-size: 0.62rem;
    font-weight: 650;
    color: var(--app-muted);
    line-height: 1.25;
    text-align: right;
}

.fleet-weekly-available-parts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.02rem;
}

.fleet-weekly-resource-heading {
    margin: 1.6rem 0 0.7rem;
    font-size: 1.05rem;
}

.fleet-weekly-collapse {
    margin-top: 0.85rem;
}

.fleet-weekly-collapse-summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    list-style: none;
}

.fleet-weekly-collapse-summary::-webkit-details-marker {
    display: none;
}

.fleet-weekly-collapse-summary::after {
    content: "▾";
    float: right;
    color: var(--app-muted);
    font-weight: 600;
}

.fleet-weekly-collapse:not([open]) .fleet-weekly-collapse-summary::after {
    content: "▸";
}

.fleet-weekly-board--nested {
    margin-top: 0.9rem;
}

.fleet-weekly-trip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fleet-weekly-trip-item {
    padding: 0.32rem 0.35rem;
    border-radius: 8px;
    border: 1px solid var(--app-border);
    background: #fff;
}

.fleet-weekly-trip-item.is-planned {
    background: #fef9c3;
    border-color: #eab308;
}

.fleet-weekly-trip-action {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.fleet-weekly-trip-action:hover {
    text-decoration: none;
}

.fleet-weekly-trip-meta {
    display: block;
    font-size: 0.64rem;
    line-height: 1.2;
    color: #6b7c8d;
}

.attach-set-summary {
    margin: 0 0 1rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #f7f9fb;
}

.attach-set-summary-title {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.attach-set-summary-plates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin: 0 0 0.55rem;
    font-size: 0.92rem;
}

.attach-trip-search-field {
    margin-top: 0.35rem;
}

.attach-add-returning-driver {
    margin: 0.85rem 0 0;
}

.fleet-weekly-trip-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.3rem;
    font-size: 0.72rem;
    line-height: 1.25;
}

.fleet-weekly-trip-driver {
    font-weight: 700;
    color: var(--eltrans-ink);
}

.fleet-weekly-trip-truck,
.fleet-weekly-trip-trailer {
    color: #5a6a7a;
    font-variant-numeric: tabular-nums;
}

.fleet-weekly-trip-sep {
    color: #b0bcc9;
    user-select: none;
}

.fleet-weekly-empty {
    color: #9aa8bc;
    font-size: 0.85rem;
}

body.fleet-weekly-trips-page .fleet-weekly-board .table-wrap:not(.is-wide),
body.fleet-terminy-board-page .fleet-weekly-board .table-wrap {
    overflow: visible;
}

body.fleet-weekly-trips-page .fleet-weekly-board .table-wrap.is-wide {
    overflow-x: scroll;
}

.fleet-terminy-overdue {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(176, 64, 64, 0.25);
    border-radius: 10px;
    background: rgba(176, 64, 64, 0.05);
}

.fleet-terminy-overdue > summary {
    cursor: pointer;
    font-family: var(--app-font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: #8a2f2f;
}

.fleet-terminy-overdue-list {
    list-style: none;
    margin: 0.55rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.35rem;
}

.fleet-terminy-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    border: 1px solid var(--app-border);
    background: #fff;
    font-size: 0.72rem;
    line-height: 1.25;
}

.fleet-terminy-chip.is-overdue {
    border-color: #fca5a5;
    background: #fee2e2;
    color: #991b1b;
}

.fleet-terminy-chip.is-soon {
    border-color: #fcd34d;
    background: #fef3c7;
    color: #92400e;
}

.fleet-terminy-chip.is-ok {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
}

.fleet-terminy-chip-reg {
    font-weight: 700;
    color: var(--eltrans-ink);
}

.fleet-terminy-chip-meta {
    color: #5a6a7a;
}

.ops-terminy-table td .fleet-terminy-chip {
    display: inline-flex;
    min-width: 5.5rem;
    align-items: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.fleet-kpi-breakdown {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fleet-kpi-breakdown li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid #e8f0f0;
    font-size: 0.88rem;
}

.fleet-kpi-breakdown li strong {
    font-size: 1.05rem;
    color: var(--eltrans-petrol);
}

.release-notes-section {
    margin-bottom: 1rem;
}

.release-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.75rem;
}

.release-note-card {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: #fbfdff;
}

.release-note-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.85rem;
    margin-bottom: 0.55rem;
}

.release-note-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--eltrans-petrol);
}

.release-note-title {
    font-size: 0.9rem;
    color: #64748b;
}

.release-note-items {
    margin: 0;
    padding-left: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
}

.upcoming-release-section {
    border-style: dashed;
}

.upcoming-release-items {
    margin-top: 0.75rem;
}

.release-notes-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: min(70vh, 42rem);
    overflow: auto;
}

.release-notes-modal-section h3 {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    color: var(--eltrans-petrol);
}

.release-notes-modal-section h4 {
    margin: 0;
    font-size: 0.92rem;
    color: var(--eltrans-petrol);
}

.release-notes-modal .release-note-header {
    margin-bottom: 0.45rem;
}

.fleet-on-base-table th,
.fleet-operations-table th {
    white-space: nowrap;
}

.fleet-operations-table th:nth-last-child(-n+3),
.fleet-operations-table td:nth-last-child(-n+3) {
    white-space: nowrap;
    width: 1%;
}

.fleet-row-idle-warning {
    background: #fffbeb;
}

.fleet-row-idle-critical {
    background: #fff1f2;
}

.on-base-base {
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.9rem 0.85rem;
}

.on-base-base-summary,
.on-base-col-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--eltrans-petrol, #0f4c5c);
}

.on-base-base-summary::-webkit-details-marker,
.on-base-col-summary::-webkit-details-marker {
    display: none;
}

.on-base-base-summary::before,
.on-base-col-summary::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-right: 0.15rem;
    flex: 0 0 auto;
}

.on-base-base[open] > .on-base-base-summary::before,
.on-base-col[open] > .on-base-col-summary::before {
    transform: rotate(45deg);
    margin-top: -0.15rem;
}

.on-base-base-title {
    min-width: 0;
}

.on-base-base-count,
.on-base-col-summary span:last-child {
    font-weight: 650;
    color: #5a6b82;
}

.on-base-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.7rem;
}

.on-base-col {
    min-width: 0;
    border: 1px solid #d8e3f5;
    border-radius: 10px;
    background: #f8fbff;
    padding: 0.45rem 0.55rem 0.5rem;
}

.on-base-col-summary {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    justify-content: space-between;
}

.on-base-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    max-height: 58vh;
    overflow: auto;
}

.on-base-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
    padding: 0.28rem 0.2rem;
    border-bottom: 1px solid #e6eef8;
    font-size: 0.92rem;
    font-weight: 600;
}

.on-base-item:last-child {
    border-bottom: 0;
}

.on-base-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.on-base-meta {
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #5a6b82;
    white-space: nowrap;
}

.on-base-item.is-blocked .on-base-meta {
    color: #9f1239;
}

.on-base-empty {
    margin: 0.45rem 0 0.15rem;
    font-size: 0.82rem;
}

@media (max-width: 960px) {
    .on-base-columns {
        grid-template-columns: 1fr;
    }
}

.fleet-operations-scroll,
.fleet-vehicles-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 70vh;
    max-width: 100%;
    box-sizing: border-box;
}

.fleet-ops-page .fleet-operations-scroll {
    overflow-x: auto;
}

.fleet-op-details-btn {
    white-space: nowrap;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
}

.fleet-op-details-list {
    display: grid;
    gap: 0.55rem 1rem;
    margin: 0;
}

.fleet-op-details-list > div {
    display: grid;
    grid-template-columns: minmax(8rem, 12rem) 1fr;
    gap: 0.35rem 0.85rem;
    align-items: start;
}

.fleet-op-details-list dt {
    margin: 0;
    color: #64748b;
    font-weight: 600;
}

.fleet-op-details-list dd {
    margin: 0;
    color: #0f172a;
}

body.fleet-page {
    height: 100vh;
    overflow: hidden;
}

body.fleet-page.fleet-ops-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.fleet-page .container {
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

body.fleet-page.fleet-ops-page .container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

body.fleet-page:has(.fleet-compose-section) {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.fleet-page:has(.fleet-compose-section) .container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

body.fleet-page .fleet-top-bar {
    flex: 0 0 auto;
}

body.fleet-page .messages {
    flex: 0 0 auto;
}

body.fleet-page .fleet-readonly-banner {
    flex: 0 0 auto;
    margin: 0 0 1rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid #c5d0db;
    border-radius: 6px;
    background: #f3f6f9;
    color: #334155;
    font-size: 0.95rem;
}

body.fleet-page .fleet-section--blocks {
    flex: 0 0 auto;
    max-height: 28vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.fleet-page .fleet-blocks-scroll {
    flex: 1;
    min-height: 0;
    max-height: 22vh;
    overflow: auto;
}

body.fleet-page .fleet-lists-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

body.fleet-vehicles-page,
body.zasoby-catalog-page,
body.app-catalog-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.fleet-vehicles-page .container,
body.zasoby-catalog-page .container,
body.app-catalog-page .container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: block;
}

body.fleet-vehicles-page .vehicle-list-card,
body.zasoby-catalog-page .zasoby-list-card,
body.app-catalog-page .zasoby-list-card {
    margin-bottom: 1.25rem;
    overflow: visible;
}

body.fleet-vehicles-page .vehicle-list-heading,
body.zasoby-catalog-page .vehicle-list-heading,
body.app-catalog-page .vehicle-list-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 0.75rem;
}

body.fleet-vehicles-page .vehicle-list-heading-title,
body.zasoby-catalog-page .vehicle-list-heading-title,
body.app-catalog-page .vehicle-list-heading-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

body.fleet-vehicles-page .vehicle-list-heading-main h2,
body.zasoby-catalog-page .vehicle-list-heading-main h2,
body.app-catalog-page .vehicle-list-heading-main h2 {
    margin: 0;
}

body.fleet-vehicles-page .fleet-add-vehicle-form--inline {
    margin: 0;
    flex: 0 1 auto;
    min-width: min(100%, 22rem);
}

body.fleet-vehicles-page .vehicle-list-toolbar,
body.zasoby-catalog-page .zasoby-list-toolbar,
body.app-catalog-page .zasoby-list-toolbar {
    margin-bottom: 0.85rem;
}

body.fleet-vehicles-page .vehicle-list-filter-actions {
    align-items: center;
    gap: 0.65rem 0.85rem;
}

body.fleet-vehicles-page .vehicle-list-count-meta {
    color: #64748b;
    font-size: 0.92rem;
    margin-right: auto;
}

body.fleet-vehicles-page .vehicle-details-table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
}

body.fleet-vehicles-page .vehicle-details-table {
    width: 100%;
    table-layout: auto;
}

body.fleet-vehicles-page .vehicle-details-table .col-registration {
    min-width: 8.5rem;
    white-space: nowrap;
}

body.fleet-vehicles-page .vehicle-details-table .col-driver {
    min-width: 11rem;
}

body.fleet-vehicles-page .vehicle-details-table .col-base {
    min-width: 8.5rem;
    white-space: nowrap;
}

body.fleet-vehicles-page .vehicle-details-table .col-deadline {
    min-width: 10rem;
}

body.fleet-vehicles-page .vehicle-details-table .col-departure,
body.fleet-vehicles-page .vehicle-details-table .col-return {
    min-width: 7rem;
    white-space: nowrap;
}

body.fleet-vehicles-page .vehicle-details-table .col-status {
    min-width: 8rem;
}

body.fleet-vehicles-page .vehicle-details-table .col-actions {
    width: 7.5rem;
    text-align: right;
}

body.fleet-page .fleet-section--list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
}

body.fleet-page .fleet-section--list .table-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.fleet-add-vehicle-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem 0.85rem;
    margin: 0 0 0.85rem;
    flex: 0 0 auto;
    padding: 0.7rem 0.85rem;
    border: 1px solid #dbe5f3;
    border-radius: 12px;
    background: #f8fbff;
}

.fleet-add-vehicle-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: var(--app-muted);
    flex: 0 1 14rem;
    min-width: 12rem;
}

.fleet-add-vehicle-form label span {
    font-weight: 700;
    color: #334155;
}

.fleet-add-vehicle-form label small {
    font-size: 0.72rem;
    color: #64748b;
}

.fleet-add-vehicle-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 16rem;
    min-width: min(100%, 16rem);
}

.fleet-add-vehicle-form input[type="text"] {
    font-size: 0.86rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0.6rem 0.75rem;
    background: #fff;
}

.fleet-add-vehicle-form input[type="text"]:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.fleet-list-search-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.55rem 0.85rem;
    margin: 0 0 0.65rem;
}

.fleet-list-search-label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0 0 0.55rem;
    flex: 1 1 14rem;
    font-size: 0.72rem;
    color: var(--app-muted);
}

.fleet-list-search-label input[type="search"] {
    font-size: 0.86rem;
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0.6rem 0.75rem;
    background: #fff;
}

.fleet-list-search-label input[type="search"]:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.fleet-list-search-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: #64748b;
    margin-bottom: 0.55rem;
}

body.fleet-page .fleet-vehicles-scroll {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

body.fleet-page .fleet-vehicles-table {
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}

body.fleet-page .fleet-vehicles-table th,
body.fleet-page .fleet-vehicles-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.fleet-page .fleet-vehicles-table th:nth-child(7),
body.fleet-page .fleet-vehicles-table td.fleet-vehicle-actions {
    width: 9.25rem;
}

body.fleet-page .fleet-vehicles-table .fleet-vehicle-actions {
    overflow: visible;
    white-space: normal;
    vertical-align: top;
}

body.fleet-page .fleet-vehicles-table .fleet-vehicle-actions .driver-vehicle-action-form,
body.fleet-page .fleet-vehicles-table .fleet-vehicle-actions .button,
body.fleet-page .fleet-vehicles-table .fleet-vehicle-actions a.button {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.25;
    padding: 0.22rem 0.4rem;
    margin: 0;
}

body.fleet-page .fleet-vehicles-table thead th,
body.fleet-page .fleet-blocks-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fbff;
}

body.fleet-page .fleet-section {
    margin-bottom: 1rem;
}

body.fleet-page .fleet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

body.fleet-page .fleet-row-blocked {
    background: #fff1f2;
}

.fleet-status-blocked {
    color: #b91c1c;
    font-weight: 600;
}

.fleet-status-free {
    color: #15803d;
    font-weight: 600;
}

.fleet-block-deadline {
    font-weight: 700;
}

.fleet-block-deadline--today {
    color: #a16207;
}

.fleet-block-deadline--overdue {
    color: #b91c1c;
}

.fleet-block-deadline-hint {
    color: #a16207;
    font-weight: 600;
}

.fleet-block-row-due-today {
    background: #fffbeb;
}

.fleet-block-row-overdue {
    background: #fff1f2;
}

.fleet-timeline-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.fleet-compose-section {
    flex: 0 0 auto;
    max-height: none;
}

.fleet-trip-prep-section {
    margin-bottom: 1rem;
}

.fleet-queue-kind {
    margin-bottom: 1.25rem;
}

.fleet-queue-kind > h2 {
    margin-bottom: 0.35rem;
}

.fleet-queue-base-title {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.fleet-queue-base-title small {
    font-weight: 500;
    color: var(--app-muted);
}

.fleet-trip-prep-controls {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1fr) auto auto;
    align-items: end;
    gap: 0.55rem 0.75rem;
}

.fleet-trip-prep-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.72rem;
    color: var(--app-muted);
    min-width: 8rem;
}

.fleet-trip-prep-controls select {
    font-size: 0.82rem;
    min-width: 8.5rem;
}

.fleet-trip-prep-section .table-wrap {
    overflow: visible;
}

.fleet-trip-prep-search {
    min-width: 8.5rem;
    flex: 0 1 9.5rem;
}

.fleet-trip-prep-search .driver-search {
    min-width: 0;
    max-width: none;
}

.fleet-trip-prep-search .driver-search-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.fleet-trip-prep-search .driver-search-results {
    z-index: 40;
    max-height: min(420px, 60vh);
}

.fleet-trip-prep-permanent {
    flex-direction: row !important;
    align-items: center;
    align-self: end;
    gap: 0.35rem !important;
    min-width: auto !important;
    padding-bottom: 0;
    margin: 0;
    white-space: nowrap;
}

.fleet-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.fleet-panel-header-main {
    flex: 1 1 16rem;
}

.fleet-panel-header-actions {
    flex: 0 1 auto;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.75rem 1rem;
}

.fleet-stale-cleanup-bar {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.fleet-stale-cleanup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.fleet-stale-cleanup-form {
    margin: 0;
}

.fleet-stale-cleanup-hint {
    margin: 0;
    max-width: 28rem;
}

.driver-search-load-error {
    color: #b45309;
}

.fleet-trip-prep-takeover-inline {
    align-self: auto !important;
    margin-top: 0.15rem;
    font-size: 0.72rem !important;
    opacity: 0.92;
}

.fleet-trip-prep-controls > .button {
    align-self: end;
}

.fleet-trip-prep-waive-form {
    margin-top: 0.45rem;
}

.fleet-trip-prep-waive-btn {
    color: var(--muted, #64748b);
}

.fleet-trip-prep-row--overdue {
    background: #fff1f2;
}

.fleet-trip-prep-row--soon {
    background: #fffbeb;
}

.fleet-trip-prep-row--draft {
    box-shadow: inset 4px 0 0 #c9a227;
}
.fleet-trip-prep-row--planned {
    background: #fef9c3;
}
.fleet-trip-prep-row--planned.fleet-trip-prep-row--draft {
    background: #fef9c3;
}
.fleet-trip-prep-planned-badge {
    display: inline-block;
    margin-top: 0.2rem;
    margin-left: 0.25rem;
    padding: 0.05rem 0.4rem;
    border-radius: 0.2rem;
    background: #eab308;
    color: #422006;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.fleet-trip-prep-draft-badge {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.05rem 0.4rem;
    border-radius: 0.2rem;
    background: #c9a227;
    color: #1a1404;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.fleet-trip-prep-draft-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
}

.fleet-trip-prep-form.is-saving {
    opacity: 0.65;
    pointer-events: none;
}

.fleet-trip-prep-status {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
}

.fleet-trip-prep-status.is-error {
    color: #b42318;
}

.messages li.error {
    background: #fdecea;
    border-color: #f5c2c0;
    white-space: pre-wrap;
}


.fleet-trip-return-section {
    margin-bottom: 1rem;
}

.fleet-trip-return-section .table-wrap {
    overflow: visible;
}

.fleet-trip-return-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.fleet-trip-return-choice {
    margin: 0;
    padding: 0.35rem 0.55rem;
    border: 1px solid #d5deee;
    border-radius: 8px;
    min-width: 11rem;
}

.fleet-trip-return-choice legend {
    padding: 0 0.25rem;
    font-size: 0.72rem;
    color: var(--app-muted);
}

.fleet-trip-return-choice label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-right: 0.65rem;
    font-size: 0.82rem;
    color: inherit;
    min-width: auto;
    flex-direction: row;
}

.fleet-route-swap-side + .fleet-route-swap-side {
    margin-top: 0.55rem;
}

body.route-swap-decision-open {
    overflow: hidden;
}

.route-swap-decision-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.route-swap-decision-modal[hidden] {
    display: none !important;
}

.route-swap-decision-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 24, 28, 0.45);
}

.route-swap-decision-dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(88vh, 820px);
    overflow: auto;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.route-swap-decision-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.15rem 0.65rem;
    border-bottom: 1px solid #eadfce;
}

.route-swap-decision-title {
    margin: 0 0 0.25rem;
    font-size: 1.12rem;
}

.route-swap-decision-goal {
    margin: 0;
    white-space: pre-wrap;
}

.route-swap-decision-body {
    padding: 0.85rem 1.15rem 0.35rem;
}

.route-swap-decision-blocker {
    margin: 0 0 0.55rem;
    white-space: pre-wrap;
    font-weight: 600;
}

.route-swap-decision-section {
    margin-top: 0.85rem;
}

.route-swap-decision-section h3 {
    margin: 0 0 0.4rem;
    font-size: 0.92rem;
}

.route-swap-decision-chain {
    margin: 0;
    padding-left: 1.2rem;
}

.route-swap-decision-chain li {
    margin: 0.25rem 0;
}

.route-swap-decision-summary {
    margin: 0;
    padding: 0.75rem 0.85rem;
    background: #fff8ee;
    border: 1px solid #e6d3b3;
    border-radius: 8px;
    white-space: pre-wrap;
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.45;
}

.route-swap-decision-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 0.85rem 1.15rem 1.05rem;
    border-top: 1px solid #eadfce;
}

.route-swap-decision-panel {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d7c4a3;
    background: #fff8ee;
    border-radius: 8px;
}

.fleet-permanent-tag {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.68rem;
    color: #8a5a00;
    background: #fff3cd;
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
}

.fleet-assignment-plans-section {
    margin-bottom: 1rem;
}

.fleet-assignment-plans-section .table-wrap {
    overflow: visible;
}

.fleet-assignment-plan-form {
    margin: 0.75rem 0 1rem;
}

.fleet-assignment-plan-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem 0.75rem;
}

.fleet-assignment-plan-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.72rem;
    color: var(--app-muted);
    min-width: 8rem;
}

.fleet-assignment-plan-controls select,
.fleet-assignment-plan-controls input[type="date"],
.fleet-assignment-plan-controls input[type="text"] {
    font: inherit;
    font-size: 0.82rem;
    min-width: 8.5rem;
}

.fleet-assignment-plan-note {
    min-width: 12rem;
    flex: 1 1 12rem;
}

.fleet-assignment-plan-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--app-muted);
}

.fleet-assignment-plan-controls > .button {
    align-self: center;
}

.fleet-compose-dropzone {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.85rem 0 0.75rem;
}

.fleet-compose-slot {
    min-height: 5.2rem;
    border: 1px solid #d7e3f5;
    border-radius: 12px;
    background: #f8fbff;
    padding: 0.7rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fleet-compose-slot.is-filled {
    border-color: #93c5fd;
    background: #fff;
}

.fleet-compose-slot-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.fleet-compose-slot-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--eltrans-petrol);
    min-height: 1.4rem;
}

.fleet-compose-slot:not(.is-filled) .fleet-compose-slot-value {
    color: #94a3b8;
    font-weight: 500;
}

.fleet-compose-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.85rem;
}

.fleet-compose-permanent {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.35rem;
    font-size: 0.85rem;
    color: #475569;
}

.fleet-compose-pools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.fleet-compose-pool h3 {
    margin: 0;
    font-size: 0.9rem;
}

.fleet-compose-count {
    color: #64748b;
    font-weight: 600;
}

.fleet-compose-pool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.fleet-compose-search-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.45rem;
}

.fleet-compose-search {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d4deef;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    font: inherit;
    background: #fff;
}

.fleet-compose-search:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.fleet-compose-search-meta {
    margin: -0.1rem 0 0.35rem;
    font-size: 0.76rem;
    color: #64748b;
}

.fleet-compose-chips {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 12rem;
    overflow: auto;
    padding: 0.2rem;
    min-height: 3.5rem;
}

.fleet-compose-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
}

.fleet-compose-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    text-align: left;
    border: 1px solid #d7e3f5;
    border-radius: 10px;
    background: #fff;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.fleet-compose-chip:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.fleet-compose-chip.has-hover-tooltip {
    cursor: pointer;
}

.fleet-compose-chip:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.fleet-compose-chip strong {
    font-size: 0.86rem;
}

.fleet-compose-chip small {
    color: #64748b;
    font-size: 0.75rem;
}

@media (max-width: 960px) {
    .fleet-compose-dropzone,
    .fleet-compose-pools {
        grid-template-columns: 1fr;
    }
}

.fleet-timeline-event {
    font-size: 0.82rem;
    margin-bottom: 0.2rem;
}

.fleet-timeline-table-wrap {
    margin-top: 0.5rem;
}

.fleet-history-table-wrap {
    margin-top: 0.5rem;
    max-height: min(70vh, 640px);
    overflow: auto;
}

.fleet-history-title {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.fleet-history-detail {
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 0.1rem;
}

.fleet-history-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
}

.fleet-history-row--conflict .fleet-history-category,
.fleet-history-row--conflict-resolved .fleet-history-category {
    background: #fee2e2;
    color: #991b1b;
}

.fleet-history-row--plan .fleet-history-category,
.fleet-history-row--plan-cancelled .fleet-history-category {
    background: #dbeafe;
    color: #1e40af;
}

.fleet-history-row--assignment .fleet-history-category {
    background: #dcfce7;
    color: #166534;
}

.fleet-history-row--trip .fleet-history-category,
.fleet-history-row--trip-return .fleet-history-category {
    background: #f3e8ff;
    color: #6b21a8;
}

.fleet-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1rem;
    align-items: start;
}

.fleet-detail-section + .fleet-detail-section {
    margin-top: 1rem;
}

.fleet-detail-section h3 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
}

.fleet-detail-list {
    margin: 0;
    padding-left: 1.1rem;
}

.fleet-detail-list li {
    margin-bottom: 0.25rem;
}

.fleet-detail-sidebar {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.9rem;
    background: #f8fafc;
}

.fleet-detail-sidebar .help {
    margin: 0 0 0.45rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.driver-list-card {
    overflow: hidden;
}

.driver-details-table-wrap--compact {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: #fff;
}

.driver-details-table--compact thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.driver-details-table-wrap--compact .driver-details-table th,
.driver-details-table-wrap--compact .driver-details-table td {
    padding: 0.7rem 0.75rem;
}

.driver-list-row--compact {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.driver-list-row--compact:hover,
.driver-list-row--compact:focus-visible {
    background: #f8fbff;
    outline: none;
}

.vehicle-list-row--compact {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.vehicle-list-row--compact:hover,
.vehicle-list-row--compact:focus-visible {
    background: #f8fbff;
    outline: none;
}

.kartoteka-edit-current {
    margin: 0 0 0.75rem;
    color: var(--muted, #64748b);
    font-size: 0.9rem;
}

.driver-list-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 12rem;
}

.driver-list-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    background: linear-gradient(145deg, #dbeafe, #eff6ff);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.driver-list-identity-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.driver-list-name {
    font-weight: 650;
    color: #0f172a;
}

.driver-list-meta {
    font-size: 0.76rem;
    color: #64748b;
}

.driver-list-status-pill {
    align-self: flex-start;
}

.driver-list-chip {
    display: inline-block;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

.driver-list-chip--muted {
    background: #f8fafc;
    color: #475569;
}

.driver-details-table--compact .col-citizenship {
    width: 3.25rem;
    white-space: nowrap;
}

.driver-details-table--compact .col-qualifications {
    min-width: 4.5rem;
    max-width: 8.5rem;
    white-space: normal;
}

.driver-details-table--compact .col-qualifications .driver-qualification-badges {
    flex-wrap: wrap;
    gap: 0.18rem;
}

.driver-details-table--compact .col-qualifications .badge-driver-qualification {
    font-size: 0.68rem;
    padding: 0.1rem 0.35rem;
}

.driver-list-empty {
    color: #94a3b8;
}

.driver-list-rating {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #fef9c3;
    color: #854d0e;
    font-size: 0.78rem;
    font-weight: 700;
}

.driver-list-kartoteka-btn {
    min-width: 6.5rem;
    font-weight: 650;
}

.badge-compact {
    max-width: 11rem;
    white-space: normal;
    line-height: 1.25;
}

.driver-kartoteka-modal.trip-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-width: min(1280px, 98vw);
    padding: 0;
    background: #f4f7f7;
    overflow: hidden;
}

.kartoteka-sticky,
.driver-kartoteka-body,
.kartoteka-tab-sheet,
.driver-kartoteka-edit-form {
    max-width: 100%;
    min-width: 0;
}

.kartoteka-sticky {
    position: sticky;
    top: 0;
    z-index: 8;
    background: var(--eltrans-petrol);
}

.driver-kartoteka-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem 1rem;
    border-bottom: 0;
    background:
        radial-gradient(720px 180px at 12% -40%, rgba(42, 168, 154, 0.28), transparent 62%),
        linear-gradient(135deg, var(--eltrans-petrol-deep) 0%, var(--eltrans-petrol) 58%, #0a5550 100%);
    color: #f8fffe;
}

.driver-kartoteka-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    min-width: 0;
    flex: 1 1 14rem;
}

.kartoteka-activity-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.28rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.kartoteka-activity-eyebrow {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(248, 255, 254, 0.72);
}

.kartoteka-activity-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    color: #f8fffe;
    user-select: none;
}

.kartoteka-activity-switch.is-readonly {
    cursor: default;
}

.kartoteka-activity-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.kartoteka-activity-switch-track {
    position: relative;
    width: 2.55rem;
    height: 1.42rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.kartoteka-activity-switch-track::after {
    content: "";
    position: absolute;
    top: 0.14rem;
    left: 0.14rem;
    width: 1.14rem;
    height: 1.14rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 20, 20, 0.28);
    transition: transform 0.16s ease;
}

.kartoteka-activity-switch input:checked + .kartoteka-activity-switch-track {
    background: var(--eltrans-cyan);
}

.kartoteka-activity-switch input:checked + .kartoteka-activity-switch-track::after {
    transform: translateX(1.13rem);
}

.kartoteka-activity-switch input:focus-visible + .kartoteka-activity-switch-track {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.kartoteka-activity-switch-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
    line-height: 1.15;
}

.kartoteka-activity-switch-state {
    font-weight: 800;
    font-size: 0.92rem;
}

.kartoteka-activity-switch-local {
    font-size: 0.72rem;
    font-weight: 650;
    color: rgba(248, 255, 254, 0.78);
}

.kartoteka-activity-restore {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(248, 255, 254, 0.88);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
    padding: 0;
}

.kartoteka-activity-restore:hover {
    color: #fff;
}

.driver-kartoteka-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 1.05rem;
    background: linear-gradient(160deg, #e7fbf8 0%, #c8efe9 100%);
    color: var(--eltrans-petrol);
    font-family: var(--app-font-display);
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(0, 32, 32, 0.22);
}

.vehicle-kartoteka-avatar {
    letter-spacing: 0.04em;
    font-size: 0.9rem;
    border-radius: 0.9rem;
}

.vehicle-kartoteka-modal--trailer .driver-kartoteka-avatar {
    background: linear-gradient(160deg, #eef4ff 0%, #d9e6fb 100%);
    color: #1e3a5f;
}

.driver-kartoteka-eyebrow {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(232, 246, 244, 0.78);
    font-weight: 700;
}

.driver-kartoteka-name {
    margin: 0.18rem 0 0.5rem;
    font-family: var(--app-font-display);
    font-size: 1.38rem;
    line-height: 1.15;
    color: #fff;
    overflow-wrap: anywhere;
}

.driver-kartoteka-hero-text {
    min-width: 0;
    font-family: var(--app-font);
}

.driver-kartoteka-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.driver-kartoteka-hero-team {
    margin: 0.45rem 0 0;
    min-width: 0;
}

.driver-kartoteka-hero-team-label {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(248, 255, 254, 0.72);
}

.driver-kartoteka-hero-team-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #f8fffe;
}

.driver-kartoteka-hero-team-empty {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(248, 255, 254, 0.78);
}

.driver-kartoteka-hero-quals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.driver-kartoteka-hero .driver-qualification-badges,
.driver-kartoteka-hero .qualification-badges-collapsed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.kartoteka-identity-qualifications {
    margin-top: 0;
    border-top: 0;
}

.driver-kartoteka-hero .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 1.55rem;
    min-height: 1.55rem;
    margin: 0;
    padding: 0 0.62rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--app-font);
    font-size: 0.75rem;
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.01em;
    line-height: 1;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
    vertical-align: middle;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.driver-kartoteka-hero .badge-neutral {
    background: rgba(255, 255, 255, 0.14);
    color: #f4fffd;
    font-size: 0.75rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.driver-kartoteka-close {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.driver-kartoteka-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.driver-kartoteka-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem 1.25rem 1.2rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.kartoteka-sticky .kartoteka-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin: 0;
    padding: 0.45rem 1rem 0.55rem;
    border-radius: 0;
    background: color-mix(in srgb, var(--eltrans-petrol) 88%, #012c2c);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kartoteka-tabs-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.kartoteka-sticky-save {
    margin-left: auto;
    flex: 0 0 auto;
}

.kartoteka-sticky .kartoteka-sticky-save {
    background: #fff;
    color: var(--eltrans-petrol);
    border: 0;
    box-shadow: 0 4px 10px rgba(0, 20, 20, 0.18);
}

.kartoteka-sticky .kartoteka-sticky-save:hover {
    background: var(--eltrans-cyan-soft);
}

.kartoteka-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    margin: 0 0 0.85rem;
    padding: 0.22rem;
    overflow: visible;
    background: #e7eeee;
    border-radius: 12px;
}

.kartoteka-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--eltrans-ink);
    font: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.38rem 0.62rem;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
}

.vehicle-kartoteka-modal .kartoteka-tab {
    font-size: 0.72rem;
    padding: 0.32rem 0.48rem;
}

.vehicle-kartoteka-modal .kartoteka-tabs-list {
    gap: 0.12rem;
}

.vehicle-kartoteka-modal .kartoteka-sticky .kartoteka-tabs {
    gap: 0.35rem 0.55rem;
    padding: 0.4rem 0.85rem 0.5rem;
}

.kartoteka-sticky .kartoteka-tab {
    color: #d7ece9;
}

.kartoteka-sticky .kartoteka-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.kartoteka-tab.is-active {
    background: #fff;
    color: var(--eltrans-petrol);
    box-shadow: 0 4px 10px rgba(0, 20, 20, 0.18);
}

.kartoteka-tab:focus-visible {
    outline: 2px solid var(--eltrans-cyan);
    outline-offset: 2px;
}

.kartoteka-tab-panel {
    display: none;
}

.kartoteka-tab-panel.is-active {
    display: block;
}

.kartoteka-tab-panel.is-active:not([data-kartoteka-panel="operacje"]) .kartoteka-tab-sheet {
    min-height: min(58vh, 36rem);
}

.kartoteka-tab-panel.is-active[data-kartoteka-panel="zalaczniki"] .kartoteka-tab-sheet {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    padding-right: 0;
    padding-left: 0;
    padding-bottom: 0;
}

.kartoteka-tab-panel[data-kartoteka-panel="zalaczniki"] .kartoteka-tab-heading,
.kartoteka-tab-panel[data-kartoteka-panel="zalaczniki"] .kartoteka-documents-table-wrap,
.kartoteka-tab-panel[data-kartoteka-panel="zalaczniki"] .kartoteka-panel-empty {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
}

.kartoteka-tab-sheet {
    padding: 1.05rem 1.1rem 1.15rem;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 64, 64, 0.05);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.kartoteka-tab-heading {
    margin: 0 0 0.95rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e6eeee;
    font-family: var(--app-font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--eltrans-petrol);
}

.kartoteka-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 0.85rem 1rem;
}

.kartoteka-field-grid:empty {
    display: none;
}

.kartoteka-field {
    display: grid;
    gap: 0.32rem;
    min-width: 0;
}

.kartoteka-field span {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--app-muted);
}

.kartoteka-field input,
.kartoteka-field select,
.kartoteka-field textarea,
.driver-kartoteka-edit-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.driver-kartoteka-edit-form select,
.driver-kartoteka-edit-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 2.4rem;
    padding: 0.48rem 0.65rem;
    border: 1px solid var(--app-input-border);
    border-radius: var(--app-input-radius);
    background: #fbfefe;
    color: var(--app-ink);
    font: inherit;
}

.kartoteka-field textarea,
.driver-kartoteka-edit-form textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.kartoteka-field input:focus,
.kartoteka-field select:focus,
.kartoteka-field textarea:focus,
.driver-kartoteka-edit-form input:focus,
.driver-kartoteka-edit-form select:focus,
.driver-kartoteka-edit-form textarea:focus {
    outline: none;
    border-color: var(--eltrans-cyan);
    box-shadow: var(--app-input-focus-ring);
    background: #fff;
}

.kartoteka-field--wide {
    grid-column: 1 / -1;
}

.kartoteka-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    margin-top: 0.95rem;
}

.kartoteka-flags:empty {
    display: none;
}

.kartoteka-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid #dce8e8;
    border-radius: 999px;
    background: #f4fafa;
    font-size: 0.86rem;
    color: var(--eltrans-ink);
}

.kartoteka-ops-edit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 0.85rem;
    margin-bottom: 0.35rem;
}

.kartoteka-formset {
    margin-top: 1.05rem;
    padding-top: 0.95rem;
    border-top: 1px dashed #d5e2e2;
    min-width: 0;
    max-width: 100%;
}

.kartoteka-tab-sheet .kartoteka-raporty-docs {
    margin-top: 0.85rem;
}

.driver-kartoteka-modal .table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.driver-kartoteka-modal table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.driver-kartoteka-modal .kartoteka-documents-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.driver-kartoteka-modal .kartoteka-documents-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.driver-kartoteka-modal .kartoteka-documents-table th,
.driver-kartoteka-modal .kartoteka-documents-table td {
    overflow-wrap: anywhere;
}

.driver-kartoteka-modal .kartoteka-documents-table input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.kartoteka-formset-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
}

.kartoteka-formset-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.kartoteka-formset-table th,
.kartoteka-formset-table td {
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    vertical-align: middle;
    padding: 0.4rem 0.35rem;
    min-width: 0;
}

.kartoteka-formset-table tbody tr {
    height: auto;
}

.kartoteka-formset-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f3f7f7;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--app-muted);
    white-space: normal;
}

.kartoteka-formset-table--deadlines tr.is-ok td {
    background: #f0fdf4;
    color: #166534;
}

.kartoteka-formset-table--deadlines tr.is-soon td {
    background: #fffbeb;
    color: #92400e;
}

.kartoteka-formset-table--deadlines tr.is-overdue td {
    background: #fef2f2;
    color: #991b1b;
}

.kartoteka-formset-table--deadlines tr.is-missing td {
    background: #f1f5f9;
    color: #64748b;
}

.kartoteka-formset-table--deadlines tr.is-ok input[type="date"],
.kartoteka-field--deadline.is-ok input[type="date"] {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.kartoteka-formset-table--deadlines tr.is-soon input[type="date"],
.kartoteka-field--deadline.is-soon input[type="date"] {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.kartoteka-formset-table--deadlines tr.is-overdue input[type="date"],
.kartoteka-field--deadline.is-overdue input[type="date"] {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.kartoteka-formset-table--deadlines tr.is-missing input[type="date"],
.kartoteka-field--deadline.is-missing input[type="date"] {
    background: #f8fafc;
    color: #64748b;
    border-color: #cbd5e1;
}

.kartoteka-formset-cell--date,
.kartoteka-formset-col-date,
.kartoteka-formset-col-valid_until,
.kartoteka-formset-col-valid_from,
.kartoteka-formset-col-taken_on,
.kartoteka-formset-col-returned_on,
.kartoteka-formset-col-next_date,
.kartoteka-formset-col-issued_on,
.kartoteka-formset-col-payment_due,
.kartoteka-formset-col-paid_on {
    width: 8.4rem;
}

.kartoteka-formset-col-quantity,
.kartoteka-formset-col-value,
.kartoteka-formset-col-interval,
.kartoteka-formset-col-next_counter,
.kartoteka-formset-col-blocks {
    width: 5.2rem;
}

.kartoteka-formset-col-depends_on {
    width: 7.2rem;
}

.kartoteka-formset-col-kind,
.kartoteka-formset-col-installment,
.kartoteka-formset-col-premium {
    width: 5.6rem;
}

.kartoteka-formset-col-name {
    width: 12rem;
}

.kartoteka-formset-table td:first-child input:not([type="checkbox"]):not([type="hidden"]) {
    min-width: 0;
}

.kartoteka-formset-col-delete,
.kartoteka-formset-delete {
    position: relative;
    width: 7.4rem;
    text-align: center;
    vertical-align: middle;
}

.kartoteka-formset-table tr.is-pending-delete > td:not(.kartoteka-formset-delete) {
    opacity: 0.48;
    filter: grayscale(0.4);
}

.kartoteka-formset-table tr.is-pending-delete {
    background: color-mix(in srgb, var(--app-muted) 14%, transparent);
}

.kartoteka-formset-delete {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.kartoteka-formset-remove-hint,
.kartoteka-formset-pending-note {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.25;
    font-weight: 600;
    color: var(--app-muted);
}

.kartoteka-formset-pending-note {
    margin-left: 0.35rem;
}

.kartoteka-formset-delete-check {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.kartoteka-formset-delete .button {
    min-width: 0;
    padding: 0.28rem 0.45rem;
}

.kartoteka-formset-title {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--eltrans-slate);
}

.kartoteka-formset-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.7rem;
    margin-top: 0.65rem;
}

.kartoteka-formset input:not([type="checkbox"]):not([type="hidden"]),
.kartoteka-formset select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 2.15rem;
    box-sizing: border-box;
    padding: 0.32rem 0.45rem;
    border: 1px solid var(--app-input-border);
    border-radius: 8px;
    font: inherit;
}

.kartoteka-formset select {
    /* Native <select> often ignores min-width:0; keep it inside the table cell. */
    overflow: hidden;
    text-overflow: ellipsis;
}

.kartoteka-formset input[type="date"],
.driver-kartoteka-edit-form .kartoteka-formset input[type="date"] {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 0.28rem 0.2rem;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
}

.kartoteka-formset input[type="date"]::-webkit-datetime-edit,
.kartoteka-formset input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    white-space: nowrap;
    overflow: hidden;
    padding: 0;
}

.kartoteka-formset input[type="date"]::-webkit-calendar-picker-indicator {
    width: 1rem;
    height: 1rem;
    margin: 0 0 0 0.15rem;
    padding: 0;
    cursor: pointer;
}

.admin-kartoteka-form {
    display: grid;
    gap: 1rem;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.admin-kartoteka-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.admin-kartoteka-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.22rem;
    border-radius: 12px;
    background: #e7eeee;
}

.admin-kartoteka-chip {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--eltrans-ink);
    font: inherit;
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.45rem 0.85rem;
    border-radius: 9px;
    cursor: pointer;
}

.admin-kartoteka-chip:hover {
    background: rgba(255, 255, 255, 0.55);
}

.admin-kartoteka-chip.is-active {
    background: #fff;
    color: var(--eltrans-petrol);
    box-shadow: 0 4px 10px rgba(0, 64, 64, 0.1);
}

.admin-kartoteka-layout {
    display: none;
}

.admin-kartoteka-layout.is-active,
.admin-kartoteka-layout:not([hidden]) {
    display: block;
}

.admin-kartoteka-layout[hidden] {
    display: none !important;
}

.admin-kartoteka-layout-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.85rem;
    margin: 0 0 0.85rem;
}

.admin-kartoteka-layout-head h3 {
    margin: 0;
    font-family: var(--app-font-display);
    font-size: 1.05rem;
    color: var(--eltrans-petrol);
}

.admin-kartoteka-layout-head p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--app-muted);
}

.admin-kartoteka-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 0.85rem;
    min-width: 0;
}

.admin-kartoteka-group {
    margin: 0;
    padding: 0.75rem 0.8rem 0.7rem;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 64, 64, 0.04);
    min-width: 0;
}

.admin-kartoteka-group-head,
.admin-kartoteka-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.15rem 2.15rem;
    gap: 0.25rem;
    align-items: center;
}

.admin-kartoteka-group-head {
    margin: 0 0 0.45rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #e6eeee;
}

.admin-kartoteka-group h4 {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    min-width: 0;
    margin: 0;
    font-family: var(--app-font-display);
    font-size: 0.78rem;
    color: var(--eltrans-petrol);
}

.admin-kartoteka-group-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-kartoteka-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 1.05rem;
    padding: 0 0.22rem;
    border-radius: 999px;
    background: var(--eltrans-cyan-soft);
    color: var(--eltrans-petrol);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.35;
}

.admin-kartoteka-col-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--app-muted);
    text-align: center;
    white-space: nowrap;
}

.admin-kartoteka-fields {
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-kartoteka-field {
    padding: 0.32rem 0.1rem;
    border-radius: 8px;
}

.admin-kartoteka-field + .admin-kartoteka-field {
    border-top: 1px solid #f0f4f4;
}

.admin-kartoteka-field:hover {
    background: #f7fbfb;
}

.admin-kartoteka-field-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
    color: var(--eltrans-ink);
    line-height: 1.3;
}

.admin-kartoteka-lock {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #eef2f6;
    color: #5b6b78;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.admin-kartoteka-check {
    display: flex;
    justify-content: center;
    margin: 0;
}

.admin-kartoteka-check input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--eltrans-teal);
}

.admin-kartoteka-field.is-locked {
    opacity: 0.78;
}

.admin-kartoteka-save {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    position: sticky;
    bottom: 0;
    margin-top: 0.25rem;
    padding: 0.85rem 0 0.15rem;
    border-top: 1px solid var(--app-border);
    background: linear-gradient(180deg, rgba(244, 247, 247, 0), #f4f7f7 32%);
}

.admin-kartoteka-save .help {
    margin: 0;
    max-width: 28rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 720px) {
    .admin-kartoteka-group-head,
    .admin-kartoteka-field {
        grid-template-columns: minmax(0, 1fr) 2.15rem 2.15rem;
    }
}

.driver-kartoteka-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 1rem;
    align-items: start;
}

.driver-kartoteka-grid.driver-kartoteka-grid--ops {
    grid-template-columns: minmax(0, 1fr);
}

.kartoteka-tab-panel--ops-edit.is-active {
    margin-bottom: 0.85rem;
}

.driver-kartoteka-main {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 0.85rem;
    overflow: hidden;
}

.driver-kartoteka-sidebar {
    position: sticky;
    top: 0;
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 0.75rem;
    align-self: start;
    z-index: 2;
    padding: 0.95rem 1rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #f7fbfb;
}

.kartoteka-sidebar-head h3 {
    margin: 0;
    font-family: var(--app-font-display);
    font-size: 1rem;
    color: var(--eltrans-petrol);
}

.kartoteka-sidebar-lead {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.kartoteka-panel,
.kartoteka-edit-card {
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #fff;
    padding: 0.95rem 1.05rem 1.05rem;
    box-shadow: 0 8px 18px rgba(0, 64, 64, 0.04);
}

.kartoteka-edit-card {
    border-left: 3px solid var(--eltrans-cyan);
}

.kartoteka-edit-card--muted {
    background: #f8fafc;
}

.kartoteka-panel-title,
.kartoteka-edit-card h4 {
    margin: 0 0 0.7rem;
    font-family: var(--app-font-display);
    font-size: 0.92rem;
    color: var(--eltrans-petrol);
}

.kartoteka-edit-card h4 {
    margin-bottom: 0.55rem;
}

.driver-kartoteka-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.kartoteka-tab-sheet .driver-work-system-form {
    margin-top: 0.35rem;
}

.driver-kartoteka-edit-form .kartoteka-edit-card {
    margin: 0;
}

.kartoteka-edit-save-actions,
.admin-user-save-actions {
    position: sticky;
    bottom: 0;
    margin-top: 0.15rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--app-border);
    background: color-mix(in srgb, #fff 88%, var(--eltrans-cyan-soft));
}

.kartoteka-edit-hint {
    margin: 0.45rem 0 0;
}

.trip-modal-flash {
    margin: 0;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid transparent;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
}

.trip-modal-flash--success {
    border-bottom-color: #86efac;
    background: #ecfdf5;
    color: #166534;
}

.trip-modal-flash--info {
    border-bottom-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.trip-modal-flash--error {
    border-bottom-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.admin-user-edit-form .fleet-detail-section {
    margin-bottom: 0.75rem;
}

.kartoteka-panel-list {
    margin: 0;
    padding-left: 1rem;
    color: #334155;
}

.kartoteka-panel-list li + li {
    margin-top: 0.25rem;
}

.kartoteka-panel-note {
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.9em;
}

.kartoteka-vehicle-blocks {
    list-style: none;
    padding-left: 0;
}

.kartoteka-vehicle-block {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
}

.kartoteka-vehicle-block.is-overdue {
    color: #991b1b;
}

.kartoteka-panel-empty {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.kartoteka-attachment-upload {
    display: grid;
    grid-template-columns: minmax(8rem, 1.4fr) minmax(7rem, 1fr) minmax(8.5rem, 0.85fr) minmax(7rem, 1.2fr) auto;
    gap: 0.55rem 0.75rem;
    align-items: end;
    margin: 0 1.1rem 0.95rem;
}

.kartoteka-attachment-upload label {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}

.kartoteka-attachment-upload span {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--app-muted);
}

.kartoteka-attachment-upload input[type="text"],
.kartoteka-attachment-upload input[type="file"],
.kartoteka-attachment-upload input[type="date"],
.kartoteka-attachment-upload select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.kartoteka-attachment-valid-until {
    margin: 0;
}

.kartoteka-attachment-valid-until input[type="date"] {
    width: 100%;
    max-width: 11rem;
    box-sizing: border-box;
}

.kartoteka-attachments-table tr.is-ok input[type="date"] {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.kartoteka-attachments-table tr.is-soon input[type="date"] {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.kartoteka-attachments-table tr.is-overdue input[type="date"] {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.kartoteka-attachment-source {
    color: var(--app-muted);
    font-weight: 600;
}

.kartoteka-attachment-delete {
    display: inline;
    margin: 0;
}

@media (max-width: 720px) {
    .kartoteka-attachment-upload {
        grid-template-columns: 1fr;
        margin-left: 1.1rem;
        margin-right: 1.1rem;
    }
}

.kartoteka-attachment-preview[hidden] {
    display: none !important;
}

.kartoteka-attachment-preview:not([hidden]) {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0.85rem 0 0;
    border: 1px solid #dbe3ef;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    background: #f8fafc;
    overflow: hidden;
    flex: 1 1 auto;
}

.kartoteka-attachment-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid #e2e8f0;
    flex: 0 0 auto;
}

.kartoteka-attachment-preview-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
}

.kartoteka-attachment-preview-stage {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: min(52vh, 36rem);
    background: #111;
}

.kartoteka-attachment-preview-frame[hidden],
.kartoteka-attachment-preview-image[hidden] {
    display: none !important;
}

.kartoteka-attachment-preview-frame:not([hidden]),
.kartoteka-attachment-preview-image:not([hidden]) {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #111;
}

.kartoteka-attachment-preview-image {
    object-fit: contain;
    background: #fff;
}

.kartoteka-documents-table-wrap {
    margin-top: 0.15rem;
}

.kartoteka-documents-table td,
.kartoteka-documents-table th {
    font-size: 0.84rem;
}

.kartoteka-documents-table tr.is-expired td,
.kartoteka-documents-table tr.is-overdue td {
    background: #fef2f2;
    color: #991b1b;
}

.kartoteka-documents-table tr.is-soon td {
    background: #fffbeb;
    color: #92400e;
}

.kartoteka-documents-table tr.is-ok td {
    background: #f0fdf4;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.kartoteka-doc-status {
    font-size: 0.72rem;
}

.kartoteka-trips-panel .kartoteka-trip-block + .kartoteka-trip-block {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
}

.kartoteka-panel-lead {
    margin: 0 0 0.85rem;
    color: var(--muted, #5b6472);
    font-size: 0.9rem;
    line-height: 1.35;
}

.kartoteka-trip-situation {
    max-width: 22rem;
    white-space: normal;
    line-height: 1.35;
}

.kartoteka-planned-assignments {
    margin-top: 1rem;
}

.kartoteka-trip-block-title {
    margin: 0 0 0.55rem;
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--eltrans-petrol, #0f4c5c);
}

.kartoteka-trip-facts {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
}

.kartoteka-trips-table-wrap {
    margin-top: 0.25rem;
}

.kartoteka-trips-table td,
.kartoteka-trips-table th {
    font-size: 0.82rem;
}

.kartoteka-trips-panel .has-hover-tooltip,
.vehicle-kartoteka-modal .kartoteka-panel .has-hover-tooltip {
    text-decoration: underline dotted;
    text-underline-offset: 0.18em;
}

.driver-kartoteka-modal .kartoteka-trips-table-wrap,
.driver-kartoteka-modal .kartoteka-documents-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.driver-kartoteka-modal .kartoteka-trips-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.driver-kartoteka-modal .kartoteka-trips-table th,
.driver-kartoteka-modal .kartoteka-trips-table td {
    overflow-wrap: anywhere;
    white-space: normal;
}

.driver-kartoteka-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 0.65rem 0.75rem;
    margin: 0;
}

.kartoteka-fact {
    margin: 0;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: #f6fafa;
    border: 1px solid #e4eeee;
}

.kartoteka-fact--wide {
    grid-column: 1 / -1;
}

.kartoteka-fact dt {
    margin: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-muted);
}

.kartoteka-fact dd {
    margin: 0.2rem 0 0;
    font-weight: 650;
    color: var(--eltrans-ink);
    overflow-wrap: anywhere;
}

.driver-kartoteka-vehicles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.driver-kartoteka-vehicle-block {
    min-width: 0;
    padding: 0.75rem 0.8rem 0.85rem;
    border: 1px solid #e4eeee;
    border-radius: 12px;
    background: #f9fcfc;
}

.driver-kartoteka-vehicles .driver-vehicle-attach-form,
.driver-kartoteka-vehicles .driver-search-field,
.driver-kartoteka-vehicles .driver-search-input {
    max-width: 100%;
    min-width: 0;
}

.driver-kartoteka-vehicle-block h4 {
    margin: 0 0 0.45rem;
    font-size: 0.82rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.driver-kartoteka-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kartoteka-detach-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.kartoteka-detach-item {
    display: grid;
    gap: 0.28rem;
}

.kartoteka-detach-hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--app-muted, #5b6472);
    line-height: 1.35;
}

.kartoteka-trainings-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.kartoteka-trainings-form input[type="date"] {
    width: 100%;
    max-width: 12.5rem;
}

.driver-kartoteka-actions .vehicle-permanent-assign-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    max-width: 22rem;
}

.driver-kartoteka-actions .vehicle-permanent-assign-form .button {
    align-self: flex-start;
}

.driver-kartoteka-editor .driver-qualification-form,
.driver-kartoteka-vehicles .driver-vehicle-action-form {
    margin-top: 0.35rem;
}

@media (max-width: 1100px) {
    .driver-kartoteka-grid {
        grid-template-columns: 1fr;
    }

    .driver-kartoteka-sidebar {
        position: static;
        z-index: auto;
    }

    .driver-kartoteka-vehicles {
        grid-template-columns: 1fr;
    }

    .driver-list-identity {
        min-width: 0;
    }
}

.fleet-detail-sidebar .fleet-detail-section + .fleet-detail-section {
    margin-top: 0.85rem;
}

.fleet-detail-sidebar .trip-form-stack {
    margin-top: 0.75rem;
}

.fleet-detail-sidebar .driver-work-system-form {
    min-width: 0;
}

.fleet-detail-sidebar .driver-work-system-field input {
    width: 100%;
    min-width: 4.2rem;
}

.trip-form-stack {
    display: grid;
    gap: 0.75rem;
}

.trip-form-stack label {
    display: grid;
    gap: 0.35rem;
}

.trip-form-stack label:has(> input[type="radio"]),
.trip-form-stack label:has(> input[type="checkbox"]) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    width: auto;
}

.trip-form-stack input[type="radio"],
.trip-form-stack input[type="checkbox"] {
    width: auto;
    height: auto;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #2563eb;
}

.kartoteka-choice-list,
.kartoteka-choice-list > div,
.kartoteka-choice-list > ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kartoteka-choice-list label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
}

.trip-form-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-error {
    color: #b91c1c;
}

.trip-modal-panel:has(.fleet-history-modal) {
    width: min(980px, 96vw);
}

.trip-modal-panel:has(.fleet-modal-content):not(:has(.driver-kartoteka-modal)) {
    width: min(900px, 96vw);
}

.trip-modal-panel:has(.driver-kartoteka-modal) {
    width: min(1280px, 98vw);
    max-width: 98vw;
    height: min(92vh, 900px);
    max-height: min(94vh, 980px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    background: #f4f7f7;
}

.hover-info-panel {
    width: min(560px, 96vw);
}

.hover-info-body {
    margin: 0;
    padding: 0.85rem 1rem;
    word-break: break-word;
    font: inherit;
    line-height: 1.45;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.hover-info-section {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #334155;
}

.hover-info-section:first-child {
    margin-top: 0;
}

.hover-info-subtitle {
    margin: 0.45rem 0 0.2rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: #475569;
}

.hover-info-list,
.hover-tip-list {
    margin: 0.15rem 0 0.35rem;
    padding-left: 1.1rem;
}

.hover-info-list li,
.hover-tip-list li {
    margin: 0.12rem 0;
}

.hover-info-list li.hover-deadline-line.is-ok,
.hover-tip-list li.hover-deadline-line.is-ok {
    color: #166534;
    font-weight: 600;
}

.hover-info-list li.hover-deadline-line.is-soon,
.hover-tip-list li.hover-deadline-line.is-soon {
    color: #92400e;
    font-weight: 600;
}

.hover-info-list li.hover-deadline-line.is-overdue,
.hover-tip-list li.hover-deadline-line.is-overdue {
    color: #991b1b;
    font-weight: 700;
}

.board-hover-tooltip .hover-tip-list li.hover-deadline-line.is-ok {
    color: #86efac;
}

.board-hover-tooltip .hover-tip-list li.hover-deadline-line.is-soon {
    color: #fcd34d;
}

.board-hover-tooltip .hover-tip-list li.hover-deadline-line.is-overdue {
    color: #fca5a5;
}

.hover-info-line {
    margin: 0.15rem 0;
}

.hover-info-line.is-note {
    color: #64748b;
    font-size: 0.92em;
}

.hover-info-spacer {
    height: 0.35rem;
}

.board-hover-tooltip {
    position: fixed;
    z-index: 10050;
    max-width: min(34rem, calc(100vw - 1rem));
    padding: 0.6rem 0.75rem;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.78rem;
    line-height: 1.4;
    white-space: normal;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
    pointer-events: none;
    overflow: visible;
}

.board-hover-tooltip .hover-tip-section {
    margin: 0.45rem 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #93c5fd;
}

.board-hover-tooltip .hover-tip-section:first-child {
    margin-top: 0;
}

.board-hover-tooltip .hover-info-subtitle {
    margin: 0.3rem 0 0.1rem;
    font-weight: 600;
    color: #cbd5e1;
}

.board-hover-tooltip .hover-tip-list {
    margin: 0.1rem 0 0.25rem;
    padding-left: 1rem;
}

.board-hover-tooltip .hover-info-line {
    margin: 0.1rem 0;
}

.board-hover-tooltip .hover-info-line.is-note {
    color: #94a3b8;
}

.vehicle-col-blocked {
    background: #fecaca !important;
    color: #7f1d1d;
    font-weight: 700;
}

.has-board-tooltip,
.has-hover-tooltip {
    cursor: help;
}

body.tooltips-disabled .has-board-tooltip,
body.tooltips-disabled .has-hover-tooltip,
html.tooltips-disabled .has-board-tooltip,
html.tooltips-disabled .has-hover-tooltip {
    cursor: inherit;
}

body.tooltips-disabled .board-hover-tooltip,
html.tooltips-disabled .board-hover-tooltip {
    display: none !important;
}

body.tooltips-disabled .vehicle-tip:hover .vehicle-tip-bubble,
html.tooltips-disabled .vehicle-tip:hover .vehicle-tip-bubble {
    display: none !important;
}

.hover-tooltip-source {
    display: none !important;
}

.vehicle-tip {
    position: relative;
    display: inline-block;
}

.vehicle-tip-bubble {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
    min-width: 14rem;
    max-width: 22rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: pre-line;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
    pointer-events: none;
}

.vehicle-tip:hover .vehicle-tip-bubble {
    display: block;
}

.vehicle-deadline-badge {
    display: inline-block;
    max-width: 100%;
    padding: 0.05rem 0.28rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #e2e8f0;
    color: #334155;
}

.vehicle-deadline-badge.is-soon,
.vehicle-deadline-soon .vehicle-deadline-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.vehicle-deadline-badge.is-overdue,
.vehicle-deadline-overdue .vehicle-deadline-badge {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.vehicle-deadline-badge.is-ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.vehicle-deadline-badge.is-trip {
    border: 1px dashed currentColor;
}

.driver-vehicle-deadline {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
}

.driver-vehicle-deadline.is-soon {
    color: #b45309;
}

.driver-vehicle-deadline.is-overdue {
    color: #b91c1c;
}

.fleet-deadline-cell {
    font-size: 0.78rem;
    font-weight: 600;
}

.fleet-deadline-col {
    vertical-align: top;
}

.fleet-deadline-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    max-width: 100%;
}

.fleet-deadline-line {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: #047857;
}

.fleet-deadline-line.is-soon {
    color: #92400e;
    background: #fef3c7;
    border-radius: 4px;
    padding: 0.1rem 0.28rem;
}

.fleet-deadline-line.is-overdue {
    color: #991b1b;
    background: #fee2e2;
    border-radius: 4px;
    padding: 0.1rem 0.28rem;
}

.fleet-deadline-line.is-ok {
    color: #166534;
    background: #dcfce7;
    border-radius: 4px;
    padding: 0.1rem 0.28rem;
}

.fleet-deadline-cell.is-soon {
    color: #b45309;
}

.fleet-deadline-cell.is-overdue {
    color: #b91c1c;
}

.fleet-deadline-cell.is-ok {
    color: #047857;
}

body.board-page {
    --board-grid-line: #d5e3e2;
    --board-grid-divider: #b9cfcd;
}

body.board-page .container {
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

body.board-page .board-timeline-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--board-grid-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 64, 64, 0.05);
    overflow: hidden;
}

body.board-page .board-scroll-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
}

body.board-page .timeline-top-scroll {
    display: none;
}

body.board-page .board-frozen-scrollbar-spacer {
    display: none;
}

body.board-page .board-frozen-header {
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
    background: #f8fbff;
    border-right: 1px solid var(--board-grid-divider);
    border-bottom: 1px solid var(--board-grid-line);
}

body.board-page .board-frozen-header-table,
body.board-page .board-frozen-body-table {
    width: var(--board-frozen-table-width, 35.75rem) !important;
    min-width: var(--board-frozen-table-width, 35.75rem) !important;
    max-width: var(--board-frozen-table-width, 35.75rem) !important;
    table-layout: fixed;
}

body.board-page .board-timeline-header {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    background: #f8fbff;
    box-sizing: border-box;
    border-bottom: 1px solid var(--board-grid-line);
    padding-right: var(--board-timeline-scrollbar-width, 0px);
}

body.board-page .board-timeline-header-track {
    will-change: transform;
}

body.board-page .board-frozen-scroll {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    box-sizing: border-box;
    background: #fff;
    border-right: 1px solid var(--board-grid-divider);
}

body.board-page .board-frozen-scroll::-webkit-scrollbar {
    display: none;
}

body.board-page .board-timeline-wrap {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}

body.board-page .board-timeline-body-track {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    will-change: transform;
}

body.board-page .board-frozen-header-table,
body.board-page .board-frozen-body-table,
body.board-page .board-timeline-header-table,
body.board-page .board-timeline-body-table {
    margin: 0;
}

body.board-page .board-frozen-header .frozen-col,
body.board-page .board-frozen-scroll .frozen-col {
    position: static;
}

body.board-page .board-frozen-header thead th.frozen-col,
body.board-page .board-frozen-scroll tbody td.frozen-col {
    box-sizing: border-box;
    border-right: none;
    box-shadow: inset -1px 0 0 var(--board-grid-line), inset 0 -1px 0 var(--board-grid-line);
}

body.board-page .board-frozen-header thead th.frozen-driver-col,
body.board-page .board-frozen-scroll tbody td.frozen-driver-col {
    width: var(--board-frozen-driver-width, 9.75rem);
    min-width: var(--board-frozen-driver-width, 9.75rem);
    max-width: var(--board-frozen-driver-width, 9.75rem);
}

body.board-page .board-frozen-scroll tbody td.frozen-driver-col .frozen-cell-content {
    max-width: 100%;
    flex-wrap: nowrap;
}

body.board-page .board-frozen-scroll tbody td.frozen-driver-col .driver-name-link,
body.board-page .board-frozen-scroll tbody td.frozen-driver-col .frozen-cell-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.board-page .board-frozen-header thead th.frozen-truck-col,
body.board-page .board-frozen-scroll tbody td.frozen-truck-col {
    width: var(--board-frozen-truck-width, 8.25rem);
    min-width: var(--board-frozen-truck-width, 8.25rem);
    max-width: var(--board-frozen-truck-width, 8.25rem);
}

body.board-page .board-frozen-header thead th.frozen-trailer-col,
body.board-page .board-frozen-scroll tbody td.frozen-trailer-col {
    width: var(--board-frozen-trailer-width, 8.25rem);
    min-width: var(--board-frozen-trailer-width, 8.25rem);
    max-width: var(--board-frozen-trailer-width, 8.25rem);
}

body.board-page .board-frozen-scroll tbody td.frozen-truck-col .vehicle-state-stack,
body.board-page .board-frozen-scroll tbody td.frozen-trailer-col .vehicle-state-stack {
    max-width: 100%;
}

body.board-page .board-frozen-header thead th.frozen-driver-col,
body.board-page .board-frozen-scroll tbody td.frozen-driver-col,
body.board-page .board-frozen-header thead th.frozen-truck-col,
body.board-page .board-frozen-scroll tbody td.frozen-truck-col,
body.board-page .board-frozen-header thead th.frozen-trailer-col,
body.board-page .board-frozen-scroll tbody td.frozen-trailer-col,
body.board-page .board-frozen-header thead th.frozen-qualifications-col,
body.board-page .board-frozen-scroll tbody td.frozen-qualifications-col {
    font-size: 0.67rem;
    line-height: 1.15;
}

body.board-page .board-frozen-header thead th.frozen-qualifications-col,
body.board-page .board-frozen-scroll tbody td.frozen-qualifications-col {
    width: var(--board-frozen-qualifications-width, 9.5rem);
    min-width: var(--board-frozen-qualifications-width, 9.5rem);
    max-width: var(--board-frozen-qualifications-width, 9.5rem);
    white-space: nowrap;
}

body.board-page .board-qualification-badges {
    gap: 0.1rem;
}

body.board-page .board-qualification-badges .badge-driver-qualification {
    font-size: inherit;
    padding: 0.03rem 0.22rem;
    border-radius: 4px;
}

body.board-page .board-qualification-badges .badge-driver-qualification-more {
    font-size: inherit;
    padding: 0.03rem 0.22rem;
}

body.board-page .board-frozen-header thead th,
body.board-page .board-timeline-header thead th {
    height: var(--board-header-row-height, auto);
    box-sizing: border-box;
    position: static;
    top: auto;
}

body.board-page .board-frozen-body-table tbody tr,
body.board-page .board-timeline-body-table tbody tr {
    height: 36px;
}

body.board-page .board-frozen-body-table tbody td,
body.board-page .board-timeline-body-table tbody td {
    height: 36px;
    box-sizing: border-box;
    border-bottom: none;
    box-shadow: inset 0 -1px 0 var(--board-grid-line);
}

body.board-page .board-timeline-header thead th.today-col {
    background: #e8f2ff;
    box-shadow: inset 0 0 0 2px var(--eltrans-teal), inset 0 -1px 0 var(--board-grid-line);
}

body.board-page .board-timeline-body-table tbody td.today-col {
    box-shadow: inset 2px 0 0 var(--eltrans-teal), inset -2px 0 0 var(--eltrans-teal), inset 0 -1px 0 var(--board-grid-line);
}

body.board-page .board-timeline-body-table tbody tr.planner-row-odd td.today-col {
    background-color: #e8f2ff;
}

body.board-page .board-timeline-body-table tbody tr.planner-row-even td.today-col {
    background-color: #dcecff;
}

body.board-page .board-timeline-body-table tbody tr.planner-row-inactive td.today-col {
    background-color: #f3d6d6;
}

body.board-page .board-table-wrap {
    flex: unset;
    min-height: 0;
    max-height: none;
}

body.board-page .clean-planner thead th {
    box-shadow: inset 0 -1px 0 var(--board-grid-line);
}

body.board-page .clean-planner thead th.frozen-col {
    box-shadow: inset -1px 0 0 var(--board-grid-line), inset 0 -1px 0 var(--board-grid-line);
}

body.board-page .clean-planner tbody td.frozen-col {
    box-shadow: inset -1px 0 0 var(--board-grid-line), inset 0 -1px 0 var(--board-grid-line);
}

body.board-page .clean-planner .frozen-qualifications-col {
    box-shadow: inset -1px 0 0 var(--board-grid-divider);
}

body.board-page .board-frozen-header thead th.frozen-qualifications-col,
body.board-page .board-frozen-scroll tbody td.frozen-qualifications-col {
    box-shadow: inset -1px 0 0 var(--board-grid-divider), inset 0 -1px 0 var(--board-grid-line);
}

body.board-page.board-view-custom .timeline-top-scroll {
    border: none;
    border-bottom: 1px solid var(--board-grid-line);
    border-radius: 0;
    background: #f8fbff;
    box-shadow: none;
}

body.board-page .board-inactive-separator td {
    border-top: 1px solid var(--board-grid-divider);
    border-bottom: 1px solid var(--board-grid-line);
}

body.board-page.board-view-month .planner-cell.cell-mandatory-home {
    background: inherit !important;
    box-shadow: inset 0 -1px 0 var(--board-grid-line);
    border: none;
    color: inherit;
}

body.drivers-page {
    height: 100vh;
    overflow: hidden;
}

body.drivers-page.fleet-ops-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.drivers-page .container {
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.drivers-page.fleet-ops-page .container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

body.drivers-page.fleet-vehicles-page,
body.fleet-page.fleet-vehicles-page,
body.drivers-page.zasoby-catalog-page,
body.resources-page.zasoby-catalog-page,
body.drivers-page.app-catalog-page,
body.fleet-page.app-catalog-page,
body.reports-page.app-catalog-page,
body.user-profiles-page.app-catalog-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.drivers-page.fleet-vehicles-page .container,
body.fleet-page.fleet-vehicles-page .container,
body.drivers-page.zasoby-catalog-page .container,
body.resources-page.zasoby-catalog-page .container,
body.drivers-page.app-catalog-page .container,
body.fleet-page.app-catalog-page .container,
body.reports-page.app-catalog-page .container,
body.user-profiles-page.app-catalog-page .container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: block;
}

body.drivers-page.ops-gaps-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.drivers-page.ops-gaps-page .container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: block;
}

body.drivers-page .drivers-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.user-profiles-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

body.user-profiles-page .container {
    height: auto;
    min-height: 100vh;
    display: block;
}

body.user-profiles-page .container > .card,
body.user-profiles-page .container > .profile-action-grid,
body.user-profiles-page .container > .messages {
    margin-bottom: 1.25rem;
}

body.user-profiles-page .container > .card:last-child,
body.user-profiles-page .container > .profile-action-grid:last-child {
    margin-bottom: 0;
}

body.user-profiles-page .profile-action-grid {
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

body.user-profiles-page .card h2 {
    margin-top: 0;
    margin-bottom: 0.85rem;
    font-family: var(--app-font-display);
    color: var(--eltrans-petrol);
}

body.user-profiles-page .subtitle a {
    color: var(--eltrans-teal);
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

body.user-profiles-page .subtitle a:hover {
    color: var(--eltrans-petrol);
}

.driver-assign-form {
    align-items: flex-end;
}

.board-toolbar-period .board-driver-scope-form {
    display: inline-flex;
    margin: 0;
}

.board-toolbar-period .board-driver-scope-btn {
    padding: 0.28rem 0.62rem;
    font-size: 0.76rem;
    line-height: 1.2;
    white-space: nowrap;
}

.driver-scope-toggle-form {
    display: inline-flex;
    margin: 0;
}

.driver-scope-toggle-form-hidden {
    display: none;
}

.driver-scope-toggle {
    white-space: nowrap;
}

.driver-scope-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #edf3ff;
    color: #2f4f92;
    font-size: 0.82rem;
    white-space: nowrap;
}

body.drivers-page .drivers-main-header {
    flex: 0 0 auto;
}

body.drivers-page .drivers-main-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

body.drivers-page .raporty-table-hint {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
}

body.drivers-page .drivers-table-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

body.drivers-page .raporty-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.planner-table {
    table-layout: auto;
}

.day-col {
    width: 6.2rem;
    min-width: 6.2rem;
    max-width: 6.2rem;
}

body.board-page .board-timeline-header thead th.day-col {
    white-space: nowrap;
    text-align: center;
}

.day-header-weekday {
    margin-right: 0.22rem;
    font-weight: 700;
}

.day-header-date {
    font-weight: 600;
}

body.board-purpose-loads th.day-col--planned-loads {
    cursor: pointer;
    vertical-align: middle;
    white-space: normal;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    line-height: 1.15;
}

body.board-purpose-loads th.day-col--planned-loads:hover {
    background: #eef6f4;
}

body.board-purpose-loads .day-header-load-counts {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0 0 0.12rem;
    line-height: 1;
}

body.board-purpose-loads .day-header-label {
    display: block;
    white-space: nowrap;
    line-height: 1.15;
}

body.board-purpose-loads .day-header-load-count {
    display: inline;
    min-width: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    background: transparent;
}

body.board-purpose-loads .day-header-load-count--open {
    background: transparent;
    color: #b91c1c;
}

body.board-purpose-loads .day-header-load-count--assigned {
    background: transparent;
    color: #15803d;
}

body.board-purpose-loads .day-col {
    width: 6.2rem;
    min-width: 6.2rem;
    max-width: 6.2rem;
}

body.board-purpose-loads.board-view-custom .day-col {
    width: 6.2rem;
    min-width: 6.2rem;
    max-width: 6.2rem;
}

.planner-table thead th {
    position: sticky;
    top: 0;
    z-index: 8;
    background: #f8fbff;
    font-size: 0.74rem;
    line-height: 1.2;
}

.event {
    display: block;
    margin: 0;
    padding: 0.08rem 0.12rem;
    border-radius: 5px;
    text-decoration: none;
    color: #18345f;
    background: linear-gradient(160deg, #e8f2ff, #f0e9ff);
    border: 1px solid #d8e7ff;
}

.event strong,
.event span {
    display: block;
    font-size: 0.85rem;
}

.slim-driver {
    display: block;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.sticky-driver-col {
    left: var(--left-driver, 0px);
    z-index: 2;
    max-width: 24ch;
}

.sticky-trailer-col {
    left: var(--left-trailer, 0px);
    z-index: 2;
    max-width: 12ch;
}

.sticky-truck-col {
    left: var(--left-truck, 0px);
    z-index: 2;
    max-width: 12ch;
}

.slim-cell {
    font-size: 0.68rem;
    line-height: 1.15;
}

.slim-event {
    border-radius: 4px;
    font-size: 0.66rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.slim-event strong {
    display: block;
    margin-right: 0;
    margin-bottom: 0.1rem;
    white-space: nowrap;
}

.slim-event .route-flags {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    vertical-align: top;
}

.event-status-departure {
    background: linear-gradient(160deg, #ffe6bf, #ffbf66);
    border-color: #f08c00;
    color: #7a3e00;
}

.event-status-driving {
    background: linear-gradient(160deg, #d3e8ff, #9ec5ff);
    border-color: #1e88e5;
    color: #0d47a1;
}

.event-status-return {
    background: linear-gradient(160deg, #fff3c4, #ffe082);
    border-color: #fbc02d;
    color: #7a5d00;
}

.event-status-departure-return {
    background: linear-gradient(90deg, #ffbf66 0%, #ffbf66 50%, #ffe082 50%, #ffe082 100%);
    border-color: #f08c00;
    color: #7a3e00;
}

.event-status-return-departure {
    background: linear-gradient(90deg, #ffe082 0%, #ffe082 50%, #ffbf66 50%, #ffbf66 100%);
    border-color: #f08c00;
    color: #7a3e00;
}

.event-status-load {
    background: linear-gradient(160deg, #ffd8a8, #ffb347);
    border-color: #e67700;
    color: #7a3e00;
}

.event-status-vacation {
    background: linear-gradient(160deg, #f3e8ff, #e9d5ff);
    border-color: #a855f7;
    color: #6b21a8;
}

.event-status-departure.fleet-pending,
.event-status-driving.fleet-pending,
.event-status-return.fleet-pending,
.event-status-departure-return.fleet-pending,
.event-status-return-departure.fleet-pending {
    outline: 2px solid #b91c1c;
    outline-offset: 1px;
    box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.25);
}

.event-status-departure.fleet-draft,
.event-status-driving.fleet-draft,
.event-status-return.fleet-draft,
.event-status-departure-return.fleet-draft,
.event-status-return-departure.fleet-draft {
    outline: 2px solid #ca8a04;
    outline-offset: 1px;
    box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.28);
}

.fleet-ready-badge {
    display: inline-block;
    margin-left: 0.28rem;
    padding: 0.05rem 0.28rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    vertical-align: middle;
}

.fleet-ready-badge.is-pending {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.fleet-ready-badge.is-ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.month-event-swatch .fleet-ready-badge {
    margin-left: 0.15rem;
    font-size: 0.55rem;
    padding: 0.02rem 0.2rem;
}

.vehicle-plan-badge {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.05rem 0.28rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.vehicle-plan-badge.is-detach {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.vehicle-plan-badge.is-attach {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.vehicle-state-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    min-width: 0;
}

.vehicle-state-badge {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.04rem 0.28rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-state-badge.is-current {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.vehicle-state-badge.is-attach {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.vehicle-state-badge.is-detach {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.vehicle-col-planned {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.55), transparent);
}

.frozen-cell-content {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem 0.2rem;
    min-width: 0;
}

.event-status-available {
    background: linear-gradient(160deg, #d4f0dc, #b8e6c8);
    border-color: #2eb85c;
    color: #1a7a3a;
}

.event-status-mandatory {
    background: linear-gradient(160deg, #ef9a9a, #e57373);
    border-color: #c62828;
    color: #7f1212;
}

.event-status-deadline-ok {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.event-status-deadline-soon {
    /* Distinct from yellow „Zjazd” — soft coral / rose warning */
    background: linear-gradient(160deg, #ffe4e6, #fecdd3);
    border-color: #fb7185;
    color: #9f1239;
}

.event-status-deadline-overdue {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.event-status-qualification-adr,
.event-status-qualification-visa {
    background: #0b1f3a;
    border-color: #061221;
    color: #f8fafc;
}

.event-more-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    padding: 0.08rem 0.35rem;
    border-radius: 999px;
    border: 1px solid #94a3b8;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    font-family: var(--app-font-display);
}

.event-more-badge:hover {
    background: #e2e8f0;
    border-color: #64748b;
    color: #0f172a;
}

button.event-more-badge {
    appearance: none;
}

.event-status-default {
    background: linear-gradient(160deg, #e8f2ff, #f0e9ff);
    border-color: #d8e7ff;
    color: #18345f;
}

a.event-link {
    text-decoration: none;
    cursor: pointer;
}

a.event-link:hover {
    filter: brightness(0.96);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.trip-event-summary {
    border: 1px solid #d8e3f5;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: #f8fbff;
}

.trip-event-summary p {
    margin: 0.2rem 0;
}

.trip-timeline {
    margin: 0 0 1rem;
    display: grid;
    gap: 0.75rem;
}

.trip-timeline:empty {
    display: none;
}

.trip-timeline-block {
    border: 1px solid #d8e3f5;
    border-radius: 10px;
    background: #f8fbff;
    overflow: hidden;
}

.trip-timeline-title {
    margin: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #24364f;
    background: #eef4fc;
    border-bottom: 1px solid #d8e3f5;
}

.trip-timeline-table-wrap {
    max-height: 11rem;
    overflow: auto;
}

.trip-timeline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.trip-timeline-table th,
.trip-timeline-table td {
    padding: 0.4rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid #e4ecf7;
    white-space: nowrap;
}

.trip-timeline-table th {
    font-weight: 700;
    color: #4a5d78;
    background: #f3f7fc;
    position: sticky;
    top: 0;
}

.trip-timeline-table tbody tr:last-child td {
    border-bottom: 0;
}

.trip-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.trip-legend-item {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.trip-legend-departure {
    background: #d8f5dc;
    border-color: #43a047;
    color: #1b5e20;
}

.trip-legend-driving {
    background: #d3e8ff;
    border-color: #1e88e5;
    color: #0d47a1;
}

.trip-legend-return {
    background: #fff3c4;
    border-color: #fbc02d;
    color: #7a5d00;
}

.form-errors {
    color: #b71c1c;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.trip-edit-clear-vehicle {
    display: inline-block;
    margin-top: 0.05rem;
    padding: 0;
    border: 0;
    background: none;
    color: #c62828;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.3;
    min-height: 1.3em;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    align-self: flex-start;
}

.trip-edit-clear-vehicle:hover,
.trip-edit-clear-vehicle.is-selected {
    color: #8e0000;
}

.trip-edit-vehicles {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.55rem 0.75rem;
    align-items: start;
    margin: 0 0 0.7rem;
}

.trip-edit-vehicles-hint {
    grid-column: 1 / -1;
    margin: 0;
}

.trip-without-vehicles-field {
    grid-column: 1 / -1;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.trip-without-vehicles-field label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.trip-edit-vehicles .driver-search-field {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.trip-edit-vehicles .driver-search-field > label {
    font-weight: 600;
    line-height: 1.3;
}

.trip-edit-current-plate {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.3;
    color: #475569;
    min-height: 1.3em;
}

.trip-edit-current-plate strong {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.02em;
}

.form-grid:has(.trip-edit-vehicles) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.55rem;
}

.form-grid:has(.trip-edit-vehicles) > p {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.form-grid:has(.trip-edit-vehicles) > p:has(#id_departure_date),
.form-grid:has(.trip-edit-vehicles) > p:has(#id_return_date) {
    grid-column: auto;
}

.form-grid:has(.trip-edit-vehicles) > .trip-edit-vehicles,
.form-grid:has(.trip-edit-vehicles) > .form-actions,
.form-grid:has(.trip-edit-vehicles) > .form-errors,
.form-grid:has(.trip-edit-vehicles) > .driver-search-field {
    grid-column: 1 / -1;
}

@media (max-width: 560px) {
    .trip-edit-vehicles,
    .form-grid:has(.trip-edit-vehicles) {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-grid:has(.trip-edit-vehicles) > p:has(#id_departure_date),
    .form-grid:has(.trip-edit-vehicles) > p:has(#id_return_date) {
        grid-column: 1 / -1;
    }
}

.form-warning {
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.75rem;
    font-size: 0.86rem;
    line-height: 1.35;
}

.route-flags {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0;
}

.flag-icon {
    width: 14px;
    height: 10px;
    object-fit: cover;
    border: 1px solid #d7e2f3;
    border-radius: 2px;
}

.route-arrow {
    font-weight: 700;
    color: var(--eltrans-ink);
}

.today-col {
    /* Keep highlight inside the cell so it doesn't bleed over frozen columns. */
    outline: none;
    box-shadow: inset 0 0 0 2px var(--eltrans-teal);
}

.clean-planner tbody td.today-col {
    /*
     * Avoid drawing the blue top edge on body cells so it doesn't overlap
     * with the sticky header bottom border when vertically scrolled.
     */
    box-shadow: inset 2px 0 0 var(--eltrans-teal), inset -2px 0 0 var(--eltrans-teal), inset 0 -2px 0 var(--eltrans-teal);
}

thead .sticky-col {
    z-index: 4;
}

.planner-cell.cell-mandatory-home {
    background: #9b1c1c !important;
    box-shadow: inset 0 0 0 1px #000;
    border: 1px solid #000;
    color: #fff;
}

.trip-validation-hint {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #f8fbff;
    border: 1px solid #d8e3f5;
    font-size: 0.9rem;
    color: #4a5b73;
}

.trip-validation-hint ul {
    margin: 0.4rem 0 0.6rem 1.1rem;
    padding: 0;
}

.planner-cell.cell-available {
    background: rgba(46, 184, 92, 0.18);
    box-shadow: inset 0 0 0 1px rgba(30, 140, 70, 0.25);
}

/* Planowanie załadunków: „+” tylko na hover, bez rozpychania wiersza */
body.board-purpose-loads .planner-cell.board-cell-add-load {
    position: relative;
    cursor: pointer;
}

body.board-purpose-loads .board-add-load-affordance {
    position: absolute;
    right: 0.12rem;
    bottom: 0.1rem;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(26, 122, 58, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #1a7a3a;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
}

body.board-purpose-loads .planner-cell.board-cell-add-load:hover .board-add-load-affordance,
body.board-purpose-loads .planner-cell.board-cell-add-load:focus-within .board-add-load-affordance {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

body.board-purpose-loads .board-add-load-affordance:hover,
body.board-purpose-loads .board-add-load-affordance:focus-visible {
    background: #e8f8ee;
    border-color: #1a7a3a;
    color: #0f5c2a;
    outline: none;
}

@media (hover: none) {
    body.board-purpose-loads .board-add-load-affordance {
        opacity: 0.85;
        pointer-events: auto;
        transform: scale(1);
    }
}

.planner-cell.cell-vacation {
    background: rgba(168, 85, 247, 0.16);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.28);
}

.planner-cell.cell-planned-trip {
    background: #fde047;
    box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.5);
}

.board-didaskalia-cell-planned {
    display: inline-block;
    width: 1.1rem;
    height: 0.85rem;
    border-radius: 3px;
    background: #fde047;
    border: 1px solid rgba(202, 138, 4, 0.55);
    vertical-align: middle;
}

.planner-cell.cell-on-route-service {
    box-shadow: inset 0 0 0 2px #7c3aed;
    outline: 2px solid #7c3aed;
    outline-offset: -2px;
}

.planner-cell.cell-on-route-service-loads {
    background: #fee2e2;
    box-shadow: inset 0 0 0 2px #dc2626;
    outline: 2px solid #dc2626;
    outline-offset: -2px;
}

/* clean-planner zebra / planned / today box-shadow must not hide service marks */
.clean-planner tbody tr.planner-row-odd td.planner-cell.cell-on-route-service,
.clean-planner tbody tr.planner-row-even td.planner-cell.cell-on-route-service,
body.board-page .board-timeline-body-table tbody td.planner-cell.cell-on-route-service {
    box-shadow: inset 0 0 0 2px #7c3aed !important;
    outline: 2px solid #7c3aed;
    outline-offset: -2px;
}

.clean-planner tbody tr.planner-row-odd td.planner-cell.cell-on-route-service-loads,
.clean-planner tbody tr.planner-row-even td.planner-cell.cell-on-route-service-loads,
body.board-page .board-timeline-body-table tbody td.planner-cell.cell-on-route-service-loads {
    background: #fee2e2 !important;
    box-shadow: inset 0 0 0 2px #dc2626 !important;
    outline: 2px solid #dc2626;
    outline-offset: -2px;
}

body.board-page .board-timeline-body-table tbody td.today-col.cell-on-route-service {
    box-shadow:
        inset 0 0 0 2px #7c3aed,
        inset 2px 0 0 var(--eltrans-teal),
        inset -2px 0 0 var(--eltrans-teal),
        inset 0 -1px 0 var(--board-grid-line) !important;
}

body.board-page .board-timeline-body-table tbody td.today-col.cell-on-route-service-loads {
    background: #fee2e2 !important;
    box-shadow:
        inset 0 0 0 2px #dc2626,
        inset 2px 0 0 var(--eltrans-teal),
        inset -2px 0 0 var(--eltrans-teal),
        inset 0 -1px 0 var(--board-grid-line) !important;
}

.board-didaskalia-cell-on-route-service {
    display: inline-block;
    width: 1.1rem;
    height: 0.85rem;
    border-radius: 3px;
    background: #fff;
    border: 2px solid #7c3aed;
    vertical-align: middle;
}

.board-didaskalia-cell-on-route-service-loads {
    display: inline-block;
    width: 1.1rem;
    height: 0.85rem;
    border-radius: 3px;
    background: #fee2e2;
    border: 2px solid #dc2626;
    vertical-align: middle;
}

.board-cell-on-route-service {
    cursor: pointer;
}

.available-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #1a7a3a;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
}

.available-label:hover {
    color: #0f5c2a;
    text-decoration: underline;
}

.planner-cell.cell-unavailable {
    background: rgba(225, 68, 68, 0.12);
}

.clean-planner {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.clean-planner th,
.clean-planner td {
    font-size: 0.74rem;
    line-height: 1.2;
    padding: 0.22rem 0.3rem;
    vertical-align: middle;
    border-bottom: 1px solid #000;
    border-right: 1px solid #c7cdd8;
}

.clean-planner .driver-col {
    width: 9.75rem;
    min-width: 9.75rem;
}

.clean-planner .truck-col {
    width: 8.25rem;
    min-width: 8.25rem;
}

.clean-planner .trailer-col {
    width: 8.25rem;
    min-width: 8.25rem;
}

.clean-planner .qualifications-col {
    width: 9.5rem;
    min-width: 9.5rem;
    white-space: nowrap;
}

.clean-planner tbody tr.planner-row-odd td {
    background-color: #ffffff;
}

.clean-planner tbody tr.planner-row-even td {
    background-color: #f1f6fc;
}

.clean-planner tbody tr.planner-row-odd td.frozen-col {
    background-color: #ffffff;
}

.clean-planner tbody tr.planner-row-even td.frozen-col {
    background-color: #f1f6fc;
}

.clean-planner tbody tr.planner-row-odd td.planner-cell.cell-mandatory-home,
.clean-planner tbody tr.planner-row-even td.planner-cell.cell-mandatory-home {
    background: #9b1c1c !important;
    box-shadow: inset 0 0 0 1px #000;
    border: 1px solid #000;
    color: #fff;
}

.mandatory-home-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.2;
}

.clean-planner tbody tr.planner-row-odd td.planner-cell.cell-available {
    background: #d4f0dc !important;
}

.clean-planner tbody tr.planner-row-even td.planner-cell.cell-available {
    background: #c8ebd2 !important;
}

.clean-planner tbody tr.planner-row-odd td.planner-cell.cell-planned-trip,
.clean-planner tbody tr.planner-row-even td.planner-cell.cell-planned-trip {
    background: #fde047 !important;
    box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.5);
}

.clean-planner tbody tr.planner-row-odd td.planner-cell.cell-unavailable {
    background: #fdeaea;
}

.clean-planner tbody tr.planner-row-even td.planner-cell.cell-unavailable {
    background: #f9e0e0;
}

.clean-planner .frozen-col {
    position: sticky;
    background: #fff;
}

.clean-planner thead .frozen-col {
    top: 0;
    z-index: 12;
    background: #f8fbff;
}

.clean-planner tbody .frozen-col {
    z-index: 4;
}

.clean-planner .frozen-driver-col {
    left: 0;
}

.clean-planner tbody td.driver-col-inactive {
    background: #f9d6d6 !important;
    color: #9b1c1c !important;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.45);
}

.trip-legend-calendar-route {
    background: #f9d6d6;
    border: 1px solid #e14444;
    color: #8b1e1e;
}

.trip-legend-calendar-home {
    background: #9b1c1c;
    border: 1px solid #000;
    color: #fff;
}

.trip-legend-calendar-available {
    background: #d4f0dc;
    border: 1px solid #2eb85c;
    color: #1a7a3a;
}

.trip-legend-calendar-vacation {
    background: #f3e8ff;
    border: 1px solid #a855f7;
    color: #6b21a8;
}

.trip-legend-calendar-neutral {
    background: #fff;
    border: 1px solid #9aa8bc;
    color: #4a5b73;
}

.trip-legend-calendar-editing {
    background: #fff3c4;
    border: 1px solid #fbc02d;
    color: #7a5d00;
}

.trip-legend-calendar-vehicle-blocked {
    background: #ffe4e6;
    border: 1px solid #e11d48;
    color: #9f1239;
}

.trip-legend-calendar-workshop {
    background: #ffedd5;
    border: 1px solid #ea580c;
    color: #9a3412;
}

.trip-calendar-hint {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #f8fbff;
    border: 1px solid #d8e3f5;
    font-size: 0.88rem;
    color: #4a5b73;
}

.trip-calendar-hint p {
    margin: 0;
}

.trip-calendar-hint p + p {
    margin-top: 0.55rem;
}

.flatpickr-calendar .flatpickr-months {
    position: relative;
}

.flatpickr-calendar .flatpickr-months .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-months .flatpickr-next-month {
    z-index: 6;
    position: absolute;
    top: 0;
    height: 2.15rem;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
}

.flatpickr-calendar .flatpickr-current-month span.cur-month {
    pointer-events: none;
    font-weight: 600;
    margin-left: 0.15rem;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper {
    width: 3.4rem;
}

.flatpickr-calendar .flatpickr-current-month input.cur-year {
    pointer-events: none;
    font-weight: 600;
    -moz-appearance: textfield;
}

.flatpickr-calendar .flatpickr-current-month .numInputWrapper span.arrowUp,
.flatpickr-calendar .flatpickr-current-month .numInputWrapper span.arrowDown {
    display: none;
}

.flatpickr-day.calendar-day-on-route {
    background: #f9d6d6 !important;
    border-color: #e14444 !important;
    color: #8b1e1e !important;
}

.flatpickr-day.calendar-day-mandatory-home {
    background: #9b1c1c !important;
    border: 1px solid #000 !important;
    color: #fff !important;
    font-weight: 700;
}

.flatpickr-day.calendar-day-on-route.calendar-day-mandatory-home {
    background: #9b1c1c !important;
    border: 1px solid #000 !important;
    color: #fff !important;
}

.flatpickr-day.calendar-day-available {
    background: #d4f0dc !important;
    border-color: #2eb85c !important;
    color: #1a7a3a !important;
}

.flatpickr-day.calendar-day-editing-trip {
    background: #fff3c4 !important;
    border-color: #fbc02d !important;
    color: #7a5d00 !important;
    font-weight: 700;
}

.flatpickr-day.calendar-day-vacation {
    background: #f3e8ff !important;
    border-color: #a855f7 !important;
    color: #6b21a8 !important;
    font-weight: 700;
}

.flatpickr-day.calendar-day-vehicle-blocked {
    background: #ffe4e6 !important;
    border-color: #e11d48 !important;
    color: #9f1239 !important;
    font-weight: 700;
}

.flatpickr-day.calendar-day-workshop-busy {
    background: #ffedd5 !important;
    border-color: #ea580c !important;
    color: #9a3412 !important;
    font-weight: 700;
}

.trip-legend-calendar-workshop {
    background: #ffedd5;
    border: 1px solid #ea580c;
    color: #9a3412;
}

.flatpickr-day.selected.calendar-day-on-route,
.flatpickr-day.selected.calendar-day-mandatory-home,
.flatpickr-day.selected.calendar-day-available,
.flatpickr-day.selected.calendar-day-editing-trip,
.flatpickr-day.selected.calendar-day-vacation,
.flatpickr-day.selected.calendar-day-vehicle-blocked,
.flatpickr-day.selected.calendar-day-workshop-busy {
    box-shadow: inset 0 0 0 2px var(--eltrans-teal);
}

.clean-planner .frozen-truck-col {
    left: 9.75rem;
}

.clean-planner .frozen-trailer-col {
    left: 18rem;
}

.clean-planner .frozen-qualifications-col {
    left: 26.25rem;
    /* Visual divider between frozen metadata and scrolling timeline columns. */
    box-shadow: inset -2px 0 0 #000;
}

.clean-planner thead th {
    /*
     * Use inset shadows instead of collapsed borders so separators remain
     * visible while sticky header/columns overlap during scrolling.
     */
    box-shadow: inset 0 -2px 0 #000;
}

.clean-planner thead th.frozen-col {
    /* Frozen header cells: keep both right and bottom separators visible. */
    box-shadow: inset -2px 0 0 #000, inset 0 -2px 0 #000;
}

.clean-planner tbody td.frozen-col {
    /* Frozen left pane cells: keep both right and bottom separators visible. */
    box-shadow: inset -2px 0 0 #000, inset 0 -2px 0 #000;
}

.clean-planner .driver-col,
.clean-planner .truck-col,
.clean-planner .trailer-col {
    white-space: nowrap;
}

.clean-planner .driver-col {
    font-weight: 600;
}

.clean-planner .driver-name-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.clean-planner .driver-name-link:hover {
    color: var(--eltrans-teal);
}

.driver-copy-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 0.15rem;
    vertical-align: middle;
}

.driver-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.frozen-driver-col:hover .driver-copy-btn,
.driver-copy-btn:focus-visible,
.driver-copy-wrap.is-copied .driver-copy-btn {
    opacity: 1;
}

.driver-copy-btn:hover {
    color: var(--eltrans-teal, #0f766e);
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.2);
}

.driver-copy-wrap.is-copied .driver-copy-btn {
    color: #15803d;
}

.driver-copy-btn svg {
    display: block;
}

.driver-copy-toast {
    position: absolute;
    left: calc(100% + 0.35rem);
    top: 50%;
    z-index: 40;
    max-width: 11rem;
    padding: 0.28rem 0.5rem;
    border: 1px solid rgba(21, 128, 61, 0.25);
    border-radius: 6px;
    background: #ecfdf5;
    color: #166534;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.driver-copy-wrap.is-copied .driver-copy-toast {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.clean-planner .planner-cell {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.clean-planner th,
.clean-planner td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.button {
    display: inline-block;
    box-sizing: border-box;
    max-width: 100%;
    padding: 0.5rem 0.95rem;
    border-radius: 9px;
    border: 1px solid transparent;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(145deg, var(--eltrans-petrol), #0a5c56);
    cursor: pointer;
    font-family: var(--app-font-display);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 64, 64, 0.28);
}

.button.secondary {
    background: var(--eltrans-cyan-soft);
    color: var(--eltrans-petrol);
    border-color: #b7ddd8;
}

.button.ghost {
    background: #ffffff;
    color: var(--eltrans-petrol);
    border-color: #b7ddd8;
}

.button.tiny {
    padding: 0.2rem 0.5rem;
    font-size: 0.74rem;
    margin-top: 0.1rem;
}

.button.danger {
    background: linear-gradient(145deg, #dc3f49, #ff6a73);
    border-color: #d63d46;
}

.messages {
    list-style: none;
    padding: 0;
}

.messages li {
    padding: 0.6rem 0.85rem;
    background: #e9f8ef;
    border: 1px solid #bfe6cc;
    border-radius: 10px;
}

.messages li.message-password {
    background: #fff8e8;
    border-color: #f0d59a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92rem;
}

.admin-panel-page .admin-user-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.admin-panel-page .admin-password-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.admin-panel-page .admin-password-row input {
    flex: 1 1 14rem;
    min-width: 0;
}

.admin-panel-page .admin-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.admin-panel-page .admin-inline-form {
    margin: 0;
    display: inline;
}

.admin-panel-page .admin-user-name-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    align-items: center;
}

.admin-identity-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.admin-identity-form input[type="text"],
.admin-identity-form input[type="email"] {
    min-width: 12rem;
}

.impersonation-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 1rem 0.75rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid #f0c36d;
    border-radius: 8px;
    background: #fff8e8;
    color: #5c4813;
}

.impersonation-banner p {
    margin: 0;
}

.impersonation-banner-form {
    margin: 0;
}

.admin-panel-page tr.is-inactive td {
    color: #7a8799;
    background: #f7f9fc;
}

body.admin-panel-page {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

body.admin-panel-page .container {
    height: auto;
    min-height: 100vh;
    max-width: 100%;
    width: auto;
    box-sizing: border-box;
    display: block;
    overflow-x: clip;
}

body.admin-panel-page .admin-create-card,
body.admin-panel-page .admin-user-form {
    max-width: 40rem;
}

body.admin-panel-page .admin-panel-section {
    overflow: hidden;
    max-width: 100%;
}

body.admin-panel-page .admin-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    max-height: none;
}

body.admin-panel-page .admin-users-table,
body.admin-panel-page .admin-login-logs-table {
    width: 100%;
    table-layout: auto;
}

body.admin-panel-page .admin-users-table th,
body.admin-panel-page .admin-users-table td,
body.admin-panel-page .admin-login-logs-table th,
body.admin-panel-page .admin-login-logs-table td {
    vertical-align: middle;
}

body.admin-panel-page .admin-users-table td:nth-child(2),
body.admin-panel-page .admin-login-logs-table td:nth-child(4) {
    word-break: break-word;
}

body.admin-panel-page .admin-users-table td:last-child {
    white-space: nowrap;
}

body.admin-panel-page .subtitle a {
    color: var(--eltrans-teal);
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

body.admin-panel-page .subtitle a:hover {
    color: var(--eltrans-petrol);
}

.form-layout {
    max-width: 700px;
}

.subtitle {
    margin: 0.2rem 0 0;
    color: #64748b;
}

.date-range {
    font-weight: 600;
    color: #334d75;
}

.scroll-hint {
    color: #5a6b82;
    font-size: 0.85rem;
}

.timeline-top-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    height: 16px;
    border: 1px solid #dbe4f5;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    background: #f8fbff;
}

.timeline-top-scroll-inner {
    height: 1px;
}

.board-table-wrap {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.board-filters-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

body.reports-page .board-toolbar.reports-toolbar {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0.85rem;
}

body.reports-page .reports-filters-form .driver-text-search-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 0 1 18rem;
    min-width: 12rem;
    max-width: 22rem;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a5b73;
}

body.reports-page .reports-filters-form .driver-text-search-field input.board-filter-search {
    width: 100%;
    min-width: 0;
    min-height: 1.9rem;
    padding: 0 0.5rem;
    font-size: 0.78rem;
}

body.reports-page .reports-filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

body.reports-page .reports-filters-actions .button {
    margin: 0;
}

.board-filters-row {
    display: grid;
    gap: 0.45rem 0.55rem;
    align-items: end;
    width: 100%;
}

.board-filters-row--primary {
    grid-template-columns: minmax(10.5rem, 1.2fr) repeat(auto-fit, minmax(10.5rem, 1fr));
}

.board-filters-row--secondary {
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}

.board-filters-row--actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    margin-top: 0.1rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e2eaf4;
}

.board-filters-row > label:not(.driver-inactive-toggle) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0.2rem;
    margin: 0;
    line-height: 1.15;
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a5b73;
    min-width: 0;
}

.board-filters-row > label.board-filter-field--search,
.board-filters-row > label:has(input.board-filter-search) {
    min-width: 0;
}

.board-filters-row .board-filter-search {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.board-filters-form:not(:has(.board-filters-row)):not(.inline-role-form):not(.reports-filters-form) {
    display: grid;
    grid-template-columns: minmax(12rem, 1.4fr) repeat(auto-fit, minmax(9.5rem, 1fr));
    align-items: end;
    gap: 0.45rem 0.55rem;
}

.board-filters-form:not(:has(.board-filters-row)):not(.inline-role-form):not(.reports-filters-form) > label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a5b73;
}

.board-filters-form:not(:has(.board-filters-row)):not(.inline-role-form):not(.reports-filters-form) > .button,
.board-filters-form:not(:has(.board-filters-row)):not(.inline-role-form):not(.reports-filters-form) > a.button {
    width: auto;
    justify-self: start;
    align-self: end;
}

.board-filters-form:not(:has(.board-filters-row)):not(.inline-role-form):not(.reports-filters-form) .board-filter-search {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.board-filters-row > label.board-filter-field--date,
.board-filters-row > label:has(input[type="date"]) {
    max-width: none;
}

.board-filters-row .searchable-date {
    width: 100%;
    min-width: 0;
}

.board-filters-row > label:has(select[name="sort"]),
.board-filters-row > label:has(select[name="trip_filter"]) {
    min-width: 0;
}

.board-filters-form .driver-inactive-toggle,
.board-header-filters .driver-inactive-toggle {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
    height: 1.9rem;
    min-height: 1.9rem;
    margin: 0;
    padding: 0 0.65rem;
    border: 1px solid #d4deef;
    border-radius: 8px;
    background: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    color: #4a5b73;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 64, 64, 0.04);
}

.board-filters-form .driver-inactive-toggle:has(input:checked),
.board-header-filters .driver-inactive-toggle:has(input:checked) {
    border-color: #8fbcb6;
    background: #eef8f6;
    color: var(--eltrans-petrol);
}

.board-filters-form .driver-inactive-toggle input[type="checkbox"],
.board-header-filters .driver-inactive-toggle input[type="checkbox"] {
    margin: 0;
    flex: 0 0 auto;
    width: 0.95rem;
    height: 0.95rem;
    accent-color: var(--eltrans-teal);
}

.board-filters-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.55rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.board-filters-actions > .button,
.board-filters-actions > a.button {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
}

@media (max-width: 1180px) {
    .board-filters-row--primary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .board-filters-row--primary > label.board-filter-field--search,
    .board-filters-row--primary > label:has(input.board-filter-search) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .board-filters-row--primary,
    .board-filters-row--secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.board-filters-form select,
.board-filter-search,
.board-filters-form input[type="date"] {
    margin: 0;
    border: 1px solid #d4deef;
    border-radius: 8px;
    padding: 0 0.45rem;
    background-color: #fff;
    font: inherit;
    font-weight: 500;
    color: inherit;
    box-sizing: border-box;
    height: 1.9rem;
    min-height: 1.9rem;
    font-size: 0.78rem;
    line-height: 1.2;
    width: 100%;
    min-width: 0;
}

.board-filters-form .driver-text-search-field input.board-filter-search {
    min-width: 0;
    padding: 0 0.45rem;
    font-size: 0.78rem;
}

.board-filters-form select,
.board-header-filters select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 1.85rem;
    cursor: pointer;
}

.filter-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
    vertical-align: middle;
    width: 100%;
    min-width: 0;
}

.filter-select-chevron {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    pointer-events: none;
    color: #334155;
    flex-shrink: 0;
}

.filter-select-wrap--enhanced {
    min-width: 0;
}

.filter-select-wrap--enhanced .filter-select-input {
    margin: 0;
    border: 1px solid #d4deef;
    border-radius: 8px;
    padding: 0 1.85rem 0 0.45rem;
    background-color: #fff;
    font: inherit;
    color: inherit;
    box-sizing: border-box;
    height: 1.9rem;
    min-height: 1.9rem;
    font-size: 0.78rem;
    line-height: 1.2;
    width: 100%;
    min-width: 0;
    max-width: none;
}

.filter-select-wrap--enhanced .filter-select-input:focus {
    outline: none;
    border-color: var(--eltrans-cyan);
    box-shadow: 0 0 0 2px rgba(42, 168, 154, 0.15);
}

.filter-select-wrap--enhanced .searchable-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

.filter-select-wrap--enhanced .filter-select-chevron {
    z-index: 2;
}

.filter-select-wrap--enhanced .filter-select-chevron--interactive {
    pointer-events: auto;
    cursor: pointer;
}

.filter-select-wrap--enhanced .filter-select-results {
    z-index: 45;
    min-width: 100%;
}

.board-header-filters .filter-select-wrap--enhanced .filter-select-input {
    padding-left: 0.4rem;
    max-width: none;
}

.board-view-select .filter-select-wrap {
    min-width: 7.5rem;
    width: auto;
    overflow: visible;
}

.board-view-select .filter-select-wrap > select {
    width: 100%;
    box-sizing: border-box;
}

.board-view-select .filter-select-chevron {
    right: 0.55rem;
}

.board-view-select .filter-select-wrap--enhanced .filter-select-input {
    max-width: none;
    min-width: 7.5rem;
}

.board-filters-form select {
    max-width: none;
}


.board-top-bar {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.board-control-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.45rem 0.55rem;
    width: 100%;
}

.board-control-inline > .board-filters-form {
    flex: 1 1 100%;
    order: 3;
}

.board-control-inline > .button {
    flex: 0 0 auto;
    align-self: center;
}

.board-top-bar-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.board-header-filters {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 0.45rem 0.55rem;
    flex-wrap: wrap;
    margin: 0;
}

.board-header-filters-form {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0;
}

.board-header-filters label {
    font-size: 0.74rem;
    white-space: nowrap;
}

.board-header-filters select,
.board-header-filters input[type="date"],
.board-header-filters .board-filter-search {
    height: 1.9rem;
    min-height: 1.9rem;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0.4rem;
    font-size: 0.78rem;
    border-radius: 8px;
}

.board-header-filters select {
    padding-right: 1.85rem;
}

.board-filter-search {
    width: 9.5rem;
    min-width: 9.5rem;
    max-width: 11rem;
}

.board-filter-search:focus {
    outline: none;
    border-color: var(--eltrans-cyan);
    box-shadow: 0 0 0 2px rgba(42, 168, 154, 0.15);
}

.board-header-filters select[name="sort"] {
    min-width: 10rem;
    max-width: none;
}

.board-header-filters select[name="trip_filter"] {
    min-width: 10.5rem;
    max-width: none;
}

.board-header-filters select[name="base"] {
    min-width: 5.5rem;
    max-width: 8rem;
}

.board-header-filters input[type="date"] {
    width: 6.9rem;
}

.board-header-filters .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 1.9rem;
    min-height: 1.9rem;
    padding: 0 0.55rem;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
}

.board-top-bar .action-group {
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.board-top-bar .action-group .button,
.board-top-bar .refresh-raporty-form .button,
.board-control-inline > .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 1.9rem;
    min-height: 1.9rem;
    padding: 0 0.55rem;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
}

.top-bar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.top-bar-cache {
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 0.45rem;
    border-left: 1px solid #cfe0df;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.board-top-bar .top-bar-cache {
    border-left: 1px solid #cfe0df;
    padding-left: 0.55rem;
    align-self: center;
}

.top-bar-cache .cache-status {
    margin: 0;
    font-size: 0.72rem;
    text-align: left;
    white-space: nowrap;
    color: var(--app-muted);
}

.top-bar-cache .refresh-raporty-form .button {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
}

.board-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfffe 0%, #eef6f5 100%);
    box-shadow: 0 4px 14px rgba(0, 64, 64, 0.05);
}

.board-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem 0.75rem;
    min-width: 0;
    width: 100%;
}

.board-toolbar-period {
    display: flex;
    align-items: center;
    flex: 1 1 20rem;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
}

.board-toolbar-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 auto;
    margin-left: auto;
    min-width: 0;
    max-width: 100%;
}

.board-toolbar-controls .driver-count-scope-notice {
    flex: 1 1 100%;
    margin: 0;
    max-width: none;
}

.board-toolbar-row-period {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    width: 100%;
}

.board-control-panel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.72rem;
    border: 1px solid #b7d0cd;
    border-radius: 999px;
    background: #fff;
    color: var(--eltrans-ink);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 64, 64, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.board-control-panel-toggle:hover {
    background: #f4fbfa;
    border-color: #8fbcb6;
    box-shadow: 0 2px 6px rgba(0, 64, 64, 0.08);
}

.board-control-panel-toggle:focus-visible {
    outline: 2px solid var(--eltrans-teal);
    outline-offset: 2px;
}

.board-control-panel-toggle.is-open {
    background: var(--eltrans-cyan-soft);
    border-color: #8fbcb6;
    color: var(--eltrans-petrol);
}

.board-control-panel-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    line-height: 1;
    color: var(--eltrans-teal);
}

.board-control-panel-chevron {
    display: block;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.board-control-panel-toggle.is-open .board-control-panel-chevron {
    transform: rotate(180deg);
}

.board-collapsible-top {
    margin-bottom: 0.7rem;
}

.board-control-panel {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #f7fbfb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.board-collapsible-top[hidden] {
    display: none;
}

body.board-top-panel-collapsed .board-toolbar {
    margin-bottom: 0.75rem;
}

.board-toolbar-period .board-view-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.board-toolbar-period .board-nav-btn {
    min-width: 1.75rem;
    padding: 0.28rem 0.42rem;
    font-size: 1rem;
    line-height: 1;
}

.board-toolbar-period .board-view-select {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 0;
    font-size: 0.72rem;
}

.board-toolbar-period .board-view-select select {
    min-width: 7.5rem;
    font-size: 0.75rem;
    padding: 0.28rem 1.9rem 0.28rem 0.4rem;
}

.board-toolbar-period .board-today-btn,
.board-toolbar-period .button {
    padding: 0.28rem 0.62rem;
    font-size: 0.76rem;
    line-height: 1.2;
}

.board-test-today-form {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.35rem;
    margin: 0;
}

.board-test-today {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.68rem;
    color: #4a5b72;
    line-height: 1.1;
}

.board-test-today input[type="date"] {
    width: 8.6rem;
    padding: 0.24rem 0.4rem;
    border: 1px solid #c8d4ea;
    border-radius: 8px;
    font: inherit;
    font-size: 0.76rem;
}

.board-test-today-reset {
    align-self: flex-end;
}

.board-toolbar-period .board-period-range,
.board-toolbar-period .date-range {
    font-size: 0.82rem;
    line-height: 1.25;
    color: var(--eltrans-ink);
    white-space: normal;
    font-weight: 600;
}

.board-freshness-alert {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    max-width: min(100%, 28rem);
    padding: 0.28rem 0.55rem;
    border: 1px solid #f0c36d;
    border-radius: 8px;
    background: #fff8e8;
    color: #7a4d00;
}

.board-freshness-alert[hidden] {
    display: none !important;
}

.board-freshness-alert-text {
    font-size: 0.75rem;
    line-height: 1.25;
    font-weight: 600;
}

.board-freshness-alert .button {
    flex: 0 0 auto;
}

.board-header-status {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.32rem;
    flex: 0 1 auto;
    min-width: min(100%, 44rem);
    width: auto;
    max-width: min(100%, 44rem);
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
}

.board-stat-chip-drivers .board-stat-chip-label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.board-driver-count-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.95rem;
    height: 0.95rem;
    margin: 0;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}

.board-driver-count-tip:hover,
.board-driver-count-tip:focus-visible {
    border-color: var(--eltrans-cyan);
    color: var(--eltrans-petrol);
    outline: none;
}

.board-header-status-message {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.35;
}

.board-header-status-group {
    display: grid;
    grid-template-columns: 2.85rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.45rem;
    row-gap: 0.28rem;
    min-width: 0;
    width: 100%;
}

.board-header-status-heading {
    flex: 0 0 auto;
    min-width: 0;
    font-family: var(--app-font-display);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--app-muted);
}

.board-header-status-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem;
    min-width: 0;
}

.board-stat-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.24rem;
    padding: 0.14rem 0.42rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #f7fbfb;
    line-height: 1.2;
    white-space: nowrap;
}

.board-stat-chip-value {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--eltrans-petrol);
}

.board-stat-chip-label {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--app-muted);
}

.board-stat-chip-departure {
    border-color: #f08c00;
    background: linear-gradient(160deg, #fff4df, #ffe6bf);
}

.board-stat-chip-return {
    border-color: #fbc02d;
    background: linear-gradient(160deg, #fff9df, #ffe082);
}

.board-stat-chip-driving {
    border-color: var(--eltrans-teal);
    background: linear-gradient(160deg, #e8f7f5, #d4efeb);
}

.board-stat-chip-mandatory {
    border-color: #c62828;
    background: linear-gradient(160deg, #fdeaea, #ef9a9a);
}

.board-stat-chip-vacation {
    border-color: #7c6bb5;
    background: linear-gradient(160deg, #f4f1fb, #e4dcf5);
}

.board-stat-chip-available {
    border-color: #2eb85c;
    background: linear-gradient(160deg, #ebf9ef, #d4f0dc);
}

.board-stat-chip-neutral {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.board-header-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.board-header-status-filter {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: var(--eltrans-cyan-soft);
    color: var(--eltrans-ink);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}

.board-view-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.board-nav-btn {
    min-width: 2.1rem;
    padding: 0.35rem 0.55rem;
    font-size: 1.15rem;
    line-height: 1;
}

.board-view-select {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.78rem;
    color: #4a5d78;
}

.board-view-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 7.5rem;
    padding-right: 1.9rem;
    cursor: pointer;
}

body.board-view-day .timeline-top-scroll,
body.board-view-week .timeline-top-scroll,
body.board-view-month .timeline-top-scroll {
    display: none;
}

body.board-view-day .board-frozen-scrollbar-spacer,
body.board-view-week .board-frozen-scrollbar-spacer,
body.board-view-month .board-frozen-scrollbar-spacer {
    display: none;
}

body.board-view-custom .board-scroll-layout {
    grid-template-rows: auto auto minmax(0, 1fr);
}

body.board-view-custom .board-frozen-scrollbar-spacer {
    display: block;
    grid-column: 1;
    grid-row: 1;
}

body.board-view-custom .timeline-top-scroll {
    display: block;
    grid-column: 2;
    grid-row: 1;
}

body.board-view-custom .board-frozen-header {
    grid-row: 2;
}

body.board-view-custom .board-timeline-header {
    grid-row: 2;
}

body.board-view-custom .board-frozen-scroll {
    grid-row: 3;
}

body.board-view-custom .board-timeline-wrap {
    grid-row: 3;
}

body.board-view-custom .board-timeline-header-track,
body.board-view-custom .board-timeline-body-track {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    transform: none;
}

body.board-view-custom .board-timeline-header-table,
body.board-view-custom .board-timeline-body-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: fixed;
}

body.board-view-custom .day-col {
    width: 6.2rem;
    min-width: 6.2rem;
    max-width: 6.2rem;
}

body.board-view-custom .planner-cell {
    overflow: hidden;
}

body.board-page .board-event-swatch {
    display: block;
    box-sizing: border-box;
    min-height: 0.95rem;
    height: 0.95rem;
    margin: 0.1rem 0.04rem;
    padding: 0;
    border-width: 1px;
    border-style: solid;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    color: transparent;
    white-space: nowrap;
}

body.board-page .board-event-swatch strong,
body.board-page .board-event-swatch .route-flags:not(.board-load-flags),
body.board-page .board-event-swatch .fleet-ready-badge {
    display: none !important;
}

/* Ciągły chip ładunku — jeden pasek przez kilka dni */
body.board-purpose-loads .board-timeline-body-track {
    position: relative;
}

body.board-purpose-loads .board-load-span-layer {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 6;
    pointer-events: none;
}

body.board-purpose-loads .planner-cell.day-col {
    overflow: visible;
}

body.board-page .board-load-span-track {
    display: block;
    width: 100%;
    pointer-events: none;
}

body.board-page .board-load-span-bar {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    box-sizing: border-box;
    height: 1.2rem;
    min-height: 1.2rem;
    padding: 0 0.35rem;
    border-width: 1px;
    border-style: solid;
    border-radius: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
    pointer-events: auto;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

body.board-page .board-load-span-bar .board-load-span-end {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    max-width: 48%;
    line-height: 1;
    pointer-events: none;
}

body.board-page .board-load-span-bar .board-load-span-end .flag-icon {
    width: 14px;
    height: 10px;
    flex: 0 0 auto;
    border-color: rgba(15, 23, 42, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

body.board-page .board-load-span-bar .board-load-span-code {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    color: #7a3e00;
}

body.board-page .board-load-span-bar .board-load-span-when,
body.board-page .board-load-span-bar .board-load-span-sep {
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    color: #7a3e00;
}

body.board-page .board-load-span-bar .board-load-span-end--dated {
    max-width: 62%;
}

body.board-page .board-load-span-bar--stacked {
    display: block;
    overflow: visible;
    height: auto;
}

body.board-page .board-load-span-daystack {
    position: absolute;
    top: 1px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    max-width: 8rem;
    overflow: hidden;
    pointer-events: none;
    box-sizing: border-box;
}

body.board-page .board-load-span-daystack--unload {
    align-items: flex-end;
    right: 0.4rem;
    left: auto;
}

body.board-page .board-load-span-daystack .board-load-span-end {
    position: static;
    max-width: 100%;
    overflow: hidden;
    background: transparent;
}

body.board-page .board-load-span-daystack .board-load-span-code,
body.board-page .board-load-span-daystack .board-load-span-when {
    overflow: hidden;
    text-overflow: ellipsis;
}

body.board-page .board-load-span-end--pinned {
    position: absolute;
    top: 1px;
    right: 0.4rem;
    left: auto;
    z-index: 3;
    max-width: min(46%, 9rem);
    overflow: hidden;
    background: transparent;
}

body.board-page .board-load-span-bar--multi .board-load-span-end--to,
body.board-page .board-load-span-bar .board-load-span-stop {
    background: #ffc46b;
}

body.board-page .board-load-span-bar .board-load-span-stop {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    max-width: 46%;
    padding-right: 0.2rem;
    pointer-events: none;
}

body.board-page .board-load-span-bar--multi .board-load-span-end--to {
    position: relative;
    z-index: 2;
    padding-left: 0.15rem;
}

body.board-page .board-event-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.08rem;
    min-width: 0;
    max-width: 100%;
}

body.board-page .board-event-stack .board-event-description,
body.board-page .board-event-stack .board-event-caption {
    display: block;
    margin: 0 0.04rem;
    padding: 0;
    font-size: 0.62rem;
    line-height: 1.15;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.board-view-custom .slim-event.board-event-swatch {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

body.board-view-custom .slim-event:not(.board-event-swatch) {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.board-view-custom .slim-event strong {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.board-view-custom .slim-event .route-flags {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    align-items: center;
}

body.board-view-day .board-timeline-header-track,
body.board-view-week .board-timeline-header-track,
body.board-view-month .board-timeline-header-track,
body.board-view-day .board-timeline-body-track,
body.board-view-week .board-timeline-body-track,
body.board-view-month .board-timeline-body-track {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
}

body.board-view-day .board-timeline-header-table,
body.board-view-week .board-timeline-header-table,
body.board-view-month .board-timeline-header-table,
body.board-view-day .board-timeline-body-table,
body.board-view-week .board-timeline-body-table,
body.board-view-month .board-timeline-body-table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
}

body.board-view-day .day-col,
body.board-view-week .day-col {
    width: auto;
    min-width: 0;
    max-width: none;
}

body.board-view-day .planner-cell,
body.board-view-week .planner-cell {
    overflow: hidden;
}

body.board-view-day .slim-event.board-event-swatch,
body.board-view-week .slim-event.board-event-swatch {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

body.board-view-day .slim-event:not(.board-event-swatch),
body.board-view-week .slim-event:not(.board-event-swatch) {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.board-view-day .slim-event strong,
body.board-view-week .slim-event strong {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.board-view-day .slim-event .route-flags,
body.board-view-week .slim-event .route-flags {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    align-items: center;
}

body.board-view-month .day-col {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0.08rem 0.04rem;
    font-size: 0.58rem;
    line-height: 1.1;
    text-align: center;
}

body.board-view-month .planner-cell {
    overflow: hidden;
}

body.board-view-month .available-label {
    font-size: 0;
}

.board-didaskalia {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.35rem;
    padding: 0.18rem 0.45rem;
    border: 1px solid #d8e3f5;
    border-radius: 6px;
    background: #f8fbff;
    overflow: hidden;
    white-space: nowrap;
}

.board-didaskalia-heading {
    flex: 0 0 auto;
    margin: 0;
    padding-right: 0.35rem;
    border-right: 1px solid #d8e3f5;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.board-didaskalia-item {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    font-size: 0.77rem;
    line-height: 1;
    color: #475569;
}

.board-didaskalia-swatch {
    flex: 0 0 auto;
    width: 0.85rem;
    height: 0.55rem;
    min-height: 0.55rem;
    margin: 0;
    padding: 0;
    pointer-events: none;
    font-size: 0;
    line-height: 0;
}

body.board-page .board-didaskalia .board-event-swatch {
    display: block;
    width: 0.85rem;
    height: 0.55rem;
    min-height: 0.55rem;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

body.board-page .board-didaskalia .board-didaskalia-swatch.event-more-badge {
    width: auto;
    min-width: 0.85rem;
    height: 0.55rem;
    padding: 0 0.18rem;
    font-size: 0.65rem;
    line-height: 0.55rem;
    color: #334155;
}

.board-toolbar.drivers-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    position: sticky;
    top: var(--app-sticky-offset);
    z-index: 150;
    flex-shrink: 0;
}

.board-toolbar-filters {
    width: 100%;
    min-width: 0;
}

.board-toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}

.refresh-raporty-form {
    display: inline-flex;
    margin: 0;
}

.clean-planner tbody tr.planner-row-inactive td {
    color: #6b7c93;
}

.clean-planner tbody tr.planner-row-inactive td.frozen-col {
    background-color: #eef1f5 !important;
}

.clean-planner tbody tr.planner-row-even.planner-row-inactive td.frozen-col {
    background-color: #e6ebf2 !important;
}

.board-inactive-separator td {
    padding: 0.55rem 0.75rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b7c93;
    background: #edf1f7 !important;
    border-top: 2px solid #c5d0e0;
    border-bottom: 1px solid #d8e3f5;
}

.board-status-cell {
    padding: 1.25rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.cache-status {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted, #64748b);
    white-space: nowrap;
}

.filter-note {
    margin-top: 0.35rem;
    font-size: 0.88rem;
    color: #4a5b73;
}

.card {
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, #e5ecf9);
    border-radius: var(--app-radius, 14px);
    box-shadow: var(--app-shadow, 0 10px 28px rgba(0, 64, 64, 0.08));
    padding: 1rem;
}

.split-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: 2fr 1fr;
}

.raporty-error {
    border-left: 4px solid #c62828;
    margin-bottom: 1rem;
}

.raporty-error h2 {
    margin-top: 0;
    color: #b71c1c;
}

.raporty-table-wrap {
    max-height: calc(100vh - 220px);
}

.raporty-table th {
    white-space: nowrap;
    font-size: 0.85rem;
}

.raporty-table td {
    font-size: 0.85rem;
    max-width: 280px;
    overflow-wrap: anywhere;
}

.raporty-key-columns {
    margin-bottom: 1rem;
}

.raporty-key-columns h2 {
    margin-top: 0;
}

.raporty-key-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.raporty-key-card {
    border: 1px solid #d8e3f5;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    background: #f8fbff;
}

.raporty-key-card.found {
    border-left: 4px solid #2e7d32;
}

.raporty-key-card.missing {
    border-left: 4px solid #ef6c00;
    background: #fff8f0;
}

.raporty-key-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.raporty-key-card p {
    margin: 0.25rem 0;
    font-size: 0.88rem;
    color: #4a5b73;
}

.raporty-db-column {
    margin-top: 0.5rem !important;
    font-size: 0.82rem !important;
}

.raporty-db-column.missing-label {
    color: #b45309 !important;
}

.raporty-table-hint {
    margin-bottom: 0.75rem;
}

.raporty-col-highlight {
    background: #e8f1ff !important;
    font-weight: 600;
}

.raporty-table th.raporty-col-highlight {
    color: var(--eltrans-teal);
}

.raporty-col-hint {
    color: var(--eltrans-teal);
    margin-left: 0.15rem;
}

.raporty-empty {
    color: #9aa8bc;
}

.drivers-layout {
    grid-template-columns: minmax(0, 1fr);
}

.drivers-layout .card {
    min-width: 0;
}

.planner-top-layout {
    grid-template-columns: 1.4fr 1fr;
    margin-bottom: 1rem;
}

.compact {
    margin-bottom: 0.8rem;
}

.form-grid p {
    margin: 0 0 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    border: 1px solid #d4deef;
    border-radius: 8px;
    padding: 0.48rem 0.55rem;
    font: inherit;
}

.form-grid input[type="checkbox"] {
    width: auto;
    align-self: flex-start;
    margin-top: 0.15rem;
}

.form-grid .help {
    font-size: 0.78rem;
    color: #5a6b82;
    line-height: 1.3;
}

.form-grid p:has(#id_longer_trip),
.form-grid p:has(#id_shorter_trip) {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.55rem;
}

.form-grid p:has(#id_longer_trip) label,
.form-grid p:has(#id_shorter_trip) label {
    font-weight: 700;
}

.form-grid p:has(#id_length_mode) {
    display: none;
}

.form-grid .absence-type-field ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-grid .absence-type-field li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.form-grid .absence-type-field input[type="radio"] {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.form-grid .absence-type-field label {
    font-weight: 500;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pill.success {
    background: #e8f8ef;
    color: #1f7a4d;
}

.pill.muted {
    background: #eef2f8;
    color: #5a6b82;
}

.delete-target {
    padding: 0.7rem 0.8rem;
    border: 1px solid #ffd1d5;
    border-radius: 10px;
    background: #fff5f6;
    color: #7c2a34;
    font-weight: 600;
}

.mobile-board {
    display: none;
    margin-top: 1rem;
    gap: 0.9rem;
}

.mobile-drivers {
    display: none;
    margin-top: 0.8rem;
    gap: 0.7rem;
}

.driver-mobile-card h3 {
    margin: 0 0 0.35rem;
}

.mobile-driver h3 {
    margin: 0 0 0.25rem;
}

.driver-meta,
.driver-note {
    margin: 0.35rem 0;
    font-size: 0.9rem;
    color: #3d4e67;
}

.mobile-days {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.65rem;
}

.mobile-day {
    padding: 0.7rem;
}

.mobile-day-header {
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--eltrans-ink);
}

.shipment-list,
.free-schedule {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.shipment-item,
.free-day {
    border: 1px solid #dde7f6;
    border-radius: 10px;
    background: #f8fbff;
    padding: 0.55rem 0.65rem;
}

.shipment-item span,
.free-day span {
    display: block;
    color: #4a5d7b;
    margin-top: 0.2rem;
    font-size: 0.9rem;
}

@media (max-width: 1400px) {
    .drivers-layout .drivers-table-wrap {
        display: none;
    }

    .mobile-drivers {
        display: grid;
    }
}

@media (max-width: 980px) {
    :root {
        --app-page-pad: 0.8rem;
    }

    .fleet-kpi-panels {
        grid-template-columns: 1fr;
    }

    .planner-section-nav {
        width: 100%;
    }

    .app-top-nav {
        align-items: stretch;
    }

    .app-top-nav .planner-section-nav {
        flex: 1 1 100%;
        order: 3;
    }

    .app-top-user-cluster {
        margin-left: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
    }

    .app-top-user-form {
        margin-left: 0;
    }

    .app-top-user-form select {
        max-width: none;
        width: 100%;
    }

    .app-top-user-toggle {
        width: 100%;
        max-width: none;
    }

    .app-top-icon-btn.app-top-login-btn {
        width: 2.15rem;
        padding: 0;
    }

    .app-top-login-label {
        display: none;
    }

    .driver-list-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .top-bar,
    .navigation,
    .form-actions {
        flex-wrap: wrap;
    }

    .split-layout {
        grid-template-columns: 1fr;
    }

    .planner-top-layout {
        grid-template-columns: 1fr;
    }

    .board-table-wrap,
    .drivers-layout .drivers-table-wrap {
        display: block;
    }

    .mobile-drivers {
        display: grid;
    }

    /* Keep natural button width — full-bleed stretch clipped borders/scrollbar. */
    .button {
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .button.tiny {
        width: auto;
    }

    body.board-page .button {
        width: auto;
    }

    .board-filters-row--actions,
    .board-filters-actions,
    .board-toolbar-meta,
    .form-actions,
    .vehicle-list-filter-actions,
    .reports-filters-actions {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .board-filters-actions > .button,
    .board-filters-actions > a.button,
    .board-toolbar-meta .button,
    .form-actions > .button,
    .form-actions > a.button,
    .vehicle-list-filter-actions > .button,
    .vehicle-list-filter-actions > a.button,
    .reports-filters-actions > .button,
    .reports-filters-actions > a.button,
    .refresh-raporty-form .button {
        flex: 0 1 auto;
        width: auto;
        max-width: 100%;
    }

    .board-table-wrap {
        max-height: calc(100vh - 210px);
    }

    .board-top-bar {
        flex-wrap: wrap;
    }

    .board-control-inline {
        align-items: stretch;
    }

    .board-control-inline > .button {
        width: auto;
        align-self: center;
    }

    .board-top-bar-actions {
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }

    .board-header-filters,
    .board-filters-group {
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
    }

    .board-header-filters-form {
        flex: 1 1 100%;
        width: 100%;
    }

    .board-header-filters select[name="sort"],
    .board-header-filters select[name="trip_filter"] {
        min-width: 0;
        max-width: 100%;
    }

    .board-header-filters input.board-filter-search {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .top-bar-right,
    .board-top-bar-actions {
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }

    .top-bar-cache {
        margin-left: 0;
        border-left: none;
        padding-left: 0;
        width: 100%;
    }

    .board-top-bar .button,
    .board-toolbar-period .button,
    .board-control-panel-toggle {
        width: auto;
    }

    .board-toolbar-controls {
        width: 100%;
    }

    .board-toolbar-period {
        justify-content: flex-start;
        flex: 1 1 100%;
        max-width: none;
    }

    .board-toolbar-summary {
        flex: 1 1 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .board-header-status {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .board-header-status-group {
        width: auto;
    }

    .top-bar-cache .cache-status {
        text-align: left;
        white-space: normal;
    }

    body.drivers-page .drivers-table-wrap {
        max-height: calc(100vh - 220px);
    }

    body.fleet-page .fleet-lists-grid {
        grid-template-columns: 1fr;
    }

    body.fleet-vehicles-page .vehicle-list-heading,
    body.zasoby-catalog-page .vehicle-list-heading,
    body.app-catalog-page .vehicle-list-heading {
        flex-direction: column;
    }

    body.fleet-vehicles-page .fleet-add-vehicle-form--inline {
        width: 100%;
    }

    .fleet-trip-prep-controls {
        grid-template-columns: 1fr;
    }

    body.fleet-page .fleet-section--blocks {
        max-height: none;
    }

    body.fleet-page .fleet-blocks-scroll {
        max-height: 30vh;
    }

    body.fleet-page .fleet-vehicles-scroll {
        max-height: 45vh;
    }

    .planner-table .sticky-col {
        min-width: unset;
        max-width: unset;
    }

    .scroll-hint {
        width: 100%;
    }
}

body.instruction-page .instruction-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.instruction-page .instruction-viewer-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 1rem;
}

.instruction-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.instruction-pdf-frame {
    width: 100%;
    flex: 1 1 auto;
    min-height: 70vh;
    border: 1px solid var(--board-grid-line, #c7cdd8);
    border-radius: 6px;
    background: #525659;
}

.admin-deactivate-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.admin-successor-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.75rem;
    color: #4b5563;
}

.admin-successor-label select {
    max-width: 16rem;
}

.planner-table tr.is-inactive td {
    color: #6b7c93;
}

.driver-details-table tr.is-inactive td.col-driver-name {
    font-weight: 600;
}

.is-col-hidden {
    display: none;
}

.column-picker-dialog {
    width: min(28rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 0;
    border-radius: 14px;
    color: var(--eltrans-ink);
    box-shadow: 0 18px 50px rgba(0, 46, 46, 0.28);
}

.column-picker-dialog::backdrop {
    background: rgba(0, 46, 46, 0.45);
}

.column-picker-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.15rem 1.25rem 1.1rem;
}

.column-picker-form h2,
.column-picker-lead {
    margin: 0;
}

.column-picker-lead {
    color: var(--eltrans-slate);
}

.column-picker-options {
    display: grid;
    gap: 0.4rem;
    max-height: 60vh;
    overflow: auto;
}

.column-picker-group {
    margin: 0.65rem 0 0.15rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.list-heading-actions,
.resources-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.column-picker-group--sub {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.active-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin: 0.15rem 0 0.55rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.active-filter-bar[hidden],
.active-filter-bar.is-empty {
    display: none;
}

.active-filter-bar-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
}

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 0;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    margin: 0;
    padding: 0.22rem 0.45rem 0.22rem 0.55rem;
    border: 1px solid #c7d2e5;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.active-filter-chip:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.active-filter-chip--advanced {
    border-color: #99c2bf;
    background: #f0faf8;
}

.active-filter-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-filter-chip-x {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
    color: #64748b;
}

.advanced-filter-dialog {
    width: min(40rem, calc(100vw - 2rem));
}

.advanced-filter-builder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.55rem;
    align-items: end;
    margin: 0.35rem 0 0.75rem;
}

.advanced-filter-builder .button {
    justify-self: start;
}

.advanced-filter-rule-list {
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 12rem;
    overflow: auto;
}

.advanced-filter-rule-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.82rem;
}

.advanced-filter-rule-empty {
    color: #64748b;
    border-style: dashed !important;
    background: #f8fafc !important;
}

.kartoteka-cell {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tr.is-page-hidden,
tr.is-col-filter-hidden {
    display: none !important;
}

.column-filter-input {
    /* width:0 + min-width:100% — nie rozpycha szerokich kolumn */
    width: 0;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.2rem 0.3rem;
    font-size: 0.72rem;
    font-weight: 500;
}

tr[data-column-filter-row] th {
    padding-top: 0.2rem;
    padding-bottom: 0.35rem;
    vertical-align: middle;
    overflow: hidden;
}

/* Wąskie nagłówki (np. Typ) — trochę miejsca na wpisywanie */
tr[data-column-filter-row]:not([hidden]) th:not(.col-actions):not(.is-col-hidden) {
    min-width: 5rem;
}

tr[data-column-filter-row]:not([hidden]) .column-filter-input {
    width: 100%;
    min-width: 4.75rem;
}

.button.is-pressed {
    box-shadow: inset 0 0 0 2px var(--eltrans-teal, #0f5c5c);
}

.list-pager {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.6rem 0.2rem 0.2rem;
    font-size: 0.85rem;
}

.list-hscroll {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    position: relative;
}

.list-hscroll-top,
.list-hscroll-bottom {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    height: 16px;
    z-index: 8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.list-hscroll-top {
    position: sticky;
    top: calc(var(--app-sticky-offset) + var(--list-hscroll-toolbar-offset, 0px));
    z-index: 145;
    margin-bottom: 0.25rem;
    box-shadow: 0 2px 8px rgba(15, 40, 60, 0.08);
}

.list-hscroll-bottom {
    position: sticky;
    bottom: 0;
    z-index: 145;
    margin-top: 0.25rem;
    box-shadow: 0 -2px 8px rgba(15, 40, 60, 0.08);
}

.list-hscroll-top-spacer,
.list-hscroll-bottom-spacer {
    height: 1px;
    pointer-events: none;
}

.list-hscroll-body {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    scrollbar-width: none;
}

.list-hscroll-body::-webkit-scrollbar {
    display: none;
}

.list-hscroll .planner-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.list-hscroll .planner-table th,
.list-hscroll .planner-table td {
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.list-hscroll .planner-table th.col-actions,
.list-hscroll .planner-table td.col-actions {
    min-width: 6.5rem;
    width: auto;
}

.list-hscroll .planner-table .kartoteka-cell {
    min-width: 0;
    max-width: 18rem;
}

.list-hscroll .column-filter-input {
    width: 0;
    min-width: 100%;
}

body.fleet-vehicles-page .list-hscroll .vehicle-details-table {
    width: max-content;
    min-width: 100%;
}

.column-picker-options label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.column-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* MDZ load form: załadunek | wyładunek */
.form-grid.mdz-load-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.form-grid.mdz-load-form > .mdz-load-full,
.form-grid.mdz-load-form > .form-errors,
.form-grid.mdz-load-form > input[type="hidden"] {
    grid-column: 1 / -1;
}

.mdz-load-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem 1.1rem;
    align-items: start;
}

.mdz-load-column {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid #d7dee8;
    border-radius: 0.55rem;
    background: #f8fafc;
    min-width: 0;
}

.mdz-load-column-title {
    margin: 0 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.mdz-load-column > p,
.mdz-extra-loading > p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.mdz-load-column label,
.mdz-extra-loading label {
    font-weight: 600;
}

.mdz-load-column input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #eef2f7;
}

.mdz-load-column > p.mdz-extra-loading-add-row {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
}

.mdz-extra-loading-add {
    width: 1.85rem;
    height: 1.85rem;
    min-width: 1.85rem;
    padding: 0;
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 700;
}

.mdz-extra-loadings {
    display: grid;
    gap: 0.65rem;
}

.mdz-extra-loading {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.65rem;
    border-top: 1px solid #d7dee8;
}

.mdz-extra-loading-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mdz-extra-loading-head .mdz-load-column-title {
    margin: 0;
}

.mdz-extra-loading-remove {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}

.form-grid.mdz-load-form .mdz-load-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.mdz-load-delete-form {
    display: none;
}

.planned-loads-section-title {
    margin: 0.4rem 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.planned-loads-table-wrap {
    overflow: auto;
    margin: 0.35rem 0 0.75rem;
    border: 1px solid #d7dee8;
    border-radius: 0.55rem;
    background: #fff;
}

.planned-loads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.planned-loads-table th,
.planned-loads-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid #e8eef5;
    text-align: left;
    vertical-align: top;
}

.planned-loads-table th {
    background: #f3f8f7;
    font-weight: 700;
    white-space: nowrap;
}

.planned-load-row.is-assigned {
    background: #e7f7ee;
}

.planned-load-row.is-assigned td {
    border-bottom-color: #c9ebd7;
}

.planned-load-cc {
    display: inline-block;
    min-width: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0f5c5c;
}

.planned-load-code {
    font-weight: 600;
}

.planned-load-notes {
    max-width: 14rem;
    color: #475569;
    white-space: pre-wrap;
}

.planned-load-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.planned-load-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.planned-load-inline-delete {
    display: inline;
    margin: 0;
}

.mdz-planned-load-picker select {
    width: 100%;
}

.planned-load-summary p {
    margin: 0.2rem 0;
}

.ferry-prices-table th.ferry-rate-col,
.ferry-prices-table td.ferry-rate-cell {
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ferry-prices-table th.ferry-actions-col,
.ferry-prices-table td.ferry-actions-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.ferry-price-rate-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 0.75rem 1rem;
}

.ferry-price-form p {
    margin: 0 0 0.85rem;
}

.ferry-price-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.free-trucks-legend-card {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.free-trucks-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.free-trucks-legend-item {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.free-trucks-table tbody tr.free-truck-day--today,
.free-trucks-legend-item.free-truck-day--today {
    background: #dbeafe;
}

.free-trucks-table tbody tr.free-truck-day--tomorrow,
.free-trucks-legend-item.free-truck-day--tomorrow {
    background: #fef08a;
}

.free-trucks-table tbody tr.free-truck-day--after_tomorrow,
.free-trucks-legend-item.free-truck-day--after_tomorrow {
    background: #bbf7d0;
}

.free-trucks-table tbody tr.free-truck-day--later,
.free-trucks-legend-item.free-truck-day--later {
    background: #fff;
}

.free-truck-date {
    display: block;
    font-weight: 600;
}

.free-truck-day-label {
    display: block;
    font-size: 0.78rem;
    color: #4b5563;
}

.free-trucks-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.free-trucks-edit-note {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #fcd34d;
    border-radius: 0.4rem;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.92rem;
}

.free-trucks-page.is-free-trucks-editing .free-trucks-table .free-trucks-edit-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.free-trucks-row-actions-col,
.free-trucks-row-actions-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.driver-phones-actions-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.driver-phones-actions-cell .inline-form {
    display: inline;
    margin-left: 0.35rem;
}

.driver-phones-table .driver-phones-model-col {
    width: 4.5rem;
    max-width: 5.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.driver-phones-row--missing td {
    color: #6b7280;
}

@media (max-width: 640px) {
    .mdz-load-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .ferry-price-rate-row {
        grid-template-columns: minmax(0, 1fr);
    }
}


