/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00664f;
    --primary-dark: #004d3b;
    --primary-light: #e6f2ef;
    --accent: #00664f;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg: #f5f7f6;
    --white: #ffffff;
    --border: #e0e5e3;
    --shadow: 0 2px 12px rgba(0, 102, 79, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 102, 79, 0.12);
    --radius: 12px;
    --radius-sm: 8px;

    /* Status colors */
    --status-pending: #f59e0b;
    --status-pending-bg: #fffbeb;
    --status-preparation: #3b82f6;
    --status-preparation-bg: #eff6ff;
    --status-shipped: #00664f;
    --status-shipped-bg: #e6f2ef;
    --status-delivered: #10b981;
    --status-delivered-bg: #ecfdf5;
}

body {
    font-family: 'proxima-nova', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    text-decoration: none;
}

.logo {
    text-decoration: none;
}

.nav-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === MAIN === */
.main-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 24px 60px;
}

.container {
    width: 100%;
    max-width: 800px;
}

/* === LOADING === */
.loading {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 400;
}

/* === ERROR === */
.error-box {
    text-align: center;
    padding: 60px 30px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-icon {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.error-box h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.error-box p {
    color: var(--text-light);
    font-size: 15px;
}

/* === ORDER HEADER CARD === */
.order-header-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--radius);
    padding: 40px 36px;
    text-align: center;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.order-header-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    margin-bottom: 16px;
}

.order-badge svg {
    opacity: 0.9;
}

.order-title {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.order-number {
    font-weight: 700;
    font-size: 28px;
    display: block;
    margin-top: 4px;
    letter-spacing: 1.5px;
}

.order-date {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 8px;
}

/* === SECTION === */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-left: 4px;
}

/* === LINE CARDS === */
.line-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.line-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.line-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.line-product {
    flex: 1;
}

.product-code {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.product-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.line-qty {
    text-align: right;
    flex-shrink: 0;
}

.qty-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.qty-unit {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === STATUS === */
.line-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-pending {
    background: var(--status-pending-bg);
    color: var(--status-pending);
}

.status-preparation {
    background: var(--status-preparation-bg);
    color: var(--status-preparation);
}

.status-shipped {
    background: var(--status-shipped-bg);
    color: var(--status-shipped);
}

.status-delivered {
    background: var(--status-delivered-bg);
    color: var(--status-delivered);
}

.ship-date {
    font-size: 13px;
    color: var(--text-light);
}

/* === PROGRESS TRACKER === */
.progress-tracker {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    padding-top: 8px;
}

.progress-tracker::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 24px;
    right: 24px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 3px solid var(--bg);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.progress-step.completed .step-dot {
    background: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 102, 79, 0.15);
}

.progress-step.current .step-dot {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(0, 102, 79, 0.2);
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 400;
    white-space: nowrap;
}

.progress-step.completed .step-label {
    color: var(--primary);
    font-weight: 500;
}

.progress-step.current .step-label {
    color: var(--primary);
    font-weight: 600;
}

/* === GLOBAL STATUS (in header card) === */
.order-global-status {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.global-status-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.global-ship-date {
    font-size: 13px;
    opacity: 0.85;
}

.order-header-card .progress-tracker {
    margin-top: 20px;
    padding-top: 12px;
}

.order-header-card .progress-tracker::before {
    background: rgba(255, 255, 255, 0.2);
}

.order-header-card .step-dot {
    background: rgba(255, 255, 255, 0.3);
    border-color: transparent;
}

.order-header-card .progress-step.completed .step-dot {
    background: var(--white);
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.order-header-card .progress-step.current .step-dot {
    background: var(--white);
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35);
}

.order-header-card .step-label {
    color: rgba(255, 255, 255, 0.5);
}

.order-header-card .progress-step.completed .step-label {
    color: rgba(255, 255, 255, 0.85);
}

.order-header-card .progress-step.current .step-label {
    color: var(--white);
}

/* === SUB-ITEMS === */
.line-card.sub-item {
    margin-left: 28px;
    border-left: 3px solid var(--primary-light);
    background: #fafcfb;
}

.line-card.sub-item .product-name {
    font-size: 15px;
    font-weight: 500;
}

.line-card.sub-item .qty-value {
    font-size: 18px;
}

.line-card.sub-item .product-code {
    font-size: 11px;
    background: #f0f3f2;
    color: var(--text-light);
}

/* === FOOTER === */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    font-size: 13px;
    color: var(--text-muted);
}

.footer a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .header-inner {
        height: 60px;
        padding: 0 16px;
    }

    .logo img {
        height: 26px;
    }

    .main-content {
        padding: 24px 16px 40px;
    }

    .order-header-card {
        padding: 30px 20px;
    }

    .order-number {
        font-size: 22px;
    }

    .line-card {
        padding: 18px;
    }

    .line-header {
        flex-direction: column;
        gap: 8px;
    }

    .line-qty {
        text-align: left;
    }

    .qty-value {
        display: inline;
        font-size: 18px;
    }

    .qty-unit {
        margin-left: 4px;
    }

    .step-label {
        font-size: 10px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
