/* ── DeliveryAction — Mobile-First Global Styles ────────────── */

:root {
    --da-bg: #0f172a;
    --da-surface: #1e293b;
    --da-surface-2: #334155;
    --da-text: #f1f5f9;
    --da-text-muted: #94a3b8;
    --da-primary: #3b82f6;
    --da-primary-hover: #2563eb;
    --da-success: #22c55e;
    --da-warning: #f59e0b;
    --da-danger: #ef4444;
    --da-navy: #1e3a5f;
    --nav-height: 72px;
    --header-height: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--da-bg);
    color: var(--da-text);
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.app-header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    padding: 0 12px;
    background: var(--da-surface);
    border-bottom: 1px solid var(--da-surface-2);
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-header-title {
    font-weight: 700;
    font-size: 1.15rem;
    flex: 1;
}
.app-header-user {
    color: var(--da-text-muted);
    font-size: 0.95rem;
    margin-right: 10px;
}
.btn-logout {
    background: var(--da-surface-2);
    border: none;
    color: var(--da-text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.app-main {
    flex: 1;
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 16px);
    overflow-y: auto;
}

/* ── Bottom Nav ─────────────────────────────────────────────── */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--da-surface);
    border-top: 1px solid var(--da-surface-2);
    display: flex;
    z-index: 100;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--da-text-muted);
    font-size: 0.8rem;
    gap: 3px;
    transition: color 0.15s;
}
.nav-item:hover, .nav-item.active {
    color: var(--da-primary);
}
.nav-icon { font-size: 1.6rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card-da {
    background: var(--da-surface);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-da {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.btn-da-primary { background: var(--da-primary); color: #fff; }
.btn-da-primary:hover { background: var(--da-primary-hover); }
.btn-da-secondary { background: var(--da-surface-2); color: var(--da-text); }
.btn-da-danger { background: var(--da-danger); color: #fff; }
.btn-da-block { width: 100%; }

/* ── Status badges ──────────────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
}
.status-pending { background: #64748b; }
.status-precheck { background: var(--da-primary); }
.status-out { background: var(--da-success); }
.status-returning { background: var(--da-warning); }
.status-complete { background: var(--da-navy); }

/* ── Progress bars ──────────────────────────────────────────── */
.progress-bar-da {
    height: 10px;
    background: var(--da-surface-2);
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar-da-fill {
    height: 100%;
    background: var(--da-primary);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* ── Forms ───────────────────────────────────────────────────── */
.input-da {
    width: 100%;
    padding: 14px 14px;
    background: var(--da-surface);
    border: 1px solid var(--da-surface-2);
    border-radius: 10px;
    color: var(--da-text);
    font-size: 1.05rem;
}
.input-da:focus {
    outline: none;
    border-color: var(--da-primary);
}
.input-da::placeholder { color: var(--da-text-muted); }

select.input-da {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.label-da {
    display: block;
    font-size: 0.85rem;
    color: var(--da-text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert-da {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}
.alert-da-success { background: rgba(34,197,94,0.15); color: var(--da-success); }
.alert-da-danger { background: rgba(239,68,68,0.15); color: var(--da-danger); }
.alert-da-info { background: rgba(59,130,246,0.15); color: var(--da-primary); }

/* ── Utilities ───────────────────────────────────────────────── */
.text-muted-da { color: var(--da-text-muted); }
.text-sm { font-size: 0.9rem; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* ── Blazor error UI ─────────────────────────────────────────── */
#blazor-error-ui {
    background: var(--da-danger);
    color: #fff;
    padding: 0.5rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}
#blazor-error-ui[style] { display: block; }

.blazor-error-boundary {
    background: var(--da-danger);
    padding: 1rem;
    color: white;
    border-radius: 8px;
}
.blazor-error-boundary::after { content: "An error has occurred."; }
