/* ===================== ZAMOW.online Kierowca (driver app) =====================
   The layout also carries manager-shell / manager-nav-wrap, which switch off MudBlazor's own look
   (see app.css). Rules here start with .driver-shell or .driver-nav so they win over those resets. */

:root {
    --driver-blue: #2f5bea;
    --driver-blue-light: #3b6cf0;
    --driver-navy: #141b2d;
    --driver-bg: #f3f5fb;
    --driver-card: #ffffff;
    --driver-text: #141b2d;
    --driver-muted: #5b6270;
    --driver-line: #e5e8f0;
    --driver-orange: #f97316;
}

.manager-shell.driver-shell {
    padding: 0 16px calc(112px + env(safe-area-inset-bottom));
    background: var(--driver-bg);
    color: var(--driver-text);
}

.driver-shell .driver-content {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---- header: blue gradient, full width of the phone ---- */
.driver-shell .driver-header {
    margin: 0 -16px;
    padding: calc(16px + env(safe-area-inset-top)) 20px 20px;
    background: linear-gradient(135deg, var(--driver-blue) 0%, var(--driver-blue-light) 100%);
    color: #fff;
    border-radius: 0 0 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* the stat cards under the header slide up into it */
.driver-shell .driver-header:has(+ .driver-stats-overlap) {
    padding-bottom: 60px;
}

.driver-shell .driver-stats-overlap {
    margin-top: -56px;
}

.driver-shell .driver-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.driver-shell .driver-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.driver-shell .driver-header-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.driver-shell .driver-header-sub {
    font-size: 14px;
}

/* ---- home header ---- */
.driver-shell .driver-brand {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.driver-shell .driver-brand-logo {
    height: auto;
    max-width: 45vw;
    display: block;
}

.driver-shell .driver-brand-pill {
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--driver-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.driver-shell .driver-logout {
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .45);
    color: #fff;
    font-weight: 700;
    text-transform: none;
    white-space: nowrap;
}

.driver-shell .driver-hello {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
}

/* ---- cards ---- */
.driver-shell .driver-card {
    padding: 16px;
    background: var(--driver-card);
    border-radius: 22px;
    box-shadow: 0 6px 20px rgba(20, 27, 45, .06);
}

.driver-shell .driver-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.driver-shell .driver-card-title {
    font-size: 16px;
    font-weight: 800;
}

.driver-shell .driver-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--driver-muted);
}

.driver-shell .driver-muted {
    font-size: 13px;
    color: var(--driver-muted);
}

.driver-shell .driver-empty {
    padding: 12px 0;
    text-align: center;
    color: var(--driver-muted);
}

/* ---- stats ---- */
.driver-shell .driver-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.driver-shell .driver-stat {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.driver-shell .driver-stat-value {
    font-size: clamp(15px, 4.6vw, 18px);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

/* ---- home tile ---- */
.driver-shell .driver-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
}

.driver-shell .driver-tile-wide {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.driver-shell .driver-tile-wide-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.driver-shell .driver-tile-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    margin-bottom: 6px;
}

.driver-shell .driver-tile-wide .driver-tile-icon {
    margin-bottom: 0;
}

.driver-shell .driver-tile-name {
    font-size: 16px;
    font-weight: 800;
}

.driver-shell .driver-tile-sub {
    font-size: 13px;
    color: var(--driver-muted);
}

.driver-shell .driver-tone-orange {
    background: var(--driver-orange);
}

/* ---- chips ---- */
.driver-shell .driver-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.driver-shell .driver-chip .mud-icon-root {
    font-size: 16px;
}

.driver-shell .driver-chip.is-live {
    letter-spacing: .06em;
    text-transform: uppercase;
    background: #dcfce7;
    color: #15803d;
}

.driver-shell .driver-chip.is-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ---- big buttons ---- */
.driver-shell .driver-btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.driver-shell .driver-btn.is-full {
    width: 100%;
    min-height: 56px;
    border-radius: 20px;
}

.driver-shell .driver-btn.is-primary {
    background: var(--driver-blue);
    color: #fff;
}

.driver-shell .driver-btn:disabled {
    opacity: .5;
}

/* ---- vertical timeline ---- */
.driver-shell .driver-timeline {
    display: flex;
    flex-direction: column;
}

.driver-shell .driver-timeline-row {
    position: relative;
    display: grid;
    grid-template-columns: 52px 16px minmax(0, 1fr);
    column-gap: 10px;
    padding-bottom: 14px;
}

.driver-shell .driver-timeline-row:last-child {
    padding-bottom: 0;
}

/* the line joining one dot to the next */
.driver-shell .driver-timeline-row:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 69px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: var(--driver-line);
}

.driver-shell .driver-timeline-row.is-done:not(:last-child)::after {
    background: var(--driver-blue);
}

.driver-shell .driver-timeline-time {
    font-weight: 700;
    color: var(--driver-muted);
    font-variant-numeric: tabular-nums;
}

.driver-shell .driver-timeline-dot {
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border-radius: 50%;
    border: 2px solid var(--driver-blue);
    background: #fff;
    box-sizing: border-box;
}

.driver-shell .driver-timeline-row.is-done .driver-timeline-dot {
    background: var(--driver-blue);
}

.driver-shell .driver-timeline-row.is-current .driver-timeline-dot {
    border-color: var(--driver-orange);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .2);
}

.driver-shell .driver-timeline-title {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.driver-shell .driver-timeline-sub {
    color: var(--driver-muted);
}

/* ---- history: day picker ---- */
.driver-shell .driver-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.driver-shell .driver-day {
    min-height: 62px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    cursor: pointer;
}

.driver-shell .driver-day.active {
    background: #fff;
    color: var(--driver-blue);
}

.driver-shell .driver-day-name {
    font-size: 11px;
    font-weight: 700;
}

.driver-shell .driver-day-number {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.1;
}

.driver-shell .driver-day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: transparent;
}

.driver-shell .driver-day.is-today .driver-day-dot {
    background: currentColor;
}

.driver-shell .driver-day-numbers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.driver-shell .driver-day-number-cell {
    padding: 10px;
    border-radius: 16px;
    background: var(--driver-bg);
    text-align: center;
}

/* ---- history: km by hour ---- */
.driver-shell .driver-highlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(47, 91, 234, .08);
}

.driver-shell .driver-highlight .driver-label {
    color: var(--driver-blue);
}

.driver-shell .driver-highlight-hour {
    font-size: 16px;
    font-weight: 800;
}

.driver-shell .driver-highlight-values {
    text-align: right;
}

.driver-shell .driver-bars {
    display: flex;
    align-items: stretch;
    gap: 3px;
    height: 140px;
    overflow-x: auto;
}

.driver-shell .driver-bar-col {
    flex: 1 1 0;
    min-width: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.driver-shell .driver-bar-track {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: flex-end;
}

.driver-shell .driver-bar {
    width: 100%;
    border-radius: 6px;
    background: rgba(47, 91, 234, .2);
    transition: height .3s ease;
}

.driver-shell .driver-bar-col.active .driver-bar {
    background: var(--driver-blue);
}

.driver-shell .driver-bar-label {
    font-size: 11px;
    text-align: center;
    color: var(--driver-muted);
}

.driver-shell .driver-bar-col.active .driver-bar-label {
    color: var(--driver-blue);
    font-weight: 800;
}

.driver-shell .driver-btn.is-primary:disabled {
    color: #fff !important;
}

.driver-shell .driver-btn .mud-progress-circular {
    color: currentColor;
}

/* ---- load failed ---- */
.driver-shell .driver-load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.driver-shell .driver-load-error-icon {
    font-size: 40px;
    color: var(--driver-muted);
}

.driver-shell .driver-day-loading {
    margin: 0 4px;
}

/* ---- press feedback ---- */
.driver-shell .driver-tile:active,
.driver-shell .driver-day:active,
.driver-shell .driver-bar-col:active,
.driver-shell .driver-btn:active,
.driver-nav .driver-nav-item:active {
    transform: scale(.97);
    filter: brightness(.95);
}

.driver-shell .driver-tile,
.driver-shell .driver-btn,
.driver-shell .driver-day,
.driver-nav .driver-nav-item {
    transition: transform .08s ease, filter .08s ease, background-color .2s ease, color .2s ease;
}

/* ---- bottom navigation: a floating dark bar ---- */
.manager-nav-wrap.driver-nav {
    max-width: 480px;
    padding: 8px;
    gap: 2px;
    background: var(--driver-navy);
    border: 0;
    border-radius: 26px;
    box-shadow: 0 12px 30px rgba(20, 27, 45, .35);
}

.driver-nav .driver-nav-item {
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 18px;
    color: rgba(255, 255, 255, .6);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.driver-nav .driver-nav-item.active {
    background: var(--driver-blue);
    color: #fff;
}

.driver-nav .driver-nav-icon {
    position: relative;
    display: inline-flex;
}

.driver-nav .driver-nav-label {
    font-size: 11px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 360px) {
    .driver-shell .driver-stats {
        gap: 6px;
    }

    .driver-shell .driver-stat-value {
        font-size: 16px;
    }

    .driver-nav .driver-nav-label {
        font-size: 11px;
    }
}
