/* ==========================================================================
   SwiftShip Design System - Core Variables & Base Styles
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Brand Colors */
    --primary: #0F172A;        /* Slate 900 */
    --primary-light: #1E293B;  /* Slate 800 */
    --accent: #2563EB;         /* Blue 600 */
    --accent-hover: #1D4ED8;   /* Blue 700 */
    --secondary: #F97316;      /* Orange 500 */
    
    /* Neutral & Backgrounds */
    --bg-body: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-alt: #F1F5F9;
    --border-color: #E2E8F0;
    --border-subtle: #EDF2F7;
    
    /* Typography */
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Status Badge Colors */
    --status-created-bg: #F1F5F9;   --status-created-text: #475569;
    --status-transit-bg: #EFF6FF;   --status-transit-text: #2563EB;
    --status-out-bg: #FEF3C7;       --status-out-text: #D97706;
    --status-delivered-bg: #DCFCE7; --status-delivered-text: #16A34A;
    --status-rto-bg: #FEE2E2;       --status-rto-text: #DC2626;
    --status-exception-bg: #FDE8E8; --status-exception-text: #991B1B;

    /* Layout & Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* ==========================================================================
   Typography & Shared Utilities
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
    font-weight: 700;
    line-height: 1.25;
}

.text-muted { color: var(--text-muted) !important; }
.bg-surface { background-color: var(--bg-surface); }
.bg-alt { background-color: var(--bg-alt); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.badge-status {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-status::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-in_transit { background: var(--status-transit-bg); color: var(--status-transit-text); }
.status-in_transit::before { background: var(--status-transit-text); }

.status-out_for_delivery { background: var(--status-out-bg); color: var(--status-out-text); }
.status-out_for_delivery::before { background: var(--status-out-text); }

.status-delivered { background: var(--status-delivered-bg); color: var(--status-delivered-text); }
.status-delivered::before { background: var(--status-delivered-text); }

.status-rto { background: var(--status-rto-bg); color: var(--status-rto-text); }
.status-rto::before { background: var(--status-rto-text); }

.status-created, .status-pending { background: var(--status-created-bg); color: var(--status-created-text); }
.status-created::before, .status-pending::before { background: var(--status-created-text); }

/* Buttons */
.btn-brand-primary {
    background-color: var(--accent);
    color: var(--text-inverse);
    font-weight: 600;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-brand-primary:hover {
    background-color: var(--accent-hover);
    color: var(--text-inverse);
    transform: translateY(-1px);
}

.btn-brand-outline {
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-main);
    font-weight: 600;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.btn-brand-outline:hover {
    background-color: var(--bg-alt);
    border-color: var(--text-muted);
}

/* ==========================================================================
   Public Header & Navigation
   ========================================================================== */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-brand span { color: var(--accent); }

.nav-link {
    font-weight: 500;
    color: var(--text-main) !important;
    padding: 8px 14px !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
    color: var(--accent) !important;
    background-color: var(--bg-alt);
}

/* ==========================================================================
   Hero & Tracking Box
   ========================================================================== */
.hero-section {
    background: radial-gradient(100% 100% at 50% 0%, #1E293B 0%, #0F172A 100%);
    color: var(--text-inverse);
    padding: 90px 0 130px;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-body);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-tag {
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(37, 99, 235, 0.4);
    color: #93C5FD;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

.tracking-widget-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.tracking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tracking-tab-btn {
    background: var(--bg-alt);
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.tracking-tab-btn.active {
    background: var(--accent);
    color: var(--text-inverse);
}

.track-input-group {
    display: flex;
    gap: 10px;
}

.track-input-group input {
    height: 52px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0 18px;
    font-size: 0.95rem;
}
.track-input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   Tracking Result Timeline
   ========================================================================== */
.timeline-stepper {
    position: relative;
    padding: 20px 0;
}
.timeline-stepper::before {
    content: '';
    position: absolute;
    top: 25px;
    bottom: 25px;
    left: 20px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 55px;
    margin-bottom: 30px;
}

.timeline-icon {
    position: absolute;
    left: 8px;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-light);
    z-index: 2;
}

.timeline-item.completed .timeline-icon {
    background: var(--status-delivered-text);
    border-color: var(--status-delivered-text);
    color: white;
}

.timeline-item.active .timeline-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   Dashboard / Admin Layout
   ========================================================================== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.dashboard-sidebar {
    width: 260px;
    background: var(--primary);
    color: #94A3B8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 20px 24px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-inverse);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #94A3B8;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-inverse);
}
.sidebar-link.active {
    background: var(--accent);
}

.dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    overflow-x: hidden;
}

.dashboard-topbar {
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.dashboard-main {
    padding: 28px;
    flex: 1;
}

/* Metric Cards */
.kpi-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.kpi-title {
    font-size: 0.825rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 6px 0;
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}