/* Driver PWA — Self-contained stylesheet (no external framework dependency) */

:root {
    --status-offline: #9e9e9e;
    --status-checked_in: #1976d2;
    --status-waiting: #f9a825;
    --status-reserved: #8e24aa;
    --status-assigned: #8e24aa;
    --status-collecting_order: #00acc1;
    --status-out_for_delivery: #fb8c00;
    --status-at_customer: #3949ab;
    --status-delivered: #43a047;
    --status-returning: #00897b;
    --status-on_break: #c0ca33;
    --status-available_again: #26a69a;
    --status-suspended: #e53935;

    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #1c2733;
    --text-muted: #6b7785;
    --primary: #1976d2;
    --primary-dark: #0d47a1;
    --danger: #e53935;
    --success: #43a047;
    --border: #e3e8ee;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(20, 30, 48, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
}

body[dir="rtl"] { direction: rtl; text-align: right; }

.driver-body { min-height: 100vh; padding-bottom: 76px; }

/* ── Auth pages ─────────────────────────────────────────────────────── */
.driver-auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(160deg, #0d47a1 0%, #1976d2 55%, #26a69a 100%);
}

.driver-login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    padding: 32px 26px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.driver-login-logo { font-size: 48px; margin-bottom: 8px; }
.driver-login-card h1 { font-size: 20px; margin: 0 0 20px; color: var(--primary-dark); }

.driver-field { text-align: left; margin-bottom: 16px; }
body[dir="rtl"] .driver-field { text-align: right; }
.driver-field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.driver-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: #fafcff;
}
.driver-field input:focus { outline: none; border-color: var(--primary); background: #fff; }

.driver-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: start;
}
.driver-alert-error { background: #ffebee; color: var(--danger); border: 1px solid #ffcdd2; }
.driver-alert-success { background: #e8f5e9; color: var(--success); border: 1px solid #a5d6a7; }

.driver-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.driver-btn:active { transform: scale(0.98); }
.driver-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.driver-btn-block { width: 100%; }
.driver-btn-primary { background: var(--primary); color: #fff; }
.driver-btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.driver-btn-danger { background: var(--danger); color: #fff; }
.driver-btn-success { background: var(--success); color: #fff; }
.driver-btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.driver-btn-sm { padding: 9px 14px; font-size: 13px; }

.driver-lang-switcher { margin-top: 20px; display: flex; justify-content: center; gap: 10px; }
.driver-lang-switcher a {
    font-size: 12px; padding: 4px 10px; border-radius: 8px; color: var(--text-muted);
    text-decoration: none; border: 1px solid var(--border);
}
.driver-lang-switcher a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── App shell / top bar ────────────────────────────────────────────── */
.driver-topbar {
    background: var(--card-bg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}
.driver-topbar .driver-brand { font-weight: 700; color: var(--primary-dark); font-size: 16px; }
.driver-topbar .driver-conn { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.driver-conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.driver-conn-dot.offline { background: var(--danger); }

/* ── Bottom navigation ──────────────────────────────────────────────── */
.driver-bottomnav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.07);
    z-index: 20;
}
.driver-bottomnav a {
    flex: 1;
    text-align: center;
    padding: 10px 4px 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
}
.driver-bottomnav a .icon { display: block; font-size: 20px; margin-bottom: 2px; }
.driver-bottomnav a.active { color: var(--primary); font-weight: 600; }

/* ── Content / cards ────────────────────────────────────────────────── */
.driver-content { padding: 16px; max-width: 560px; margin: 0 auto; }

.driver-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}
.driver-card h2 { margin: 0 0 12px; font-size: 15px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.driver-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.driver-stat {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.driver-stat .value { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.driver-stat .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Status chip (never color alone — icon + text) ──────────────────── */
.driver-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}
.driver-status-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.85); }

.status-offline { background: var(--status-offline); }
.status-checked_in { background: var(--status-checked_in); }
.status-waiting { background: var(--status-waiting); color: #3a2c00; }
.status-reserved, .status-assigned { background: var(--status-reserved); }
.status-collecting_order { background: var(--status-collecting_order); }
.status-out_for_delivery { background: var(--status-out_for_delivery); }
.status-at_customer { background: var(--status-at_customer); }
.status-delivered { background: var(--status-delivered); }
.status-returning { background: var(--status-returning); }
.status-on_break { background: var(--status-on_break); color: #3a3a00; }
.status-available_again { background: var(--status-available_again); }
.status-suspended { background: var(--status-suspended); }

.driver-action-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.driver-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.driver-info-row:last-child { border-bottom: none; }
.driver-info-row .label { color: var(--text-muted); }
.driver-info-row .value { font-weight: 600; text-align: end; }

.driver-empty-state { text-align: center; color: var(--text-muted); padding: 30px 10px; font-size: 14px; }

.driver-checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; font-size: 14px; }
.driver-checkbox-row input { margin-top: 3px; }

.driver-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.driver-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.driver-modal-backdrop.open { display: flex; }
.driver-modal {
    background: #fff; border-radius: 18px 18px 0 0; width: 100%; max-width: 480px;
    padding: 22px 20px 26px; box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
}
@media (min-width: 600px) {
    .driver-modal-backdrop { align-items: center; }
    .driver-modal { border-radius: 18px; }
}

.driver-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.driver-pagination a, .driver-pagination span {
    padding: 6px 12px; border-radius: 8px; text-decoration: none; font-size: 13px;
    border: 1px solid var(--border); color: var(--text);
}
.driver-pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

.driver-filter-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.driver-filter-tabs a {
    flex: 1; text-align: center; padding: 9px; border-radius: 10px; text-decoration: none;
    background: #eef2f7; color: var(--text-muted); font-size: 13px; font-weight: 600;
}
.driver-filter-tabs a.active { background: var(--primary); color: #fff; }

.driver-masked { letter-spacing: 1px; }
