/* === User Dashboard - Full Design System Integration === */

:root {
    --sidebar-width: 270px;
}

/* ─── Layout ─────────────────────────────────────────── */
.dash-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 5;
}

/* ─── Sidebar ─────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--header-bg-transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 35px 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 40px;
    text-align: center;
}

.sidebar .logo h2 {
    font-size: 1.7rem;
    font-weight: 900;
    background: linear-gradient(to right, var(--text-light), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar .logo h2 span {
    color: var(--primary);
    -webkit-text-fill-color: transparent;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
}

/* ─── Side Navigation ─────────────────────────────────── */
.side-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item {
    color: var(--text-medium);
    padding: 13px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--glass-hover-bg);
    color: var(--text-light);
    border-color: var(--border-color);
    transform: translateX(6px);
}

.nav-item.active {
    background: rgba(0, 210, 255, 0.08);
    color: var(--primary);
    border-color: rgba(0, 210, 255, 0.2);
}

.nav-item.active i {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-item.logout {
    margin-top: auto;
    color: rgba(255, 80, 80, 0.75);
}

.nav-item.logout i {
    background: linear-gradient(45deg, #ff5050, #ff8080);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-item.logout:hover {
    background: rgba(255, 80, 80, 0.08);
    color: #ff5050;
    border-color: rgba(255, 80, 80, 0.2);
    transform: translateX(0);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

/* ─── Main Content ────────────────────────────────────── */
.main-content {
    flex-grow: 1;
    padding: 50px 40px;
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
}

/* ─── Top Bar ─────────────────────────────────────────── */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 45px;
    gap: 20px;
    flex-wrap: wrap;
}

.user-welcome p {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.user-welcome h1 {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 900;
    color: var(--text-light);
    letter-spacing: -0.5px;
}

.user-welcome h1 .highlight {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Tajawal', monospace;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 6px;
}

/* Active badge with pulse */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 255, 0.07);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.status-badge.pulse .dot {
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.5); }
    50%       { box-shadow: 0 0 0 6px rgba(0, 210, 255, 0); }
}

/* ─── Stats Grid ──────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--glass-bg);
    padding: 28px 24px 20px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-6px);
    background: var(--glass-hover-bg);
    border-color: rgba(0, 210, 255, 0.25);
    box-shadow: var(--card-hover-shadow);
}

.stat-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    font-size: 1.2rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-icon.secondary {
    background: rgba(255, 165, 0, 0.1);
    border-color: rgba(255, 165, 0, 0.15);
}

.card-icon.secondary i {
    background: linear-gradient(45deg, #ffa500, #ff6b35);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-icon.success {
    background: rgba(0, 230, 130, 0.1);
    border-color: rgba(0, 230, 130, 0.15);
}

.card-icon.success i {
    background: linear-gradient(45deg, #00e682, #00b894);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-info h3 {
    font-size: 0.82rem;
    color: var(--text-medium);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info .counter {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--text-light);
    line-height: 1;
    font-family: 'Cairo', sans-serif;
    margin-top: 4px;
}

/* Progress bar */
.card-progress {
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
}

.card-progress .bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    transition: width 1s ease;
}

.card-progress .bar.secondary {
    background: linear-gradient(to right, #ffa500, #ff6b35);
}

.card-progress .bar.success {
    background: linear-gradient(to right, #00e682, #00b894);
}

/* ─── Glass Card (data section wrapper) ───────────────── */
.glass-card {
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* ─── Data Section ────────────────────────────────────── */
.data-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1rem;
}

.btn-small {
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--primary);
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.btn-small:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--primary);
}

/* ─── Table ───────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    padding: 0 4px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead {
    background: rgba(255,255,255,0.02);
}

.modern-table th {
    padding: 14px 20px;
    text-align: left;
    color: var(--primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.modern-table td {
    padding: 18px 20px;
    color: var(--text-medium);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.93rem;
    white-space: nowrap;
    transition: var(--transition);
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.modern-table tbody tr:hover td {
    color: var(--text-light);
    background: rgba(255,255,255,0.015);
}

/* AWB code style */
.awb {
    font-family: 'Tajawal', monospace;
    font-weight: 700;
    color: var(--text-light);
    background: rgba(0, 210, 255, 0.06);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    border: 1px solid rgba(0, 210, 255, 0.1);
}

/* ─── Status Badges ───────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-customs {
    background: rgba(255, 165, 0, 0.1);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.2);
}

.status-customs::before {
    background: #ffa500;
    box-shadow: 0 0 6px rgba(255, 165, 0, 0.6);
}

.status-transit {
    background: rgba(0, 210, 255, 0.08);
    color: var(--primary);
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.status-transit::before {
    background: var(--primary);
    box-shadow: 0 0 6px rgba(0, 210, 255, 0.6);
    animation: pulseDot 2s ease-in-out infinite;
}

.status-delivered {
    background: rgba(0, 230, 130, 0.08);
    color: #00e682;
    border: 1px solid rgba(0, 230, 130, 0.2);
}

.status-delivered::before {
    background: #00e682;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 992px) {
    .dash-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .side-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-top: 12px;
    }

    .nav-item {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .nav-item.logout {
        margin-top: 0;
    }

    .nav-divider {
        display: none;
    }

    .main-content {
        max-width: 100%;
        padding: 30px 20px;
    }

    .sidebar-header {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 30px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        padding: 16px 18px;
    }

    .modern-table th,
    .modern-table td {
        padding: 13px 14px;
    }
}
