/* ===== Driver App — mobile-first ===== */
.driver-app-body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg-primary, #f1f5f9);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.driver-app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #002137 0%, #0a3a5c 100%);
    color: #fff;
    padding: calc(10px + env(safe-area-inset-top, 0)) 14px 10px;
    box-shadow: 0 2px 12px rgba(0, 33, 55, 0.25);
}

.driver-app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
}

.driver-app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.driver-app-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px;
    flex-shrink: 0;
}

.driver-app-title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.driver-app-sub {
    font-size: 0.78rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.driver-app-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.driver-notif-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.driver-notif-badge[hidden] {
    display: none !important;
}

.driver-app-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 14px calc(88px + env(safe-area-inset-bottom, 0));
    min-height: calc(100dvh - 64px);
}

.driver-app-loading {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.driver-app-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid rgba(0, 33, 55, 0.12);
    border-top-color: var(--accent, #f47920);
    border-radius: 50%;
    animation: driverSpin 0.8s linear infinite;
}

@keyframes driverSpin {
    to { transform: rotate(360deg); }
}

.driver-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--border, #e2e8f0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.driver-nav-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 2px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.driver-nav-btn[hidden] {
    display: none !important;
}

.driver-nav-btn.active {
    color: var(--accent, #f47920);
}

.driver-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.driver-welcome {
    background: linear-gradient(135deg, #002137, #0d4a6e);
    color: #fff;
    border-radius: 16px;
    padding: 18px 16px;
    margin-bottom: 14px;
}

.driver-welcome h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
}

.driver-welcome .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.82rem;
    opacity: 0.9;
}

.driver-alert-strip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.driver-alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.driver-alert.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

.driver-alert.warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #b45309;
}

.driver-alert.info {
    background: rgba(13, 110, 253, 0.08);
    border-color: rgba(13, 110, 253, 0.2);
    color: #1d4ed8;
}

.driver-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.driver-stat {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 12px;
}

.driver-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.driver-stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
}

.driver-stat-value.danger { color: #dc2626; }
.driver-stat-value.success { color: #16a34a; }

.driver-card {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
}

.driver-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.driver-card-head h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.driver-card-body {
    padding: 12px 14px;
}

.driver-kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.88rem;
}

.driver-kv:last-child { border-bottom: none; }

.driver-kv span:first-child {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.driver-kv strong {
    text-align: left;
    direction: ltr;
}

.driver-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.driver-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
}

.driver-quick-btn span:first-child {
    font-size: 1.4rem;
}

.driver-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.driver-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.driver-table-wrap th,
.driver-table-wrap td {
    padding: 8px 6px;
    text-align: right;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.driver-table-wrap th {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
}

.driver-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.driver-app-body .modal {
    max-width: calc(100vw - 24px);
    margin: 12px auto;
}

@media (min-width: 641px) {
    .driver-bottom-nav {
        max-width: 640px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
    }
}
