/* ── Base ─────────────────────────────────────────────────── */
:root {
    --brand: #e85d26;
    --brand-dark: #c44a1a;
    --brand-light: #fff5f0;
    --surface: #ffffff;
    --surface-alt: #f8f9fa;
    --border: #e9ecef;
    --text: #212529;
    --text-muted: #6c757d;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,.08);
}

body {
    background: var(--surface-alt);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
}

/* ── Top navbar ───────────────────────────────────────────── */
.portal-topbar {
    background: var(--brand);
    padding: .75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(232,93,38,.3);
}

.portal-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.portal-brand:hover { color: rgba(255,255,255,.85); }

.portal-user {
    color: rgba(255,255,255,.9);
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── Nav tabs ─────────────────────────────────────────────── */
.portal-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
}

.portal-nav .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: .75rem 1rem;
    border-bottom: 3px solid transparent;
    border-radius: 0;
}

.portal-nav .nav-link:hover { color: var(--brand); }
.portal-nav .nav-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* ── Cards ────────────────────────────────────────────────── */
.portal-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.portal-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}

/* ── Order status stepper ────────────────────────────────── */
.order-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1rem 0;
    overflow-x: auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 60px;
    position: relative;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 2px solid var(--border);
    transition: all .3s;
    z-index: 1;
}

.step.done .step-dot {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.step.active .step-dot {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(232,93,38,.2);
    transform: scale(1.1);
}

.step-label {
    font-size: .7rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: .35rem;
    white-space: nowrap;
}

.step.done .step-label, .step.active .step-label { color: var(--text); font-weight: 600; }

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-top: -16px;
    margin-bottom: 28px;
    transition: background .3s;
}

.step-line.filled { background: #28a745; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-brand {
    background: var(--brand);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: .6rem 1.5rem;
    font-weight: 600;
    transition: background .2s, transform .1s, box-shadow .2s;
}

.btn-brand:hover {
    background: var(--brand-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232,93,38,.35);
}

.btn-brand:active { transform: translateY(0); }

/* ── Form ─────────────────────────────────────────────────── */
.form-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--border);
    padding: .6rem .9rem;
    font-size: .95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232,93,38,.15);
}

/* ── Badges ───────────────────────────────────────────────── */
.status-pending    { background: #fff3cd; color: #856404; }
.status-production { background: #cfe2ff; color: #084298; }
.status-ready      { background: #d1e7dd; color: #0f5132; }
.status-delivered  { background: #e2e3e5; color: #41464b; }
.status-cancelled  { background: #f8d7da; color: #842029; }

/* ── Product item ─────────────────────────────────────────── */
.product-item {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: .75rem 1rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    user-select: none;
}

.product-item:hover { border-color: var(--brand); background: var(--brand-light); }
.product-item.selected { border-color: var(--brand); background: var(--brand-light); }

/* ── Auth card ────────────────────────────────────────────── */
.auth-card {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
    border: none;
    max-width: 440px;
    margin: 0 auto;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand);
}

/* ── Refresh badge ────────────────────────────────────────── */
.refresh-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .25rem .75rem;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i { font-size: 3rem; opacity: .2; display: block; margin-bottom: 1rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 576px) {
    .portal-topbar { padding: .6rem .75rem; }
    .step-label { font-size: .65rem; }
}
