:root {
    --primary: #5F69C5;
    --primary-light: #7A85E3;
    --primary-dark: #4A53A0;
    --secondary: #f8f9fc;
    --text-main: #1f2937;
    --text-muted: #64748b;
    --bg-color: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 250px;
    --topbar-height: 70px;
    --transition: all 0.3s ease;
}

.logo-img {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Dashboard Layout Structure */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
    overscroll-behavior: contain;
}

/* Custom Large Checkboxes for Tables */
.parcels-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
    transition: transform 0.2s;
    vertical-align: middle;
}

.parcels-table input[type="checkbox"]:active {
    transform: scale(0.92);
}

.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
}

.sidebar-nav {
    padding: 24px 16px 40px 16px; /* Optimized bottom space for mobile */
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    transition: var(--transition);
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
    margin-right: 12px;
}

.nav-item:hover {
    background: rgba(95, 105, 197, 0.05);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--surface);
    box-shadow: 0 4px 12px rgba(95, 105, 197, 0.3);
}

.nav-item.logout {
    margin-top: auto;
    color: var(--danger);
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: fixed;
    top: 0;
    right: 0;
    width: calc(100% - var(--sidebar-width));
    z-index: 110;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.topbar-icon:hover {
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Dashboard Body */
.dashboard-body {
    padding: 32px;
    padding-top: calc(32px + var(--topbar-height));
    background: var(--bg-color);
}

.page-title {
    margin-bottom: 24px;
    font-size: 1.8rem;
    color: var(--text-main);
}

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

.stat-card {
    background: var(--surface);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(95, 105, 197, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Wallet Card Special Styling */
.stat-card.wallet {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
}

.stat-card.wallet h3,
.stat-card.wallet .value {
    color: white;
}

.stat-card.wallet .icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.add-money-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

.add-money-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Secondary Grids */
.secondary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* Warehouse Address Card */
.address-card {
    background: var(--surface);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.address-box {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    position: relative;
    border: 1px dashed var(--border);
}

.address-box p {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.95rem;
}

.userid-highlight {
    color: var(--primary);
    font-weight: 700;
}

.copy-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.action-btn i.main-icon {
    width: 40px;
    height: 40px;
    background: rgba(95, 105, 197, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.action-btn .text {
    flex: 1;
    text-align: left;
}

.action-btn .text strong {
    display: block;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 4px;
}

.action-btn .text span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.action-btn i.chevron {
    color: var(--text-muted);
}

.action-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(95, 105, 197, 0.1);
}

/* Ship Dropdown */
.ship-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    margin-top: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-main);
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--bg-color);
    color: var(--primary);
}

/* Recent Parcels List */
.table-card {
    background: var(--surface);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

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

.parcels-table th,
.parcels-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.parcels-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.parcels-table td {
    color: var(--text-main);
    font-weight: 500;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-warehouse { background: rgba(95, 105, 197, 0.1); color: var(--primary); }
.status-transit { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.status-processing { background: rgba(95, 105, 197, 0.1); color: var(--primary); }

.view-all-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.4rem;
}

.close-modal {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.balance-display {
    text-align: center;
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
}

.balance-display span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.balance-display h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-top: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(95, 105, 197, 0.1);
}

.quick-amount {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.quick-btn {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.quick-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .secondary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
        overflow-x: hidden;
    }

    .menu-toggle {
        display: block;
    }
    
    .topbar {
        padding: 12px 16px;
        width: 100%;
        height: auto;
        min-height: var(--topbar-height);
        flex-wrap: wrap;
        gap: 12px;
    }

    #topbar-title {
        display: block;
        font-size: 1rem;
    }

    .topbar-right {
        gap: 12px;
        flex-wrap: wrap;
    }

    .user-profile span {
        display: block;
        font-size: 0.9rem;
    }

    .dashboard-body {
        padding: 16px;
        padding-top: 140px; /* Increased padding offset to handle flexible two-line mobile header */
    }

    .page-title {
        font-size: 1.4rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

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

    .quick-amount {
        flex-wrap: wrap;
    }

    .quick-btn {
        flex: 1 1 40%;
    }
}
/* --- NEW FEATURES CSS --- */
/* Dropdown */
.user-dropdown-container { position: relative; cursor: pointer; }
.user-dropdown { position: absolute; top: calc(100% + 5px); right: 0; background: white; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-radius: 8px; width: 220px; padding: 10px 0; display: none; flex-direction: column; z-index: 1000; border: 1px solid var(--border-color); }
.user-dropdown.active { display: flex; animation: slideDown 0.2s ease; }
.dropdown-header { padding: 10px 16px; border-bottom: 1px solid var(--border-color); margin-bottom: 5px; }
.dropdown-email { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; word-break: break-all; margin-top: 4px; }
.dropdown-item { padding: 10px 16px; color: var(--text-color); font-weight: 500; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 10px; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--primary); }
.dropdown-item.logout { color: var(--danger); border-top: 1px solid var(--border-color); margin-top: 5px; }
.dropdown-item.logout:hover { background: rgba(239, 68, 68, 0.05); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Documents */
/* --- NEW FEATURES CSS --- */
/* Dropdown */
.user-dropdown-container { position: relative; cursor: pointer; }
.user-dropdown { position: absolute; top: calc(100% + 5px); right: 0; background: white; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-radius: 8px; width: 220px; padding: 10px 0; display: none; flex-direction: column; z-index: 1000; border: 1px solid var(--border-color); }
.user-dropdown.active { display: flex; animation: slideDown 0.2s ease; }
.dropdown-header { padding: 10px 16px; border-bottom: 1px solid var(--border-color); margin-bottom: 5px; }
.dropdown-email { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; word-break: break-all; margin-top: 4px; }
.dropdown-item { padding: 10px 16px; color: var(--text-color); font-weight: 500; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 10px; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--primary); }
.dropdown-item.logout { color: var(--danger); border-top: 1px solid var(--border-color); margin-top: 5px; }
.dropdown-item.logout:hover { background: rgba(239, 68, 68, 0.05); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Documents */
.upload-zone { border: 2px dashed var(--primary); border-radius: 12px; padding: 40px 20px; text-align: center; background: rgba(95, 105, 197, 0.03); margin-bottom: 24px; transition: 0.3s; }
.upload-zone:hover { background: rgba(95, 105, 197, 0.08); }
.upload-zone i { font-size: 3rem; color: var(--primary); margin-bottom: 16px; }
.upload-zone h3 { margin-bottom: 8px; }
.doc-secure-text { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 16px; 
    background: white; 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    flex-wrap: wrap;
    gap: 12px;
}
.doc-item-left { display: flex; align-items: center; gap: 16px; min-width: 200px; flex: 1; }
.doc-item-left i { font-size: 1.5rem; color: var(--primary); }

/* Enhanced Support Page */
.support-hero { background: var(--primary); color: white; padding: 40px 20px; text-align: center; border-radius: 16px; margin-bottom: 30px; }
.support-hero h1 { font-size: 2.2rem; margin-bottom: 10px; }
.support-top-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 30px; position: relative; z-index: 10; padding: 0 10px; }
.support-card { background: white; box-shadow: 0 5px 15px rgba(0,0,0,0.03); border-radius: 12px; padding: 24px; text-align: left; border: 1px solid var(--border-color); transition: transform 0.3s ease; }
.support-card:hover { transform: translateY(-5px); }
.support-card .icon { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px; }
.icon-whatsapp { background: #e0f8e9; color: #10B981; }
.icon-email { background: #eef0fa; color: var(--primary); }
.icon-phone { background: #e0edff; color: #3B82F6; }
.support-card h3 { font-size: 1.2rem; margin-bottom: 8px; font-weight: 700; color: #111; }
.support-card p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 16px; }
.support-card a { font-weight: 500; color: #111; font-size: 1.1rem; text-decoration: none; }
.support-card .whatsapp-link { color: #111; }
.support-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; padding: 0 10px;}
@media (max-width: 900px) { .support-grid { grid-template-columns: 1fr; } }
.ticket-form-card { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.03); border: 1px solid var(--border-color); }
.side-cards { display: flex; flex-direction: column; gap: 20px; }
.side-card { background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--border-color); display: flex; align-items: flex-start; gap: 16px; }
.side-card.guarantee { background: var(--primary); color: white; border: none; align-items: flex-start; flex-direction: column; }
.side-card .icon-left { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(239, 68, 68, 0.1); color: var(--danger); flex-shrink: 0; font-size: 1.2rem;}
.side-card.hours .icon-left { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.side-card h4 { margin-bottom: 8px; font-size: 1.1rem; color: #111;}
.side-card.guarantee h4 { color: white; font-size: 1.3rem; margin-bottom: 12px; }
.side-card p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }
.side-card.guarantee p { color: rgba(255,255,255,0.9); font-size: 0.95rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10B981; margin-right: 8px; }

/* Sub Pages UI */
.sub-page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.back-btn { background: var(--bg-hover); color: var(--text-color); border: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: 0.2s; }
.back-btn:hover { background: var(--primary); color: white; }

/* =====================================================
   30-DAY COUNTDOWN BADGE
   ===================================================== */
.countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.countdown-safe    { background: rgba(16,185,129,0.1);  color: #10b981; border: 1px solid rgba(16,185,129,0.25); }
.countdown-warning { background: rgba(245,158,11,0.1);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.countdown-danger  { background: rgba(239,68,68,0.12);  color: #ef4444; border: 1px solid rgba(239,68,68,0.25); }
.countdown-expired { background: rgba(239,68,68,0.18);  color: #ef4444; border: 1px solid rgba(239,68,68,0.35); font-style: italic; }

/* =====================================================
   MISSING STATUS BADGES
   ===================================================== */
.status-active    { background: rgba(95,105,197,0.10); color: var(--primary); }
.status-pending   { background: rgba(245,158,11,0.10); color: var(--warning); }
.status-delivered { background: rgba(16,185,129,0.10); color: var(--success); }
.status-danger    { background: rgba(239,68,68,0.10);  color: var(--danger);  }

/* =====================================================
   TABLE RESPONSIVE WRAPPER
   ===================================================== */
.table-card { overflow-x: auto; }
table { min-width: 500px; }

/* =====================================================
   COMPREHENSIVE RESPONSIVE FIXES
   ===================================================== */

/* Large Tablets */
@media (max-width: 1100px) {
    .secondary-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets */
@media (max-width: 900px) {
    .support-grid { grid-template-columns: 1fr !important; }
    .support-top-cards { grid-template-columns: 1fr 1fr; }
    .form-card { max-width: 100%; }
}

/* Mobile — All phones */
@media (max-width: 768px) {
    /* Topbar: keep everything on one line on mobile */
    .topbar {
        padding: 0 14px;
        height: var(--topbar-height);
        flex-wrap: nowrap;
        gap: 8px;
        overflow: hidden;
    }
    .topbar-left { gap: 10px; flex-shrink: 0; }
    #topbar-title { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

    /* Topbar right — Home + Bell + Avatar on right, name hidden on very small */
    .topbar-right { gap: 10px; }
    .user-profile span { display: none; } /* hide name text on mobile */
    .topbar-icon { font-size: 1rem; }

    /* Dashboard body — give enough top space */
    .dashboard-body {
        padding: 14px;
        padding-top: calc(14px + var(--topbar-height));
    }

    /* Stats: 2 columns on tablet, 1 on small */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card .value { font-size: 1.4rem; }

    /* Tables */
    .table-card { padding: 16px; }
    table { font-size: 0.85rem; }
    th, td, .parcels-table th, .parcels-table td { padding: 10px 8px; }

    /* Forms */
    .form-card { padding: 20px; }
    .form-group-dash input,
    .form-group-dash select,
    .form-group-dash textarea { font-size: 16px; } /* Prevents iOS zoom */

    /* Support */
    .support-top-cards { grid-template-columns: 1fr; }
    .support-grid { grid-template-columns: 1fr !important; }
    .support-hero h1 { font-size: 1.6rem; }

    /* Sidebar overlay */
    .sidebar { box-shadow: 4px 0 20px rgba(0,0,0,0.15); }

    /* Calculator result card */
    #dash-calc-result { padding: 20px !important; }
}

/* Very small phones */
@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    #topbar-title { max-width: 100px; }
    .page-title { font-size: 1.2rem !important; }
    .btn-primary { padding: 12px; font-size: 0.95rem; }
    .countdown-badge { font-size: 0.72rem; padding: 4px 8px; }
}


/* Global Select UI Fix */
.form-group-dash select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
    padding-right: 36px;
}


/* --- TOPBAR REDESIGN --- */
.topbar-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white !important;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(95, 105, 197, 0.2);
}
.topbar-home-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(95, 105, 197, 0.3);
}
.topbar-home-btn i {
    font-size: 1.1rem;
}
@media (max-width: 768px) {
    .topbar-home-btn span { display: none; }
    .topbar-home-btn { padding: 10px; }
}


.topbar-logo {
    color: var(--primary);
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    margin-left: 15px;
}
.topbar-logo i {
    font-size: 1.3rem !important;
}
@media (max-width: 768px) {
    .topbar-logo { font-size: 1.1rem; }
}
