/* ── Driver App — Mobile-first dark theme ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #111;
    --surface:  #1e1e1e;
    --card:     #252525;
    --border:   #333;
    --accent:   #f0a000;
    --green:    #22cc55;
    --red:      #e05050;
    --blue:     #38a8d8;
    --text:     #e0e0e0;
    --muted:    #888;
    --radius:   10px;
    --font:     'Segoe UI', Arial, sans-serif;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* ── Layout ───────────────────────────────────────────────────────── */
.d-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.d-header {
    background: #1a1a1a;
    border-bottom: 2px solid var(--accent);
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.d-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.d-header-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

.d-body {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

/* ── Login screen ─────────────────────────────────────────────────── */
.d-login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.d-login-logo {
    font-size: 42px;
    margin-bottom: 8px;
}

.d-login-appname {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.d-login-tagline {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 32px;
}

.d-login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.d-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.d-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.d-input {
    background: #2a2a2a;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 16px;
    font-family: var(--font);
    outline: none;
    -webkit-appearance: none;
}
.d-input:focus { border-color: var(--accent); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.d-btn {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 13px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: opacity .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.d-btn:active { transform: scale(.97); opacity: .85; }

.d-btn--primary { background: var(--accent); color: #111; }
.d-btn--green   { background: var(--green);  color: #111; }
.d-btn--blue    { background: var(--blue);   color: #111; }
.d-btn--red     { background: var(--red);    color: #fff; }
.d-btn--ghost   { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.d-btn--sm      { padding: 8px 14px; font-size: 13px; border-radius: 6px; }

/* ── Cards ────────────────────────────────────────────────────────── */
.d-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.d-card-header {
    background: #2e2e2e;
    border-bottom: 1px solid var(--border);
    padding: 7px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.d-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.d-card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Info rows ────────────────────────────────────────────────────── */
.d-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.d-row-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.d-row-value {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.d-row-value--big {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

/* ── Status badge ─────────────────────────────────────────────────── */
.d-status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.d-status--available    { background: #1a3a1a; color: var(--green); }
.d-status--at-pickup    { background: #3a2a00; color: #f0a000; }
.d-status--in-transit   { background: #0a2a3a; color: var(--blue); }
.d-status--at-delivery  { background: #3a1a00; color: #ff8800; }
.d-status--delivered    { background: #1a2a3a; color: #88bbdd; }
.d-status--assigned     { background: #2a2a1a; color: #cccc44; }

/* ── Status action buttons ────────────────────────────────────────── */
.d-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.d-status-btn {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: opacity .15s, transform .1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.d-status-btn:active   { transform: scale(.96); opacity: .8; }
.d-status-btn--active  { border-color: var(--accent) !important; opacity: .45; cursor: default; pointer-events: none; }

.d-status-btn .d-btn-icon { font-size: 20px; }
.d-status-btn .d-btn-label { font-size: 11px; }

.d-status-btn--at-pickup   { background: #2a1e00; color: #f0a000; border-color: #3a2a00; }
.d-status-btn--in-transit  { background: #001e30; color: var(--blue); border-color: #003050; }
.d-status-btn--at-delivery { background: #2a1000; color: #ff8800; border-color: #3a1800; }
.d-status-btn--delivered   { background: #001a10; color: var(--green); border-color: #003020; }
.d-status-btn--warehouse   { background: #150028; color: #cc88ff; border-color: #3a0066; }

/* ── No loads ─────────────────────────────────────────────────────── */
.d-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
    font-size: 14px;
}
.d-empty-icon { font-size: 36px; margin-bottom: 8px; }

/* ── Divider ──────────────────────────────────────────────────────── */
.d-divider {
    border: none;
    border-top: 1px solid var(--border);
}

/* ── Alert / toast ────────────────────────────────────────────────── */
.d-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: none;
}
.d-alert--error   { background: #2a0a0a; color: var(--red);   border: 1px solid #6a2020; }
.d-alert--success { background: #0a2a14; color: var(--green); border: 1px solid #1a5030; }

/* ── Load list item ───────────────────────────────────────────────── */
.d-load-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background .12s;
}
.d-load-item:active { background: #2e2e2e; }

.d-load-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.d-load-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.d-load-route {
    font-size: 12px;
    color: var(--muted);
}

/* ── Logout link ──────────────────────────────────────────────────── */
.d-logout-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    font-family: var(--font);
}
