:root {
    /* Primary colors */
    --primary: #0a5c7e;
    --primary-light: #1a7a9e;
    --primary-dark: #06405a;
    --primary-gradient: linear-gradient(135deg, #0a5c7e 0%, #1a7a9e 100%);
    
    /* Accent colors */
    --accent: #2ecc71;
    --accent-dark: #27ae60;
    --accent-gradient: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    
    /* Status colors */
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    
    /* Neutral colors */
    --ink: #1a2634;
    --ink-light: #2c3e50;
    --muted: #7f8c8d;
    --muted-light: #bdc3c7;
    --line: #ecf0f1;
    --line-dark: #d5dbdb;
    --panel: #ffffff;
    --panel-hover: #f8f9fa;
    --page: #f0f3f7;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 4px 20px rgba(10, 92, 126, 0.12);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Spacing */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100vh;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--line);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== LOGIN VIEW ===== */
.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.login-view::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.login-view::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    width: min(100%, 400px);
    padding: 40px 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--primary-gradient);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(10, 92, 126, 0.3);
}

.login-card h1 {
    margin: 0 0 4px;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.5px;
}

.login-card p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.login-card label {
    display: grid;
    gap: 6px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--ink-light);
    margin-bottom: 16px;
}

.login-card label:last-of-type {
    margin-bottom: 24px;
}

.login-card input {
    width: 100%;
    min-height: 48px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-size: var(--font-size-base);
    color: var(--ink);
    background: #fff;
    transition: var(--transition);
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 92, 126, 0.1);
}

.login-card .primary {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.login-card .primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 92, 126, 0.3);
}

.login-card .primary:active {
    transform: translateY(0);
}

.login-card .primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-error {
    min-height: 20px;
    margin-top: 12px;
    color: var(--danger) !important;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

/* ===== APP VIEW ===== */
.app-view {
    min-height: 100vh;
    background: var(--page);
}

/* ===== HEADER ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-brand div {
    display: grid;
    gap: 0;
}

.header-brand strong {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.3px;
}

.header-brand small {
    font-size: var(--font-size-xs);
    color: var(--muted);
    font-weight: 500;
}

.icon-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-light);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
}

.icon-button:hover {
    background: var(--panel-hover);
    color: var(--danger);
}

/* ===== WELCOME ===== */
.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    max-width: 760px;
    margin: 0 auto;
}

.welcome small {
    color: var(--muted);
    font-weight: 500;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.welcome h1 {
    margin: 2px 0 0;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.5px;
}

.online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #d4edda;
    color: var(--success);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== INSTALL CARDS ===== */
.install-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 760px;
    margin: 0 auto 8px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: var(--shadow-card);
}

.install-card strong {
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.install-card p {
    margin: 2px 0 0;
    font-size: var(--font-size-sm);
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.4;
}

.install-card .secondary {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.install-card .secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.install-card[hidden] {
    display: none !important;
}

/* ===== TABS ===== */
.tabs {
    position: sticky;
    top: 64px;
    z-index: 15;
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
    background: var(--page);
}

.tabs button {
    min-height: 48px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tabs button:hover {
    color: var(--ink-light);
}

.tabs button.active {
    border-color: var(--primary);
    color: var(--primary);
}

.tabs span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--line);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--muted);
}

.tabs button.active span {
    background: rgba(10, 92, 126, 0.1);
    color: var(--primary);
}

/* ===== CONTENT ===== */
.content {
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 20px 32px;
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== LOAD CARDS ===== */
.card-list {
    display: grid;
    gap: 16px;
}

.load-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.load-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.load-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-hover);
}

.load-head h2 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.3px;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-assigned {
    background: #fff3cd;
    color: #856404;
}

.status-accepted {
    background: #cce5ff;
    color: #004085;
}

.status-picked_up {
    background: #d4edda;
    color: #155724;
}

.status-delivered {
    background: #d1ecf1;
    color: #0c5460;
}

.route {
    display: grid;
    gap: 14px;
    padding: 16px 20px;
}

.route-stop {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 12px;
}

.route-dot {
    width: 12px;
    height: 12px;
    margin-top: 3px;
    border: 2.5px solid var(--primary);
    border-radius: 50%;
    background: #fff;
    position: relative;
}

.route-stop:last-child .route-dot {
    background: var(--primary);
}

.route-stop:not(:last-child) .route-dot::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 24px;
    background: var(--line-dark);
}

.route-stop small {
    display: block;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.5px;
}

.route-stop strong {
    display: block;
    margin-top: 2px;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--ink);
}

.route-stop time {
    color: var(--muted);
    font-size: var(--font-size-sm);
}

/* ===== LOAD ACTIONS ===== */
.load-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    padding: 0 20px 16px;
}

.action-button {
    min-height: 40px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-weight: 700;
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.action-button:not(:disabled):hover {
    transform: translateY(-1px);
}

.action-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-button-accept {
    background: var(--accent-gradient);
    color: #fff;
    border-color: var(--accent);
}

.action-button-accept:not(:disabled):hover {
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.action-button-pickup {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
}

.action-button-pickup:not(:disabled):hover {
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.action-button-deliver {
    background: var(--primary-gradient);
    color: #fff;
    border-color: var(--primary);
}

.action-button-deliver:not(:disabled):hover {
    box-shadow: 0 4px 15px rgba(10, 92, 126, 0.4);
}

.action-button-view {
    background: var(--panel-hover);
    color: var(--ink-light);
    border-color: var(--line);
}

.action-button-view:hover {
    background: var(--line);
}

.action-button-location {
    background: #eef6ff;
    color: var(--primary);
    border-color: #b8d8f0;
}

.action-button-location:not(:disabled):hover {
    background: #dff0ff;
    box-shadow: 0 4px 15px rgba(10, 92, 126, 0.18);
}

/* ===== NOTIFICATIONS ===== */
.notification-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.notification-toolbar h2 { margin: 0; font-size: var(--font-size-lg); }

.notification-delete-all,
.notification-delete {
    border: 0;
    background: transparent;
    color: #c6283e;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.notification-delete-all { padding: 8px; }
.notification-delete-all:hover { text-decoration: underline; }

.notification-item {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.notification-open {
    display: grid;
    flex: 1;
    gap: 4px;
    min-width: 0;
    padding: 16px 12px 16px 20px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.notification-delete {
    align-self: center;
    width: 44px;
    height: 44px;
    font-size: 24px;
}

.notification-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.notification-item.unread {
    border-left: 4px solid var(--primary);
    background: #f8fbff;
}

.notification-item h3 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--ink);
}

.notification-item p {
    margin: 0;
    color: var(--ink-light);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.notification-item time {
    color: var(--muted);
    font-size: var(--font-size-xs);
    margin-top: 4px;
}

.notification-confirm-layer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 12, 25, 0.58);
}

.notification-confirm {
    width: min(100%, 420px);
    overflow: hidden;
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.notification-confirm header,
.notification-confirm footer { display: flex; align-items: center; padding: 16px 20px; }
.notification-confirm header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.notification-confirm header h2 { margin: 0; font-size: var(--font-size-lg); }
.notification-confirm header button { border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.notification-confirm p { margin: 0; padding: 20px; color: var(--ink-light); }
.notification-confirm footer { justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.notification-confirm footer button { min-width: 88px; padding: 10px 16px; border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; }
.notification-confirm footer .danger { background: #d72645; color: white; }

/* ===== DETAIL VIEW ===== */
.detail-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.detail-card h2 {
    margin: 0 0 4px;
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.detail-grid div {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--panel-hover);
}

.detail-grid small {
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stops {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.stop-card {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-hover);
}

.stop-card h3 {
    margin: 0 0 6px;
    font-size: var(--font-size-base);
    font-weight: 600;
}

.stop-card p {
    margin: 2px 0;
    color: var(--ink-light);
    font-size: var(--font-size-sm);
}

.location-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid #b8d8f0;
    border-radius: var(--radius-sm);
    background: #f4faff;
}

.location-card small {
    display: block;
    color: var(--muted);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-card strong {
    display: block;
    margin-top: 3px;
    color: var(--ink);
}

.location-card p {
    margin: 3px 0 0;
    color: var(--ink-light);
    font-size: var(--font-size-sm);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
}

.back-button:hover {
    color: var(--primary);
    background: var(--panel-hover);
}

.back-button::before {
    content: '←';
    font-size: var(--font-size-lg);
}

/* ===== EMPTY STATE ===== */
.empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.empty strong {
    display: block;
    font-size: var(--font-size-lg);
    color: var(--ink-light);
    margin-bottom: 4px;
}

.empty p {
    margin: 0;
    font-size: var(--font-size-sm);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 50;
    max-width: 480px;
    width: calc(100% - 32px);
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-weight: 500;
    font-size: var(--font-size-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 20px;
    }
    
    .welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .welcome h1 {
        font-size: var(--font-size-xl);
    }
    
    .load-actions {
        grid-template-columns: 1fr 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .app-header {
        padding: 8px 16px;
    }
    
    .content {
        padding: 12px 16px 32px;
    }
    
    .install-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
    
    .install-card .secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .load-actions {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== PWA ===== */
@media (display-mode: standalone) {
    #installCard,
    #iosInstallCard {
        display: none !important;
    }
}

/* ===== PRODUCTION DRIVER EXPERIENCE ===== */
.welcome {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.driver-avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 800;
    box-shadow: var(--shadow-card);
}

.welcome p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: var(--font-size-sm);
}

.online.offline {
    background: #f8d7da;
    color: #721c24;
}

.online.offline::before {
    background: #721c24;
    animation: none;
}

.load-card {
    cursor: pointer;
}

.load-card:focus-visible {
    outline: 3px solid rgba(10, 92, 126, 0.22);
    outline-offset: 2px;
}

.load-head small {
    display: block;
    color: var(--muted);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status {
    min-height: 30px;
    padding: 6px 12px;
}

.route-stop p {
    margin: 2px 0 0;
    color: var(--ink-light);
    font-size: var(--font-size-sm);
    line-height: 1.35;
}

.load-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 20px 14px;
}

.load-facts div,
.driver-note,
.document-list li {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-hover);
}

.load-facts div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 10px;
}

.load-facts small,
.driver-note small,
.detail-hero small {
    color: var(--muted);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-facts span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font-weight: 600;
}

.driver-note {
    margin: 0 20px 14px;
    padding: 10px 12px;
}

.driver-note p {
    margin: 3px 0 0;
    color: var(--ink-light);
    font-size: var(--font-size-sm);
    line-height: 1.45;
}

.load-actions {
    grid-template-columns: 1fr;
}

.action-button {
    min-height: 52px;
    border-radius: 10px;
    font-size: var(--font-size-sm);
}

.completed-state {
    padding: 0 20px 16px;
}

.detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-hero h2 {
    margin: 2px 0 0;
}

.shipment-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.shipment-timeline span {
    min-height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-hover);
    color: var(--muted);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-align: center;
}

.shipment-timeline span.active,
.shipment-timeline span.done {
    border-color: rgba(46, 204, 113, 0.35);
    background: #eafaf1;
    color: var(--success);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.quick-actions a,
.quick-actions button,
.quick-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.quick-actions button:disabled {
    color: var(--muted);
    background: var(--panel-hover);
}

.quick-link {
    min-height: 36px;
    margin-top: 8px;
}

.document-list {
    display: grid;
    gap: 8px;
    margin: 8px 0 16px;
    padding: 0;
    list-style: none;
}

.document-list li {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
}

.document-list span {
    color: var(--ink);
    font-weight: 700;
}

.document-list small {
    color: var(--muted);
}

.upload-card {
    display: grid;
    gap: 12px;
    margin: 12px 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-hover);
}

.upload-card label {
    display: grid;
    gap: 6px;
    color: var(--ink-light);
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.upload-card select,
.upload-card input[type="file"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font: inherit;
    padding: 10px;
}

.driver-upload-source {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.driver-upload-source label {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.driver-upload-source input[type="file"] {
    min-height: 44px;
    padding: 8px;
}

.upload-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.upload-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-gradient);
    transition: width 0.2s ease;
}

@media (max-width: 560px) {
    .welcome {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .welcome .online {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .load-facts,
    .detail-grid,
    .quick-actions,
    .driver-upload-source,
    .shipment-timeline {
        grid-template-columns: 1fr;
    }

    .load-head {
        align-items: flex-start;
    }
}

.icon-button span {
    display: none;
}

#installCard strong,
#iosInstallCard strong,
#notificationCard strong {
    font-size: 0;
}

#installCard strong::after,
#iosInstallCard strong::after,
#notificationCard strong::after {
    font-size: var(--font-size-sm);
}

#installCard strong::after {
    content: "Install Voci Inc Driver";
}

#iosInstallCard strong::after {
    content: "Add to Home Screen";
}

#notificationCard strong::after {
    content: "Turn on notifications";
}

.tabs button {
    font-size: 0;
}

.tabs button::before {
    font-size: var(--font-size-sm);
}

.tabs button[data-tab="loads"]::before {
    content: "Loads";
}

.tabs button[data-tab="notifications"]::before {
    content: "Notifications";
}

.tabs button span {
    font-size: var(--font-size-xs);
}
.brand-mark img,
.header-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


/* ===== MODERN DRIVER LOGIN OVERRIDE ===== */
/* Login only — the rest of the Driver Portal keeps its existing styles. */

#loginView.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 82%, rgba(31, 123, 255, 0.24), transparent 31%),
        radial-gradient(circle at 88% 18%, rgba(32, 208, 112, 0.20), transparent 31%),
        linear-gradient(135deg, #03101f 0%, #07172b 45%, #05111f 100%) !important;
}

/* Subtle brand watermark on the right */
#loginView.login-view::before {
    content: "";
    position: absolute;
    z-index: -2;
    top: 50%;
    right: -130px;
    width: min(720px, 60vw);
    aspect-ratio: 1;
    transform: translateY(-50%);
    background: url("../icons/icon-512.png") center / contain no-repeat;
    opacity: 0.055;
    pointer-events: none;
}

/* Decorative green/teal glow */
#loginView.login-view::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -8%;
    bottom: -28%;
    width: min(820px, 70vw);
    height: min(520px, 52vw);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(28, 221, 119, 0.22), transparent 52%),
        repeating-radial-gradient(circle at 70% 45%, rgba(36, 232, 130, 0.30) 0 1px, transparent 1.6px 13px);
    opacity: 0.38;
    transform: rotate(-8deg);
    pointer-events: none;
}

#loginView .login-card {
    position: relative;
    z-index: 1;
    width: min(500px, calc(100vw - 32px));
    display: grid;
    gap: 15px;
    padding: 38px 42px 32px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(15,29,53,0.88), rgba(5,15,30,0.92));
    color: #f7fbff;
    box-shadow:
        0 30px 90px rgba(0,0,0,0.46),
        0 0 0 1px rgba(255,255,255,0.025) inset,
        0 0 60px rgba(31,123,255,0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: driverLoginIn .45s ease-out both;
}

#loginView .login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(135deg,
            rgba(255,255,255,0.11),
            transparent 24%,
            transparent 72%,
            rgba(32,208,112,0.08));
}

@keyframes driverLoginIn {
    from { opacity: 0; transform: translateY(18px) scale(.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

#loginView .brand-mark {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 4px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    background: rgba(3, 11, 24, 0.48);
    box-shadow:
        0 12px 30px rgba(31,123,255,.16),
        inset 0 0 0 1px rgba(255,255,255,.05);
}

#loginView .brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

#loginView .login-card > div:nth-of-type(2) {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 10px;
}

#loginView .login-card h1 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 29px;
    line-height: 1.08;
    font-weight: 750;
    letter-spacing: -.35px;
}

#loginView .login-card p {
    margin: 0;
    color: rgba(224,233,245,.68);
    font-size: 13.5px;
    line-height: 1.5;
}

#loginView .login-card label {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    margin: 0;
    color: rgba(245,249,255,.90);
    font-size: 12.5px;
    font-weight: 650;
}

#loginView .login-card input {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid rgba(181,201,226,.26);
    border-radius: 13px;
    outline: 0;
    background: rgba(3,11,24,.48);
    color: #f8fbff;
    font-size: 14px;
    font-weight: 400;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.018);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#loginView .login-card input::placeholder {
    color: rgba(211,222,237,.38);
}

#loginView .login-card input:hover {
    border-color: rgba(181,201,226,.38);
}

#loginView .login-card input:focus {
    border-color: rgba(47,137,255,.78);
    background: rgba(3,11,24,.60);
    box-shadow:
        0 0 0 4px rgba(31,123,255,.12),
        inset 0 0 0 1px rgba(255,255,255,.025);
}

#loginView .login-card .primary {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 52px;
    margin-top: 3px;
    padding: 0 48px 0 18px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #24d676 0%, #12b963 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 750;
    line-height: 1;
    box-shadow: 0 15px 34px rgba(18,185,99,.22);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

#loginView .login-card .primary::after {
    content: "→";
    position: absolute;
    right: 11px;
    top: 50%;
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #12b963;
    font-size: 18px;
    font-weight: 800;
}

#loginView .login-card .primary:hover,
#loginView .login-card .primary:focus-visible {
    transform: translateY(-1px);
    filter: none;
    box-shadow: 0 20px 42px rgba(18,185,99,.28);
}

#loginView .form-error {
    position: relative;
    z-index: 1;
    min-height: 18px;
    margin: 0;
    color: #ff8d83 !important;
    font-size: 12px;
    font-weight: 650;
}

@media (max-width: 620px) {
    #loginView.login-view {
        padding: 16px;
    }

    #loginView.login-view::before {
        right: -210px;
        width: 620px;
        opacity: .035;
    }

    #loginView .login-card {
        width: min(100%, 460px);
        padding: 28px 22px 24px;
        border-radius: 20px;
    }

    #loginView .brand-mark {
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    #loginView .login-card h1 {
        font-size: 25px;
    }

    #loginView .login-card input {
        min-height: 48px;
    }
}
/* PWA update prompt; installation cards keep the existing Driver design. */
.pwa-update-notice {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 28px);
  padding: 13px 14px;
  border: 1px solid #b9dace;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .22);
  color: #142033;
}
.pwa-update-notice[hidden] { display: none !important; }
.pwa-update-notice span { display: grid; gap: 2px; }
.pwa-update-notice small { color: #5b6879; }
