/* ═══════════════════════════════════════════════════════════
   Windhoff Versandportal V2 — Brand-aligned (windhoff.de)
   Paleta: zolty CTA #fdc52a + grafit #202830 + bialy
   Font: Outfit (Google Fonts)
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Marka Windhoff (light-first) */
    --wh-brand: #fdc52a;       /* zolty CTA */
    --wh-brand-2: #f5b400;     /* zolty hover (ciemniejszy) */
    --wh-accent: #fdc52a;      /* akcent = brand */
    --wh-dark: #202830;        /* grafit */
    --wh-bg: #ffffff;
    --wh-bg-2: #f2f6fa;
    --wh-surface: #ffffff;
    --wh-surface-2: #f5f7fa;
    --wh-border: #dbe2e9;
    --wh-text: #202830;
    --wh-text-2: #627385;
    --wh-text-3: #94a3b8;
    --wh-success: #198754;
    --wh-warning: #f5b400;
    --wh-danger: #dc3545;
    --wh-info: #0d6efd;
}

/* Dark-mode opcjonalny (toggle) — marka w odwrotce: grafit tlo, zolty akcent */
html.dark-mode {
    --wh-bg: #1a2028;
    --wh-bg-2: #202830;
    --wh-surface: #2a323d;
    --wh-surface-2: #232b35;
    --wh-border: #3a424d;
    --wh-text: #f2f6fa;
    --wh-text-2: #94a3b8;
    --wh-text-3: #627385;
}

/* Theme toggle icon visibility (default: light → pokaz ksiezyc, dark → pokaz slonce) */
.wh-theme-icon-light { display: inline-block; }
.wh-theme-icon-dark { display: none; }
html.dark-mode .wh-theme-icon-light { display: none; }
html.dark-mode .wh-theme-icon-dark { display: inline-block; }

* { box-sizing: border-box; }

html, body {
    background: var(--wh-bg);
    color: var(--wh-text);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ─── Layout ─── */
.wh-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.wh-sidebar {
    background: var(--wh-bg);
    border-right: 1px solid var(--wh-border);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.wh-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 2rem;
    text-decoration: none;
    color: inherit;
}

/* Logo SVG (windhoff.de oryginal — slowo "WINDHOFF") */
.wh-logo-img { display: block; height: 18px; width: auto; flex-shrink: 0; }
.wh-login-logo-img { display: block; height: 26px; width: auto; }

/* Wciaz uzywane w must-change-pw (ikona kludki) */
.wh-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--wh-brand);
    color: var(--wh-dark);
    font-size: 1.5rem;
}

.wh-logo-text { font-weight: 700; font-size: 1rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--wh-text); }
.wh-logo-badge {
    display: inline-block;
    font-size: 0.6rem;
    padding: 0.1rem 0.45rem;
    background: var(--wh-brand);
    color: var(--wh-dark);
    border-radius: 999px;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.4;
}

.wh-nav { flex: 1; }

.wh-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    color: var(--wh-text-2);
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: all 0.15s;
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
}

.wh-nav a:hover { background: var(--wh-surface); color: var(--wh-text); }

.wh-nav a.active {
    background: rgba(253, 197, 42, 0.12);
    color: var(--wh-text);
    border-left: 3px solid var(--wh-brand);
    padding-left: calc(0.85rem - 3px);
    font-weight: 600;
}

.wh-nav a i { font-size: 1.1rem; color: var(--wh-text-3); }
.wh-nav a.active i, .wh-nav a:hover i { color: var(--wh-brand-2); }

.wh-nav-section {
    font-size: 0.7rem;
    color: var(--wh-text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1.5rem 0.85rem 0.5rem;
    font-weight: 600;
}

.wh-user-card {
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: auto;
}

.wh-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--wh-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--wh-brand);
    flex-shrink: 0;
}

.wh-user-info { flex: 1; min-width: 0; }
.wh-user-name { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-user-company { font-size: 0.75rem; color: var(--wh-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Role badge (admin / spediteur / kunde) ─── */
.wh-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.3rem;
    white-space: nowrap;
}
.wh-role-badge i { font-size: 0.8rem; }
.wh-role-badge.wh-role-admin {
    background: rgba(220, 53, 69, 0.10);
    color: var(--wh-danger);
    border: 1px solid rgba(220, 53, 69, 0.25);
}
.wh-role-badge.wh-role-przewoznik {
    background: rgba(25, 135, 84, 0.10);
    color: var(--wh-success);
    border: 1px solid rgba(25, 135, 84, 0.25);
}
.wh-role-badge.wh-role-klient {
    background: rgba(253, 197, 42, 0.18);
    color: var(--wh-dark);
    border: 1px solid rgba(245, 180, 0, 0.4);
}

/* ─── Main ─── */
.wh-main { padding: 1.5rem 2rem; max-width: 100%; overflow-x: hidden; }

.wh-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.wh-topbar h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.wh-topbar-sub { color: var(--wh-text-2); font-size: 0.85rem; margin-top: 0.15rem; }

.wh-topbar-actions { display: flex; align-items: center; gap: 0.6rem; }

/* ─── Panels / KPI ─── */
.wh-panel {
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(32, 40, 48, 0.04);
}

.wh-panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wh-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wh-kpi {
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 14px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.wh-kpi::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(253, 197, 42, 0.08), transparent 70%);
    pointer-events: none;
}

.wh-kpi-label {
    font-size: 0.75rem;
    color: var(--wh-text-2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.wh-kpi-value {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.wh-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.65rem;
    font-weight: 500;
}

.wh-kpi-trend.up { color: var(--wh-success); background: rgba(25, 135, 84, 0.1); }
.wh-kpi-trend.down { color: var(--wh-danger); background: rgba(220, 53, 69, 0.1); }
.wh-kpi-trend.flat { color: var(--wh-text-2); background: var(--wh-surface-2); }

/* ─── Status badges ─── */
.wh-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.wh-status::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.wh-status.offen { color: #627385; background: rgba(98, 115, 133, 0.10); }
.wh-status.angebot { color: #6c5ce7; background: rgba(108, 92, 231, 0.10); }
.wh-status.bearbeitung, .wh-status.bearb { color: #b47600; background: rgba(253, 197, 42, 0.18); }
.wh-status.beladen { color: #0d6efd; background: rgba(13, 110, 253, 0.10); }
.wh-status.entladen { color: #6c5ce7; background: rgba(108, 92, 231, 0.10); }
.wh-status.geliefert { color: #198754; background: rgba(25, 135, 84, 0.12); }
.wh-status.abgelehnt { color: #dc3545; background: rgba(220, 53, 69, 0.10); }
.wh-status.geloescht { color: #94a3b8; background: rgba(148, 163, 184, 0.12); }

/* ─── Tables ─── */
.wh-table-wrap { background: var(--wh-surface); border: 1px solid var(--wh-border); border-radius: 14px; overflow: hidden; }

.wh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.wh-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wh-text-2);
    border-bottom: 1px solid var(--wh-border);
    background: var(--wh-surface-2);
    white-space: nowrap;
}

.wh-table tbody tr { transition: background 0.1s; cursor: pointer; }
.wh-table tbody tr:hover { background: rgba(253, 197, 42, 0.06); }

.wh-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--wh-border);
    vertical-align: middle;
}

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

.wh-mono { font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: 0.85em; }
.wh-num { font-variant-numeric: tabular-nums; }

/* ─── Buttons ─── */
.wh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
    background: transparent;
    font-family: inherit;
}

.wh-btn.primary {
    background: var(--wh-brand);
    color: var(--wh-dark);
    font-weight: 600;
    border-radius: 999px;
    padding: 0.55rem 1.4rem;
}
.wh-btn.primary:hover { background: var(--wh-brand-2); }

.wh-btn.ghost {
    background: transparent;
    color: var(--wh-text);
    border: 1px solid var(--wh-border);
    border-radius: 999px;
}
.wh-btn.ghost:hover { background: var(--wh-surface-2); border-color: var(--wh-brand); }

.wh-btn.danger {
    background: transparent;
    color: var(--wh-danger);
    border: 1px solid rgba(220, 53, 69, 0.3);
}
.wh-btn.danger:hover { background: rgba(220, 53, 69, 0.08); border-color: var(--wh-danger); }

.wh-btn.icon-only { padding: 0.55rem; }

/* ─── Inputs ─── */
.wh-input, select.wh-input, textarea.wh-input {
    background: var(--wh-surface-2);
    border: 1px solid var(--wh-border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    color: var(--wh-text);
    font-size: 0.88rem;
    width: 100%;
    transition: all 0.15s;
    font-family: inherit;
}
.wh-input:focus, select.wh-input:focus, textarea.wh-input:focus {
    outline: none;
    border-color: var(--wh-brand);
    box-shadow: 0 0 0 3px rgba(253, 197, 42, 0.20);
}

.wh-input-icon { position: relative; }
.wh-input-icon > i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wh-text-3);
    pointer-events: none;
}
.wh-input-icon .wh-input { padding-left: 2.5rem; }

.wh-field { margin-bottom: 1rem; }
.wh-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--wh-text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

/* ─── Login screen ─── */
.wh-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--wh-dark);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(253, 197, 42, 0.18), transparent 60%),
        radial-gradient(ellipse at 0% 100%, rgba(253, 197, 42, 0.08), transparent 50%);
}

.wh-login-card {
    background: #ffffff;
    border: 1px solid var(--wh-border);
    border-radius: 18px;
    padding: 2.5rem;
    width: 380px;
    max-width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    color: var(--wh-text);
}

.wh-login-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.75rem;
    flex-direction: column;
}

.wh-login-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    margin: 0;
    text-transform: uppercase;
    color: var(--wh-text);
}

.wh-login-sub {
    text-align: center;
    color: var(--wh-text-2);
    font-size: 0.88rem;
    margin-top: 0.2rem;
    margin-bottom: 2rem;
}

.wh-login-error {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--wh-danger);
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.wh-login-success {
    background: rgba(25, 135, 84, 0.08);
    border: 1px solid rgba(25, 135, 84, 0.3);
    color: var(--wh-success);
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.wh-login-info {
    color: var(--wh-text-2);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.wh-login-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--wh-brand-2);
    text-decoration: none;
    font-weight: 600;
}
.wh-login-link:hover { text-decoration: underline; }

.wh-login-back {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--wh-text-2);
    text-decoration: none;
}
.wh-login-back:hover { color: var(--wh-text); }

.wh-lang-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.25rem;
    z-index: 10;
}

.wh-lang-btn {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--wh-border);
    border-radius: 6px;
    background: var(--wh-surface);
    color: var(--wh-text-2);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.wh-lang-btn:hover { color: var(--wh-text); border-color: var(--wh-brand); }
.wh-lang-btn.active { background: var(--wh-brand); color: var(--wh-dark); border-color: var(--wh-brand); }

/* ─── SPA views ─── */
.wh-view { display: none; }
.wh-view.active { display: block; }

/* ─── Timeline (detail view) ─── */
.wh-timeline { position: relative; padding-left: 2rem; }
.wh-timeline::before {
    content: "";
    position: absolute;
    left: 11px; top: 10px; bottom: 10px;
    width: 2px;
    background: var(--wh-border);
}
.wh-timeline-item { position: relative; padding-bottom: 1.5rem; }
.wh-timeline-item::before {
    content: "";
    position: absolute;
    left: -1.5rem; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--wh-surface);
    border: 2px solid var(--wh-border);
}
.wh-timeline-item.done::before { background: var(--wh-success); border-color: var(--wh-success); }
.wh-timeline-item.current::before {
    background: var(--wh-brand);
    border-color: var(--wh-brand);
    box-shadow: 0 0 0 4px rgba(253, 197, 42, 0.25);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(253, 197, 42, 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(253, 197, 42, 0.10); }
}
.wh-timeline-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.15rem; }
.wh-timeline-meta { font-size: 0.78rem; color: var(--wh-text-2); }

/* ─── Route (sender → receiver) ─── */
.wh-route {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.wh-route-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--wh-brand);
    flex-shrink: 0;
}
.wh-route-arrow { color: var(--wh-text-3); }

/* ─── Toast ─── */
.wh-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    color: var(--wh-text);
    font-size: 0.88rem;
    box-shadow: 0 10px 30px rgba(32, 40, 48, 0.18);
    z-index: 1000;
    animation: wh-toast-in 0.25s ease-out;
}
.wh-toast.success { border-left: 3px solid var(--wh-success); }
.wh-toast.error { border-left: 3px solid var(--wh-danger); }
.wh-toast.info { border-left: 3px solid var(--wh-brand); }
@keyframes wh-toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ─── Modal ─── */
.wh-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(32, 40, 48, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.wh-modal-backdrop.open { display: flex; }

.wh-modal {
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 14px;
    padding: 1.5rem;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(32, 40, 48, 0.20);
}
.wh-modal.wide { max-width: 900px; }

.wh-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.wh-modal-title { font-size: 1.1rem; font-weight: 600; margin: 0; }

/* ─── Mobile ─── */
@media (max-width: 900px) {
    .wh-layout { grid-template-columns: 1fr; }
    .wh-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 240px;
        z-index: 100;
        transition: left 0.2s;
        box-shadow: 0 0 40px rgba(32, 40, 48, 0.25);
    }
    .wh-sidebar.open { left: 0; }
    .wh-main { padding: 1rem; padding-bottom: 70px; }
    .wh-mobile-only { display: flex !important; }
    .wh-desktop-only { display: none !important; }
    .wh-table-wrap .wh-table { display: none; }
    .wh-cards-wrap { display: grid; gap: 0.75rem; padding: 0.75rem; }
    .wh-backdrop {
        position: fixed; inset: 0;
        background: rgba(32, 40, 48, 0.55);
        display: none;
        z-index: 99;
    }
    .wh-backdrop.open { display: block; }
}
@media (min-width: 901px) {
    .wh-cards-wrap { display: none; }
    .wh-mobile-only { display: none !important; }
    .wh-backdrop { display: none !important; }
}

/* ─── Mobile card (alternative to table) ─── */
.wh-order-card {
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}
.wh-order-card:hover { border-color: var(--wh-brand); box-shadow: 0 4px 12px rgba(253, 197, 42, 0.10); }

.wh-order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.wh-order-card-no { font-weight: 700; font-size: 1rem; }

/* ─── Chart wrapper (fixed height, prevents infinite growth) ─── */
.wh-chart-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}
.wh-chart-wrap canvas { max-height: 280px !important; }

/* ─── Form grid (new order, CRUD dialogs) ─── */
.wh-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem 1rem;
}
.wh-form-grid .wh-field { margin-bottom: 0; }
.wh-form-grid .wh-col-full { grid-column: 1 / -1; }
.wh-form-grid .wh-col-full-sm { grid-column: span 3; }
.wh-form-grid .wh-col-2 { grid-column: span 2; }
@media (max-width: 900px) {
    .wh-form-grid { grid-template-columns: 1fr 1fr; }
    .wh-form-grid .wh-col-full-sm { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .wh-form-grid { grid-template-columns: 1fr; }
    .wh-form-grid .wh-col-full-sm { grid-column: 1 / -1; }
}

/* ─── Autocomplete ─── */
.wh-autocomplete { position: relative; }
.wh-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 20;
    margin-top: 0.25rem;
    box-shadow: 0 10px 30px rgba(32, 40, 48, 0.18);
}
.wh-autocomplete-item {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--wh-border);
    font-size: 0.88rem;
}
.wh-autocomplete-item:last-child { border-bottom: none; }
.wh-autocomplete-item:hover, .wh-autocomplete-item.selected { background: var(--wh-surface-2); color: var(--wh-accent); }
.wh-autocomplete-item .meta { font-size: 0.75rem; color: var(--wh-text-2); margin-top: 0.1rem; }

/* ─── Position cards ─── */
.wh-pos-card {
    background: var(--wh-bg-2);
    border: 1px solid var(--wh-border);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    position: relative;
}
.wh-pos-card .wh-form-grid { grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
@media (max-width: 900px) { .wh-pos-card .wh-form-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .wh-pos-card .wh-form-grid { grid-template-columns: repeat(2, 1fr); } }
.wh-pos-remove {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: transparent;
    border: none;
    color: var(--wh-danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
}

/* ─── Detail view (iter 3) ─── */
.wh-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 1.25rem;
}
@media (max-width: 1100px) { .wh-detail-grid { grid-template-columns: 1fr; } }

.wh-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--wh-text-2);
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    cursor: pointer;
}
.wh-detail-back:hover { color: var(--wh-accent); }

.wh-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.wh-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--wh-accent);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

.wh-detail-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--wh-border);
    font-size: 0.88rem;
}
.wh-detail-meta-row:last-child { border-bottom: none; }
.wh-detail-meta-row .lbl { color: var(--wh-text-2); font-weight: 500; }
.wh-detail-meta-row .val { text-align: right; color: var(--wh-text); font-weight: 500; max-width: 60%; word-break: break-word; }

.wh-detail-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wh-text-2);
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
}

/* Tabs */
.wh-tabs {
    display: flex;
    gap: 0.15rem;
    border-bottom: 1px solid var(--wh-border);
    margin-bottom: 1rem;
    overflow-x: auto;
}
.wh-tab {
    padding: 0.65rem 1rem;
    background: transparent;
    border: none;
    color: var(--wh-text-2);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    position: relative;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.wh-tab:hover { color: var(--wh-text); }
.wh-tab.active { color: var(--wh-accent); border-bottom-color: var(--wh-accent); }
.wh-tab .badge { font-size: 0.7rem; padding: 0.05rem 0.35rem; border-radius: 999px; background: var(--wh-surface-2); color: var(--wh-text-2); }
.wh-tab.active .badge { background: rgba(253, 197, 42, 0.25); color: var(--wh-accent); }

.wh-tab-panel { display: none; }
.wh-tab-panel.active { display: block; }

/* QR */
.wh-qr-box {
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    display: inline-block;
}
.wh-qr-box img { display: block; width: 140px; height: 140px; }

/* Chat */
.wh-chat {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--wh-bg-2);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}
.wh-chat-msg {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.85rem;
    max-width: 85%;
}
.wh-chat-msg.self { margin-left: auto; align-items: flex-end; }
.wh-chat-msg .bubble {
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    font-size: 0.88rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.wh-chat-msg.role-admin .bubble { border-left: 3px solid var(--wh-danger); }
.wh-chat-msg.role-klient .bubble { border-left: 3px solid var(--wh-accent); }
.wh-chat-msg.role-przewoznik .bubble { border-left: 3px solid var(--wh-success); }
.wh-chat-msg .meta { font-size: 0.72rem; color: var(--wh-text-3); }

.wh-chat-input {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
.wh-chat-input textarea { resize: vertical; min-height: 44px; max-height: 200px; }

/* Documents */
.wh-doc-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--wh-bg-2);
    border: 1px solid var(--wh-border);
    border-radius: 8px;
    margin-bottom: 0.4rem;
}
.wh-doc-item i.bi-file-earmark { font-size: 1.3rem; color: var(--wh-accent); }
.wh-doc-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.wh-doc-item .size { font-size: 0.75rem; color: var(--wh-text-2); }

/* Actions row */
.wh-actions-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ─── Toggle (switchy w filtrach) ─── */
.wh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--wh-surface-2);
    border: 1px solid var(--wh-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--wh-text-2);
    user-select: none;
    transition: all 0.15s;
}
.wh-toggle input { margin: 0; accent-color: var(--wh-accent); cursor: pointer; }
.wh-toggle:hover { border-color: var(--wh-accent); color: var(--wh-text); }
.wh-toggle:has(input:checked) {
    background: rgba(253, 197, 42, 0.18);
    color: var(--wh-accent);
    border-color: var(--wh-accent);
}

/* ─── Filter bar ─── */
.wh-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    background: var(--wh-surface);
    border: 1px solid var(--wh-border);
    border-radius: 12px;
    padding: 0.75rem;
}
.wh-filters .wh-input { padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.85rem; }
.wh-filters .wh-input-icon .wh-input { padding-left: 2.3rem; }

/* ─── Inline editable cells ─── */
.wh-inline-input {
    background: transparent;
    border: 1px dashed transparent;
    color: inherit;
    font: inherit;
    padding: 0.25rem 0.4rem;
    border-radius: 5px;
    width: 90px;
    transition: all 0.15s;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
}
.wh-inline-input:hover { border-color: var(--wh-border); background: var(--wh-surface-2); }
.wh-inline-input:focus {
    outline: none;
    border: 1px solid var(--wh-accent);
    background: var(--wh-surface-2);
    box-shadow: 0 0 0 3px rgba(253, 197, 42, 0.20);
}
.wh-inline-input.saved {
    animation: wh-flash-saved 0.8s ease-out;
}
@keyframes wh-flash-saved {
    0% { background: rgba(25, 135, 84, 0.25); }
    100% { background: transparent; }
}

/* ─── Date cell (Abgeholt/Angeliefert) ─── */
.wh-date-cell {
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 5px;
    color: var(--wh-text-2);
    font-size: 0.85em;
    display: inline-block;
    min-width: 80px;
    transition: all 0.15s;
}
.wh-date-cell:hover { background: var(--wh-surface-2); color: var(--wh-text); }
.wh-date-cell.set { color: var(--wh-success); font-weight: 600; }
.wh-date-cell.set::before { content: "✓ "; }

/* ─── Notes badge ─── */
.wh-notes-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--wh-text-2);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    font-size: 1rem;
}
.wh-notes-btn:hover { color: var(--wh-accent); background: var(--wh-surface-2); }
.wh-notes-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--wh-danger);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0 5px;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--wh-surface);
}

/* ─── Utility ─── */
.wh-spacer { flex: 1; }
.wh-hidden { display: none !important; }
.wh-muted { color: var(--wh-text-2); }
.wh-small { font-size: 0.85em; }
