:root {
    --primary: #004098;
    --primary-dark: #003070;
    --primary-light: #1a5cb8;
    --primary-soft: rgba(0, 64, 152, 0.06);
    --primary-border: rgba(0, 64, 152, 0.12);
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --surface: #ffffff;
    --bg: #f8fafc;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.08);
    --content-width: 720px;
    --page-width: 1080px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ── Brand name ── */
.brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary);
    flex-shrink: 0;
}

/* ── Top bar ── */
.topbar {
    width: 100%;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar--center {
    justify-content: center;
    padding: 28px 32px;
}

/* ── Page shell ── */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-footer {
    margin-top: auto;
    padding: 24px 32px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ── Auth (main) page ── */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 64px;
}

.auth-card {
    width: 100%;
    max-width: var(--content-width);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-card-header {
    padding: 48px 48px 0;
    text-align: center;
}

.auth-card-header .brand-name {
    font-size: 1.375rem;
    margin-bottom: 28px;
}

.auth-card-title {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 10px;
}

.auth-card-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 360px;
    margin: 0 auto;
}

.auth-card-body {
    padding: 36px 48px 48px;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

/* ── Form ── */
.form-group {
    margin-bottom: 18px;
}

.form-group:last-of-type {
    margin-bottom: 28px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: #cbd5e1;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 64, 152, 0.25);
}

.btn-ghost {
    height: 40px;
    padding: 0 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--primary);
    border-color: var(--primary-border);
    background: var(--primary-soft);
}

/* ── Alert ── */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Orders page ── */
.content-main {
    flex: 1;
    padding: 40px 24px 64px;
}

.content-inner {
    max-width: var(--page-width);
    margin: 0 auto;
}

.page-heading {
    margin-bottom: 32px;
}

.page-heading-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 6px;
}

.page-heading-sub {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.page-heading-sub strong {
    color: var(--text);
    font-weight: 600;
}

/* Summary bar */
.summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.summary-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

/* Order list */
.order-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.order-list-head {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 1.4fr 1.1fr 0.9fr;
    gap: 16px;
    padding: 14px 24px;
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
}

.order-list-head span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.order-row {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 1.4fr 1.1fr 0.9fr;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: background 0.12s;
}

.order-row:last-child {
    border-bottom: none;
}

.order-row:hover {
    background: #fafbfc;
}

.order-row .cell-label {
    display: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.order-id {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.order-cell {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.4;
}

.order-cell--muted {
    color: var(--text-secondary);
}

.order-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 72px 32px;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    border-radius: 50%;
    color: var(--primary);
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .topbar-inner {
        padding: 16px 20px;
    }

    .auth-card-header {
        padding: 36px 28px 0;
    }

    .auth-card-body {
        padding: 28px 28px 36px;
    }

    .content-main {
        padding: 28px 16px 48px;
    }

    .order-list-head {
        display: none;
    }

    .order-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px;
    }

    .order-row .cell-label {
        display: block;
    }

    .summary-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .auth-card-title {
        font-size: 1.375rem;
    }

    .page-heading-title {
        font-size: 1.25rem;
    }
}
