/* ========================================
   CSS VARIABLES & THEME
   ======================================== */
:root {
    --primary-dark: #ffffff;
    --accent-teal: #00bfa5;
    --primary: #00bfa5;
    --accent: #0d9488;
    --bg-light: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 43, 92, 0.25);
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* ========================================
SIDEBAR TOGGLE BUTTON
======================================== */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-main);
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-light);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}

/* Hide the old duplicate buttons */
#desktopSidebarToggle,
#sidebarToggle,
.mobile-menu-toggle {
    display: none !important;
}

/* ========================================
SIDEBAR OVERLAY
======================================== */
#sidebarOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
    backdrop-filter: blur(1px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebarOverlay.active {
    display: block;
    opacity: 1;
}

/* ========================================
   LAYOUT - SIDEBAR
   ======================================== */
.sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
    scroll-behavior: smooth;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    align-self: anchor-center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 26px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo .ugo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--white);
}

.logo .travel {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--accent-teal);
    font-size: 22px;
}

.role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(0, 0, 0, 0.8);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Sidebar Navigation */
.sidebar-nav-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 168, 150, 0.5) rgba(255, 255, 255, 0.03);
}

/* ========================================
CUSTOM SCROLLBAR - SIDEBAR
======================================== */

/* --- WebKit Browsers (Chrome, Edge, Safari) --- */

/* Main sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin: 4px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(0, 191, 165, 0.6) 0%, 
        rgba(0, 150, 136, 0.4) 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(0, 191, 165, 0.9) 0%, 
        rgba(0, 150, 136, 0.7) 100%);
}

/* Sidebar nav inner scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin: 4px 0;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(0, 191, 165, 0.5) 0%, 
        rgba(0, 150, 136, 0.3) 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(0, 191, 165, 0.8) 0%, 
        rgba(0, 150, 136, 0.6) 100%);
}

/* --- Firefox --- */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 191, 165, 0.5) rgba(255, 255, 255, 0.02);
}

.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 191, 165, 0.4) rgba(255, 255, 255, 0.02);
}

/* Scroll Buttons Styling (keep existing) */
.scroll-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 24px;
    background: linear-gradient(135deg, rgba(0, 168, 150, 0.9) 0%, rgba(0, 130, 115, 0.9) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.scroll-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-btn-up {
    top: 0;
    border-radius: 0 0 8px 8px;
}

.scroll-btn-down {
    bottom: 0;
    border-radius: 8px 8px 0 0;
}

.scroll-btn:hover {
    background: linear-gradient(135deg, rgba(0, 168, 150, 1) 0%, rgba(0, 130, 115, 1) 100%);
}

.scroll-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* Scroll Buttons */
.scroll-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 24px;
    background: linear-gradient(135deg, rgba(0, 168, 150, 0.9) 0%, rgba(0, 130, 115, 0.9) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.scroll-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-btn-up {
    top: 0;
    border-radius: 0 0 8px 8px;
}

.scroll-btn-down {
    bottom: 0;
    border-radius: 8px 8px 0 0;
}

.scroll-btn:hover {
    background: linear-gradient(135deg, rgba(0, 168, 150, 1) 0%, rgba(0, 130, 115, 1) 100%);
}

.scroll-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* Menu Items */
.menu-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.4);
    padding: 15px 25px 10px;
    font-weight: 700;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgb(0, 0, 0);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav a i {
    width: 24px;
    margin-right: 10px;
    font-size: 16px;
    text-align: center;
}

.sidebar-nav a:hover {
    color: var(--white);
    background: rgb(13 148 136);
}

.sidebar-nav a.active {
    color: var(--white);
    background: rgb(13 148 136);
    border-left: 3px solid var(--accent-teal);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-link {
    color: #ff6b6b !important;
    font-weight: 600;
}

.logout-link:hover {
    background: rgba(255, 107, 107, 0.1) !important;
}

/* ========================================
   LAYOUT - MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    transition: margin-left 0.3s ease !important;
}

/* Top Header */
.top-header {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    height: 80px;
}

.sidebar-toggle-btn,
#sidebarToggleBtn {
    flex-shrink: 0 !important;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.wallet-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wallet-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 2px 0 5px 0;
}

.btn-add-funds {
    background: #0056b3;
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.btn-add-funds:hover {
    background: #004494;
}

.user-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 13px;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.user-actions {
    display: flex;
    gap: 15px;
}

.user-actions a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.user-actions a:hover {
    text-decoration: underline;
}

/* Content Area */
.content {
    padding: 30px;
    flex: 1;
}

/* ========================================
   COMPONENTS - ALERTS
   ======================================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

/* ========================================
   COMPONENTS - BANNERS & CARDS
   ======================================== */
.seller-banner {
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seller-banner h3 {
    color: #92400e;
    margin-bottom: 5px;
}

.seller-banner p {
    color: #a16207;
    font-size: 14px;
    margin: 0;
}

.seller-banner form {
    display: flex;
    gap: 10px;
}

.seller-banner input {
    padding: 8px 12px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
}

.seller-banner button {
    background: var(--warning);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

/* ========================================
   COMPONENTS - SEARCH WIDGET
   ======================================== */
.search-widget {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.search-widget h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--text-main);
}

.search-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.search-tabs button {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.search-tabs button:hover {
    background: var(--bg-light);
}

.search-tabs button.active {
    background: #e0f2f1;
    color: #00695c;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #f9fafb;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-teal);
    background: var(--white);
}

/* ========================================
   COMPONENTS - BUTTONS
   ======================================== */
.btn-search {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    height: 42px;
    transition: background 0.2s;
}

.btn-search:hover {
    background: #0d9488ad;
}

.btn-accent {
    background: var(--accent-teal);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-accent:hover {
    background: #009688;
}

.btn-outline {
    background: transparent;
    color: var(--accent-teal);
    border: 1px solid var(--accent-teal);
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--accent-teal);
    color: white;
}

.btn-book {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-book:hover {
    background: #001a33;
}

.btn-upload {
    background: #00A896;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-upload:hover {
    background: #008c7d;
}

/* ========================================
   COMPONENTS - DEALS GRID
   ======================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-all {
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.deal-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

.deal-card.urgent {
    border-top: 4px solid var(--warning);
}

.deal-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--warning);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.deal-card:not(.urgent) .deal-badge {
    background: var(--accent-teal);
}

.deal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 10px 0;
    padding-right: 60px;
}

.deal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 20px 0;
    flex-grow: 1;
    line-height: 1.4;
}

.deal-pricing {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
}

.deal-price-discounted {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
}

.deal-price-original {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}

.deal-off {
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ========================================
   COMPONENTS - RFP SECTION
   ======================================== */
.rfp-card {
    background: var(--primary-dark);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 35px;
}

.rfp-card h3 {
    margin-top: 0;
    color: white;
}

.rfp-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.rfp-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.rfp-form .form-group label {
    color: rgba(255, 255, 255, 0.8);
}

.rfp-form .form-group input,
.rfp-form .form-group select {
    background: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.rfp-form .btn-search {
    background: var(--accent-teal);
    color: var(--primary-dark);
}

.rfp-hero {
    background: linear-gradient(135deg, #002B5C 0%, #001A33 100%) !important;
    border: none !important;
    color: var(--white) !important;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.rfp-hero h2 {
    margin: 0 0 6px 0;
    font-size: 24px;
    color: var(--white);
}

.rfp-hero p {
    margin: 0 0 25px 0;
    opacity: 0.85;
    font-size: 14px;
    color: var(--white);
}

.rfp-hero label {
    display: block;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.rfp-hero input,
.rfp-hero select {
    width: 100%;
    background: var(--white) !important;
    color: #333333;
    padding: 12px 14px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
}

.rfp-hero button[type="submit"] {
    height: 46px;
    white-space: nowrap;
}

/* ========================================
   COMPONENTS - TABLES & RESULTS
   ======================================== */
.results-container,
.table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    overflow: hidden;
}

.results-header,
.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.result-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.result-item:last-child {
    border-bottom: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

/* Status Badges */
.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.status.Confirmed,
.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status.Pending,
.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status.Cancelled,
.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* Feature Badges */
.badge-featured {
    background-color: #E6F9F5;
    color: var(--accent);
}

.badge-urgent {
    background-color: #FFF3E0;
    color: var(--warning);
}

.badge-discount {
    background-color: #E3F2FD;
    color: #1976D2;
}

/* ========================================
   COMPONENTS - MODALS
   ======================================== */
.modal,
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal.active,
.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
}

.modal-close:hover,
.close-btn:hover {
    background: #f3f4f6;
    color: var(--danger);
}

/* Modal Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #008c7d;
}

/* Wallet Tabs in Modal */
.wallet-tab-btn {
    flex: 1;
    padding: 12px;
    background: #f0f0f0;
    color: #666;
    border: 2px solid transparent;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-content .wallet-tab-btn.active {
    background: var(--accent-teal);
    color: white;
    border-color: var(--accent-teal);
}

.wallet-tab-btn:hover:not(.active) {
    background: #e5e7eb;
}

/* ========================================
   COMPONENTS - MOBILE MENU
   ======================================== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-main);
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Collapsed sidebar styles */
.sidebar.collapsed {
    width: 70px !important;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-logo {
    display: none !important;
}

.sidebar.collapsed nav a {
    justify-content: center;
    padding: 15px 0 !important;
}

.sidebar.collapsed nav a i {
    margin: 0;
}

/* Prevent content jump during transition */
.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

/* Tooltip for collapsed sidebar (optional enhancement) */
.sidebar.collapsed nav a {
    position: relative;
}

.sidebar.collapsed nav a:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 10px;
    z-index: 1000;
    pointer-events: none;
}
.desktop-sidebar-toggle {
    display: flex !important;
}
/* ========================================
   RESPONSIVE - TABLET (1024px)
   ======================================== */
@media (max-width: 1024px) {
    .search-form {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    
    .search-form button[type="submit"],
    .search-form .btn-search {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        padding: 12px !important;
        font-size: 15px !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 260px !important;
    }

    .sidebar.mobile-active {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 0px !important;
    }
}

/* ========================================
RESPONSIVE - TABLET SMALL (947px)
======================================== */
@media (max-width: 947px) {
    .search-form {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    
    .search-form button[type="submit"],
    .search-form .btn-search {
        grid-column: 1 / -1 !important; /* Full width */
        width: 100% !important;
        padding: 12px !important;
        font-size: 15px !important;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (900px)
   ======================================== */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        width: 260px;
    }
    
    .sidebar.mobile-active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-header {
        padding: 12px 15px;
        height: auto;
        min-height: 70px;
    }
    
    .header-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }
    
    .wallet-section {
        align-items: flex-end;
    }
}

/* ========================================
RESPONSIVE - TABLET SMALL (850px)
======================================== */
@media (max-width: 850px) {
    
    /* --- 1. Header Fixes (Compact Row) --- */
    .top-header {
        padding: 10px 15px !important;
        height: auto !important;
        min-height: 65px !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
    }

    /* Truncate title so it doesn't push out the wallet */
    .header-title {
        font-size: 18px !important;
        max-width: 140px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Hide "WALLET BALANCE" label to save space */
    .wallet-label {
        display: none !important;
    }

    .wallet-amount {
        font-size: 16px !important;
        margin: 0 !important;
    }

    .btn-add-funds {
        padding: 4px 10px !important;
        font-size: 11px !important;
    }

    /* Hide user text, keep only avatar if needed */
    .user-section {
        display: none !important;
    }

    /* --- 2. Search Widget Fixes --- */
    .search-widget {
        padding: 15px !important;
    }
    
    .search-widget h2 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    /* 2-column grid for inputs, full width for button */
    .search-form {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    /* Force search button to span full width on the bottom row */
    .search-form button[type="submit"],
    .search-form .btn-search {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        margin-top: 5px !important;
    }

    /* --- 3. Table Fixes (Horizontal Scroll) --- */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        min-width: 650px !important; /* Forces scrollbar instead of squishing */
    }

    th, td {
        padding: 10px 12px !important;
        white-space: nowrap !important;
    }
}

/* ========================================
RESPONSIVE - TABLET SMALL (830px)
======================================== */
@media (max-width: 830px) {
    .search-form {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    
    .search-form button[type="submit"],
    .search-form .btn-search {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        margin-top: 5px !important;
    }
    
    .search-widget {
        padding: 20px !important;
    }
    
    .search-widget h2 {
        font-size: 18px !important;
    }
    
    .search-tabs {
        gap: 8px !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 8px !important;
    }
    
    .search-tabs button {
        padding: 8px 14px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    
    .search-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .search-tabs::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .search-tabs::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 2px;
    }
}

/* ========================================
RESPONSIVE - SMALL MOBILE (768px)
======================================== */
@media screen and (max-width: 768px) {
    /* 1. Header Layout Setup */
    .top-header {
        position: relative !important; /* Crucial for absolute positioning of button */
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 15px 10px 55px !important; /* Left padding makes room for the button */
        height: 60px !important;
        min-height: 60px !important;
        overflow: hidden !important;
    }

    /* 2. Force Toggle Button to FAR LEFT */
    /* Targets all possible button classes/IDs used in your code */
    .top-header button,
    .top-header .mobile-menu-toggle,
    .top-header .desktop-sidebar-toggle,
    .top-header .sidebar-toggle-btn,
    .top-header #sidebarToggleBtn,
    .top-header #desktopSidebarToggle {
        position: absolute !important;
        left: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 10 !important;
        margin: 0 !important;
        
        /* Match the white square button style from your screenshot */
        background: white !important;
        border: 1px solid #e5e7eb !important;
        color: #1f2937 !important;
        width: 36px !important;
        height: 36px !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        font-size: 16px !important;
    }

    /* 3. Title - Prevent cutoff */
    .header-title {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: var(--accent-teal) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 130px !important; /* Constrain width so wallet fits */
        margin: 0 !important;
        display: block !important;
    }

    /* Hide "BUYER PORTAL" subtitle to save space */
    .header-title + span,
    .header-subtitle {
        display: none !important;
    }

    /* 4. Wallet & User - Push to FAR RIGHT */
    .header-right {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        margin-left: auto !important; /* Forces this group to the far right */
        flex-shrink: 0 !important;
    }

    /* Compact Wallet Section */
    .wallet-section {
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 6px 12px !important;
        background: #f0fdf9 !important; /* Light teal background */
        border-radius: 8px !important;
    }
    .wallet-label { display: none !important; }
    .wallet-amount { 
        font-size: 14px !important; 
        margin: 0 !important; 
        font-weight: 700 !important; 
        color: #00bfa5 !important; 
        white-space: nowrap !important;
    }
    .btn-add-funds { 
        padding: 4px 10px !important; 
        font-size: 11px !important; 
        border-radius: 12px !important; 
    }

    /* Compact User Profile */
    .user-section { display: none !important; }
    #userProfileBtn { padding: 4px !important; }
    #userProfileBtn > div:first-child { width: 32px !important; height: 32px !important; }
    #userProfileBtn > div:nth-child(2) { display: none !important; }

    /* 5. Search Tabs & Form */
    .search-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 8px !important;
        gap: 8px !important;
    }
    .search-tabs button {
        padding: 8px 14px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    .search-form {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .search-form .form-group,
    .search-form > div {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 6. Sidebar & Content */
    .sidebar {
        transform: translateX(-100%) !important;
        width: 260px !important;
    }
    .sidebar.mobile-active {
        transform: translateX(0) !important;
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .content {
        padding: 15px !important;
    }
    /* Wrap table in scrollable container */
    .card {
        overflow: hidden !important;
    }
    
    .card > div[style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .card > div[style*="display: flex"] h3 {
        flex: 1 !important;
        min-width: 200px !important;
    }
    
    /* Make table horizontally scrollable */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        width: 100% !important;
        min-width: 600px !important; /* Ensures all columns fit */
    }
    
    /* Table wrapper for better scrolling */
    .card table {
        margin: 0 !important;
    }
    
    /* Ensure table headers don't get cut off */
    th {
        padding: 12px 15px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        position: sticky !important;
        top: 0 !important;
        background: #f9fafb !important;
        z-index: 1 !important;
    }
    
    td {
        padding: 12px 15px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    
    /* Amount column - ensure it's fully visible */
    th:last-child,
    td:last-child {
        min-width: 100px !important;
        text-align: right !important;
    }
    
    /* Status badges - keep compact */
    .status {
        padding: 4px 8px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
    }
    
    /* Custom scrollbar for table */
    table::-webkit-scrollbar {
        height: 6px;
    }
    
    table::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    table::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 3px;
    }
    
    table::-webkit-scrollbar-thumb:hover {
        background: #008c7d;
    }
}

/* ========================================
TABLE FIX - 679px AND BELOW
======================================== */
@media screen and (max-width: 679px) {
    /* Header - more compact */
    .top-header {
        padding: 10px 12px !important;
        min-height: 55px !important;
        gap: 8px !important;
    }
    
    /* Hamburger button */
    .sidebar-toggle-btn,
    #sidebarToggleBtn {
        width: 34px !important;
        height: 34px !important;
        font-size: 15px !important;
    }
    
    /* Title - smaller */
    .header-title {
        font-size: 15px !important;
    }
    
    /* Wallet section - very compact */
    .wallet-section {
        padding: 5px 8px !important;
        gap: 4px !important;
    }
    
    .wallet-amount {
        font-size: 13px !important;
    }
    
    .btn-add-funds {
        padding: 3px 8px !important;
        font-size: 10px !important;
    }
    
    /* User avatar */
    #userProfileBtn > div:first-child {
        width: 30px !important;
        height: 30px !important;
    }
    
    /* Approved Seller Banner - stack vertically */
    .card[style*="background: #e8f5e9"],
    .card[style*="background: #fff3e0"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 12px !important;
    }
    
    .card[style*="background: #e8f5e9"] > div,
    .card[style*="background: #fff3e0"] > div {
        width: 100% !important;
    }
    
    .card[style*="background: #e8f5e9"] h3,
    .card[style*="background: #fff3e0"] h3 {
        font-size: 14px !important;
    }
    
    .card[style*="background: #e8f5e9"] p,
    .card[style*="background: #fff3e0"] p {
        font-size: 12px !important;
    }
    
    /* Switch to Seller Portal button - full width */
    .card[style*="background: #e8f5e9"] a.btn,
    .card[style*="background: #e8f5e9"] .btn-accent {
        width: 100% !important;
        text-align: center !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
        white-space: normal !important;
    }
    
    /* Search Widget - compact */
    .search-widget {
        padding: 15px !important;
    }
    
    .search-widget h2 {
        font-size: 17px !important;
        margin-bottom: 15px !important;
    }
    
    /* Search tabs - smaller */
    .search-tabs {
        gap: 6px !important;
        padding-bottom: 6px !important;
    }
    
    .search-tabs button {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    /* Search form - full width button */
    .search-form {
        gap: 10px !important;
    }
    
    .search-form .form-group {
        gap: 4px !important;
    }
    
    .search-form .form-group label {
        font-size: 10px !important;
    }
    
    .search-form .form-group input,
    .search-form .form-group select {
        padding: 9px 10px !important;
        font-size: 13px !important;
    }
    
    /* Search button - full width and visible */
    .search-form button[type="submit"],
    .btn-search {
        width: 100% !important;
        padding: 11px 16px !important;
        font-size: 14px !important;
        margin-top: 5px !important;
    }
    
    /* Content padding */
    .content {
        padding: 12px !important;
    }
    
    /* Cards */
    .card {
        padding: 12px !important;
    }
    
    /* Section titles */
    .section-title {
        font-size: 16px !important;
    }
    
    /* View All link */
    .view-all {
        font-size: 12px !important;
    }

    /* Card container */
    .card {
        padding: 15px !important;
        margin-bottom: 15px !important;
        overflow: hidden !important;
    }
    
    /* Table wrapper - make it scrollable */
    .card > table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        min-width: 700px !important; /* Force table to be wider than container */
        margin: 0 !important;
        border-collapse: collapse !important;
    }
    
    /* Table headers */
    th {
        padding: 12px 15px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        position: sticky !important;
        top: 0 !important;
        background: #f9fafb !important;
        z-index: 1 !important;
        min-width: 100px !important;
    }
    
    /* Table cells */
    td {
        padding: 12px 15px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        min-width: 100px !important;
    }
    
    /* First column (Booking ID) - sticky left */
    th:first-child,
    td:first-child {
        min-width: 120px !important;
        position: sticky !important;
        left: 0 !important;
        background: white !important;
        z-index: 2 !important;
        box-shadow: 2px 0 5px rgba(0,0,0,0.05) !important;
    }
    
    th:first-child {
        background: #f9fafb !important;
    }
    
    /* Last column (Amount) - ensure full visibility */
    th:last-child,
    td:last-child {
        min-width: 120px !important;
        text-align: right !important;
        padding-right: 20px !important;
    }
    
    /* Status badges */
    .status {
        padding: 4px 8px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
    }
    
    /* Custom scrollbar for table */
    .card > table::-webkit-scrollbar {
        height: 6px;
    }
    
    .card > table::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .card > table::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 3px;
    }
    
    .card > table::-webkit-scrollbar-thumb:hover {
        background: #008c7d;
    }
}

/* ========================================
TABLE FIX FOR MOBILE (659px and below)
======================================== */
@media screen and (max-width: 659px) {

    /* Replace the existing 'table' rule with this: */
    .card table {
        display: block;
        width: 100%;
        min-width: 650px; /* Forces horizontal scroll instead of squashing columns */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
        margin-bottom: 10px;
    }

    .card table th,
    .card table td {
        padding: 12px 15px;
        white-space: nowrap; /* Prevents text wrapping */
        font-size: 13px;
        border-bottom: 1px solid var(--border-color);
    }

    .card table th {
        background: #f9fafb;
        font-weight: 600;
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    /* Custom scrollbar for table */
    .card table::-webkit-scrollbar {
        height: 6px;
    }
    .card table::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    .card table::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 3px;
    }
    .card table::-webkit-scrollbar-thumb:hover {
        background: #008c7d;
    }

    /* ... keep your existing rules below ... */
}

/* ========================================
RESPONSIVE - SMALL MOBILE (650px)
======================================== */
@media screen and (max-width: 650px) {
    /* Header - ultra compact */
    .top-header {
        padding: 8px 12px !important;
        min-height: 55px !important;
        gap: 6px !important;
    }
    
    /* Hamburger button - smaller */
    .sidebar-toggle-btn,
    .mobile-menu-toggle {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
        margin-right: 8px !important;
    }
    
    /* Title - single line, truncate */
    .header-title {
        font-size: 15px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 120px !important;
        line-height: 1.2 !important;
    }
    
    /* Hide "BUYER PORTAL" subtitle completely */
    .header-title + span,
    .header-subtitle,
    .top-header > div:first-child > span {
        display: none !important;
    }
    
    /* Wallet section - very compact */
    .wallet-section {
        padding: 4px 8px !important;
        gap: 3px !important;
    }
    
    .wallet-label {
        display: none !important;
    }
    
    .wallet-amount {
        font-size: 12px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    .btn-add-funds {
        padding: 3px 6px !important;
        font-size: 9px !important;
        border-radius: 10px !important;
    }
    
    /* User avatar - smaller */
    #userProfileBtn {
        padding: 3px 5px !important;
    }
    
    #userProfileBtn > div:first-child {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
    }
    
    #userProfileBtn > div:nth-child(2) {
        display: none !important;
    }
    
    /* Header right section - compact */
    .header-right {
        gap: 5px !important;
    }
}

/* ========================================
RESPONSIVE - MEDIUM MOBILE (612px to 432px)
======================================== */
@media screen and (max-width: 612px) and (min-width: 432px) {
    /* Header - compact single row */
    .top-header {
        padding: 10px 12px !important;
        min-height: 55px !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }
    
    /* Hamburger button - smaller */
    .sidebar-toggle-btn,
    .mobile-menu-toggle {
        width: 34px !important;
        height: 34px !important;
        font-size: 15px !important;
        margin-right: 8px !important;
        flex-shrink: 0 !important;
    }
    
    /* Title - single line, truncate */
    .header-title {
        font-size: 16px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 110px !important;
        line-height: 1.2 !important;
        flex-shrink: 1 !important;
    }
    
    /* Hide "BUYER PORTAL" subtitle */
    .header-title + span,
    .header-subtitle,
    .top-header > div:first-child > span {
        display: none !important;
    }
    
    /* Wallet section - very compact */
    .wallet-section {
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 5px 8px !important;
        flex-shrink: 1 !important;
    }
    
    .wallet-label {
        display: none !important;
    }
    
    .wallet-amount {
        font-size: 14px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    .btn-add-funds {
        padding: 4px 8px !important;
        font-size: 10px !important;
        border-radius: 12px !important;
        white-space: nowrap !important;
    }
    
    /* User avatar - smaller */
    #userProfileBtn {
        padding: 3px 5px !important;
        flex-shrink: 0 !important;
    }
    
    #userProfileBtn > div:first-child {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }
    
    #userProfileBtn > div:nth-child(2) {
        display: none !important;
    }
    
    /* Header right section - compact */
    .header-right {
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
}

/* ========================================
RESPONSIVE - EXTRA SMALL (480px to 320px)
======================================== */
@media screen and (max-width: 480px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    /* Header - ultra compact single row */
    .top-header {
        padding: 6px 8px !important;
        height: 48px !important;
        min-height: 48px !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    /* Hamburger button - smallest */
    .sidebar-toggle-btn,
    .mobile-menu-toggle {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
        margin-right: 4px !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }
    
    /* Title - single line, truncate aggressively */
    .header-title {
        font-size: 13px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 80px !important;
        margin: 0 !important;
        line-height: 1.2 !important;
        flex-shrink: 1 !important;
    }
    
    /* ✅ Hide "BUYER PORTAL" subtitle completely */
    .header-title + p,
    .header-subtitle,
    .top-header > div:first-child > p {
        display: none !important;
    }
    
    /* Wallet section - ultra compact, prevent overflow */
    .wallet-section {
        flex-direction: row !important;
        align-items: center !important;
        gap: 2px !important;
        padding: 3px 5px !important;
        flex-shrink: 1 !important;
        max-width: 110px !important;
        overflow: hidden !important;
    }
    
    .wallet-label {
        display: none !important;
    }
    
    .wallet-amount {
        font-size: 11px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    .btn-add-funds {
        padding: 2px 4px !important;
        font-size: 8px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }
    
    /* User avatar - smallest */
    #userProfileBtn {
        padding: 2px !important;
        flex-shrink: 0 !important;
    }
    
    #userProfileBtn > div:first-child {
        width: 22px !important;
        height: 22px !important;
        font-size: 10px !important;
    }
    
    #userProfileBtn > div:nth-child(2) {
        display: none !important;
    }
    
    /* Header right section - minimal */
    .header-right {
        gap: 3px !important;
        flex-shrink: 0 !important;
    }
    
    /* Search tabs - smaller */
    .search-tabs button {
        padding: 5px 8px !important;
        font-size: 10px !important;
    }
    
    /* Cards - minimal padding */
    .card {
        padding: 10px !important;
    }
    
    /* Search form - full width */
    .search-form {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .search-form input,
    .search-form select {
        font-size: 13px !important;
        padding: 8px !important;
    }
    
    /* Table - force horizontal scroll instead of overflow */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        min-width: 500px !important;
    }
    
    th, td {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
}

/* ========================================
RESPONSIVE - VERY SMALL MOBILE (400px to 320px)
======================================== */
@media screen and (max-width: 400px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    /* Header - ultra compact */
    .top-header {
        padding: 6px 8px !important;
        height: 44px !important;
        min-height: 44px !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    /* Hamburger button - smallest */
    .sidebar-toggle-btn,
    .mobile-menu-toggle {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
        margin-right: 3px !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }
    
    /* ✅ Wallet section - MINIMAL to make room for user profile */
    .top-header div[style*="background: linear-gradient"],
    .top-header div[style*="background: #f0fdf9"] {
        padding: 3px 6px !important;
        gap: 3px !important;
        border-radius: 6px !important;
        max-width: 45% !important;
        flex-shrink: 1 !important;
    }
    
    /* Hide "WALLET BALANCE" label */
    .wallet-label,
    .top-header div[style*="background: linear-gradient"] span:first-child,
    .top-header div[style*="background: #f0fdf9"] span:first-child {
        display: none !important;
    }
    
    /* Currency symbol - tiny */
    .top-header div[style*="background: linear-gradient"] div div span:first-child,
    .top-header div[style*="background: #f0fdf9"] div div span:first-child {
        font-size: 9px !important;
    }
    
    /* Wallet amount - very small */
    .wallet-amount,
    .top-header div[style*="background: linear-gradient"] div div span:last-child,
    .top-header div[style*="background: #f0fdf9"] div div span:last-child {
        font-size: 10px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    /* "+ Add Funds" button - minimal */
    .btn-add-funds,
    .top-header div[style*="background: linear-gradient"] a,
    .top-header div[style*="background: #f0fdf9"] a {
        padding: 2px 4px !important;
        font-size: 7px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }
    
    /* ✅ User Profile - MUST BE VISIBLE */
    #userProfileBtn {
        padding: 2px !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #userProfileBtn > div:first-child {
        width: 20px !important;
        height: 20px !important;
        font-size: 9px !important;
    }
    
    /* Hide user name/role text */
    #userProfileBtn > div:nth-child(2) {
        display: none !important;
    }
    
    /* Show dropdown arrow */
    #userProfileBtn i,
    #userProfileBtn svg {
        font-size: 7px !important;
    }
    
    /* Header right section - minimal */
    .header-right {
        gap: 2px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Search tabs - smaller */
    .search-tabs button {
        padding: 4px 6px !important;
        font-size: 9px !important;
    }
    
    /* Cards - minimal padding */
    .card {
        padding: 8px !important;
    }
    
    /* Search form - full width */
    .search-form {
        flex-direction: column !important;
        gap: 6px !important;
    }
    
    .search-form input,
    .search-form select {
        font-size: 12px !important;
        padding: 6px !important;
    }
    
    /* Table - force horizontal scroll */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        min-width: 400px !important;
    }
    
    th, td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
}

/* ========================================
RESPONSIVE - VERY SMALL MOBILE (360px and below)
======================================== */
@media screen and (max-width: 360px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    /* Header - ultra compact */
    .top-header {
        padding: 6px 8px !important;
        height: 44px !important;
        min-height: 44px !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    /* Hamburger button - smallest */
    .sidebar-toggle-btn,
    .mobile-menu-toggle {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
        margin-right: 3px !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }
    
    /* Wallet section - MINIMAL */
    .top-header div[style*="background: linear-gradient"],
    .top-header div[style*="background: #f0fdf9"],
    .header div[style*="background: linear-gradient"],
    .header div[style*="background: #f0fdf9"] {
        padding: 3px 6px !important;
        gap: 3px !important;
        border-radius: 6px !important;
        max-width: 40% !important;
        flex-shrink: 1 !important;
        overflow: hidden !important;
    }
    
    /* Hide "WALLET BALANCE" label */
    .wallet-label,
    .top-header div[style*="background: linear-gradient"] span:first-child,
    .top-header div[style*="background: #f0fdf9"] span:first-child,
    .header div[style*="background: linear-gradient"] span:first-child,
    .header div[style*="background: #f0fdf9"] span:first-child {
        display: none !important;
    }
    
    /* Currency symbol - tiny */
    .top-header div[style*="background: linear-gradient"] > div > span:first-child,
    .top-header div[style*="background: #f0fdf9"] > div > span:first-child,
    .header div[style*="background: linear-gradient"] > div > span:first-child,
    .header div[style*="background: #f0fdf9"] > div > span:first-child {
        font-size: 9px !important;
    }
    
    /* Wallet amount - very small */
    .wallet-amount,
    .top-header div[style*="background: linear-gradient"] > div > span:last-child,
    .top-header div[style*="background: #f0fdf9"] > div > span:last-child,
    .header div[style*="background: linear-gradient"] > div > span:last-child,
    .header div[style*="background: #f0fdf9"] > div > span:last-child {
        font-size: 10px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    /* "+ Add Funds" button - minimal */
    .btn-add-funds,
    .top-header div[style*="background: linear-gradient"] a,
    .top-header div[style*="background: #f0fdf9"] a,
    .header div[style*="background: linear-gradient"] a,
    .header div[style*="background: #f0fdf9"] a {
        padding: 2px 4px !important;
        font-size: 7px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        max-width: 50px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* User Profile button - MUST BE VISIBLE */
    #userProfileBtn {
        padding: 2px !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #userProfileBtn > div:first-child {
        width: 20px !important;
        height: 20px !important;
        font-size: 9px !important;
    }
    
    /* Hide user name/role text */
    #userProfileBtn > div:nth-child(2) {
        display: none !important;
    }
    
    /* Show dropdown arrow */
    #userProfileBtn i,
    #userProfileBtn svg {
        font-size: 7px !important;
    }
    
    /* Header right section - minimal */
    .header-right {
        gap: 2px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* ✅ PROFILE DROPDOWN - FIX POSITIONING FOR 360px */
    #userDropdown {
        position: fixed !important;
        top: 70px !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        max-width: calc(100% - 16px) !important;
        z-index: 1001 !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        background: white !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }
    
    /* Dropdown user info section */
    #userDropdown > div:first-child {
        padding: 12px !important;
        background: #f9fafb !important;
        border-bottom: 1px solid #e5e7eb !important;
        max-width: 100% !important;
    }
    
    #userDropdown h4 {
        font-size: 14px !important;
        margin: 0 0 4px 0 !important;
        color: #1f2937 !important;
        word-break: break-word !important;
    }
    
    #userDropdown p {
        font-size: 11px !important;
        margin: 0 0 8px 0 !important;
        color: #6b7280 !important;
        word-break: break-all !important;
    }
    
    /* Company badge in dropdown */
    #userDropdown .role-badge,
    #userDropdown div[style*="background: #e0f2f1"] {
        font-size: 9px !important;
        padding: 3px 6px !important;
        display: inline-block !important;
    }
    
    /* Dropdown menu items */
    #userDropdown a {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 12px 15px !important;
        font-size: 13px !important;
        color: #1f2937 !important;
        text-decoration: none !important;
        border-bottom: 1px solid #f3f4f6 !important;
        transition: background 0.2s !important;
    }
    
    #userDropdown a:hover {
        background: #f9fafb !important;
    }
    
    #userDropdown a:last-child {
        border-bottom: none !important;
    }
    
    /* Logout link - red color */
    #userDropdown a[href*="logout"] {
        color: #ef4444 !important;
    }
    
    /* Search tabs - smaller */
    .search-tabs button {
        padding: 4px 6px !important;
        font-size: 9px !important;
    }
    
    /* Cards - minimal padding */
    .card {
        padding: 8px !important;
    }
    
    /* Buttons - full width */
    button,
    .btn {
        width: 100% !important;
    }
    
    /* Search form - full width */
    .search-form {
        flex-direction: column !important;
        gap: 6px !important;
    }
    
    .search-form input,
    .search-form select {
        font-size: 12px !important;
        padding: 6px !important;
    }
    
    /* Table - force horizontal scroll */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        min-width: 400px !important;
    }
    
    th, td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
}

/* ========================================
RESPONSIVE - VERY SMALL (320px)
======================================== */
@media screen and (max-width: 320px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    /* Header - ultra compact */
    .top-header {
        padding: 6px 8px !important;
        height: 44px !important;
        min-height: 44px !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    /* Hamburger button - smallest */
    .sidebar-toggle-btn,
    .mobile-menu-toggle {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
        margin-right: 3px !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }
    
    /* ✅ Wallet section - MINIMAL to make room for user profile */
    .top-header div[style*="background: linear-gradient"],
    .top-header div[style*="background: #f0fdf9"] {
        padding: 4px 8px !important;
        gap: 4px !important;
        border-radius: 6px !important;
        max-width: 50% !important;
        flex-shrink: 1 !important;
    }
    
    /* Hide "WALLET BALANCE" label */
    .wallet-label,
    .top-header div[style*="background: linear-gradient"] span:first-child,
    .top-header div[style*="background: #f0fdf9"] span:first-child {
        display: none !important;
    }
    
    /* Currency symbol - tiny */
    .top-header div[style*="background: linear-gradient"] div div span:first-child,
    .top-header div[style*="background: #f0fdf9"] div div span:first-child {
        font-size: 10px !important;
    }
    
    /* Wallet amount - very small */
    .wallet-amount,
    .top-header div[style*="background: linear-gradient"] div div span:last-child,
    .top-header div[style*="background: #f0fdf9"] div div span:last-child {
        font-size: 11px !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    
    /* "+ Add Funds" button - minimal */
    .btn-add-funds,
    .top-header div[style*="background: linear-gradient"] a,
    .top-header div[style*="background: #f0fdf9"] a {
        padding: 2px 5px !important;
        font-size: 8px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }
    
    /* ✅ User Profile - MUST BE VISIBLE */
    #userProfileBtn {
        padding: 2px !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #userProfileBtn > div:first-child {
        width: 20px !important;
        height: 20px !important;
        font-size: 9px !important;
    }
    
    /* Hide user name/role text */
    #userProfileBtn > div:nth-child(2) {
        display: none !important;
    }
    
    /* Show dropdown arrow */
    #userProfileBtn i,
    #userProfileBtn svg {
        font-size: 7px !important;
    }
    
    /* Header right section - minimal */
    .header-right {
        gap: 2px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Search tabs - smaller */
    .search-tabs button {
        padding: 4px 6px !important;
        font-size: 9px !important;
    }
    
    /* Cards - minimal padding */
    .card {
        padding: 8px !important;
    }
    
    /* Search form - full width */
    .search-form {
        flex-direction: column !important;
        gap: 6px !important;
    }
    
    .search-form input,
    .search-form select {
        font-size: 12px !important;
        padding: 6px !important;
    }
    
    /* Table - force horizontal scroll */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        min-width: 400px !important;
    }
    
    th, td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.mobile-only {
    display: none !important;
}

/* Prevent body scroll when sidebar is open on mobile */
body.sidebar-open {
    overflow: hidden;
}

/* ========================================
COLLAPSED SIDEBAR (Desktop only)
======================================== */
.sidebar.collapsed {
    width: 70px !important;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-logo {
    display: none !important;
}

.sidebar.collapsed nav a {
    justify-content: center;
    padding: 15px 0 !important;
}

.sidebar.collapsed nav a i {
    margin: 0;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}