/* Core Variables & Reset */
:root {
    --bg-dark: #090812;
    --bg-surface: rgba(18, 17, 36, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f3fb;
    --text-secondary: #9a99b3;
    --primary: #7c4dff;
    --primary-glow: rgba(124, 77, 255, 0.4);
    --primary-gradient: linear-gradient(135deg, #7c4dff 0%, #3f51b5 100%);
    --accent-emerald: #00e676;
    --accent-gold: #ffd700;
    --accent-orange: #ff9100;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Blurs */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}

.blur-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: float 20s infinite alternate;
}

.blob1 {
    width: 450px;
    height: 450px;
    background: var(--primary);
    top: -10%;
    right: 10%;
}

.blob2 {
    width: 500px;
    height: 500px;
    background: #00e5ff;
    bottom: -15%;
    left: 10%;
    animation-delay: -5s;
}

.blob3 {
    width: 300px;
    height: 300px;
    background: #ff007f;
    top: 40%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 40px) scale(1.1); }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* Stationary Sidebar */
.sidebar {
    width: 220px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(10, 9, 22, 0.98);
    border-right: 1px solid var(--border-color);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: blur(20px);
    z-index: 1000 !important;
    pointer-events: auto !important;
    overflow-y: auto;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar.collapsed .nav-btn {
    justify-content: center !important;
    padding: 10px 0 !important;
}

.sidebar.collapsed .logo-area {
    justify-content: center !important;
}

.sidebar.collapsed .sidebar-actions {
    align-items: center;
}

.sidebar-nav button, .sidebar-actions a, .sidebar-actions button {
    position: relative;
    z-index: 1001 !important;
    pointer-events: auto !important;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 0px 8px var(--primary-glow));
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.logo-text span {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Stats Cards inside Sidebar */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(124, 77, 255, 0.3);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(124, 77, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

.stat-info .stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
}

.stat-info h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-top: 2px;
}

/* Status Indicators */
.status-idle { color: var(--accent-gold); }
.status-running { color: var(--accent-orange); animation: pulse 1.5s infinite; }
.status-completed { color: var(--accent-emerald); }
.status-error { color: #ff5252; }

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.sidebar-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.credits {
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.credits .version {
    font-family: var(--font-mono);
    color: var(--primary);
    margin-top: 4px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 220px;
    width: calc(100% - 220px);
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-text h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
}

.header-text p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.datetime-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

/* Cards & Glassmorphism */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.glass {
    backdrop-filter: blur(16px);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Configuration Card */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

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

.input-group label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input:not([type="checkbox"]):not([type="radio"]), .input-group select, select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #121124 !important;
    border: 1px solid var(--border-color) !important;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-primary) !important;
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition);
    width: 100%;
    outline: none !important;
    box-shadow: none !important;
}

input[type="checkbox"], input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--primary) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

#tender-status-multi-container label,
#multi-portal-checkboxes label,
#upcoming-multi-portal-checkboxes label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    user-select: none !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    transition: background 0.2s ease !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

#tender-status-multi-container label:hover,
#multi-portal-checkboxes label:hover,
#upcoming-multi-portal-checkboxes label:hover {
    background: rgba(124, 77, 255, 0.12) !important;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a99b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
}

.input-group input:focus, .input-group select:focus, select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(124, 77, 255, 0.3) !important;
}

select option {
    background-color: #121124 !important;
    color: #f3f3fb !important;
    padding: 10px !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.8;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.input-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Buttons */
.primary-btn {
    background: var(--primary-gradient);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.6);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.stop-btn {
    background: linear-gradient(135deg, #f857a6, #ff5858);
    box-shadow: 0 4px 14px rgba(255, 88, 88, 0.4);
}

.stop-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 88, 88, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Console Section */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.logs-header h3 {
    margin-bottom: 0;
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-orange);
    box-shadow: 0 0 8px var(--accent-orange);
    display: inline-block;
    animation: beacon 1.5s infinite;
}

@keyframes beacon {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.terminal-body {
    background: #020106;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 200px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-line {
    word-break: break-all;
}

.log-line.system { color: #5c5a78; }
.log-line.info { color: #a5a4c5; }
.log-line.warning { color: var(--accent-orange); }
.log-line.error { color: #ff5252; }
.log-line.success { color: var(--accent-emerald); }

/* Results Section Table */
.results-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.results-header h3 {
    margin-bottom: 0;
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    max-width: 100%;
}

.search-filter {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.search-filter i {
    color: var(--text-secondary);
    font-size: 12px;
}

.search-filter input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    width: 130px;
}

.table-container,
.table-responsive {
    overflow: auto;
    max-height: calc(100vh - 250px);
    min-height: 200px;
    position: relative;
}

.dashboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 12px;
}

.dashboard-table th {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    background: #14122d;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Sortable Headers */
.dashboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.dashboard-table th.sortable:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.dashboard-table th.sortable i {
    margin-left: 6px;
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: var(--transition);
}

.dashboard-table th.sortable.active-sort {
    color: var(--primary);
    font-weight: 600;
}

.dashboard-table th.sortable.active-sort i {
    color: var(--primary);
    opacity: 1;
}

/* Select option dark style */
select option {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary);
}

.dashboard-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.dashboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

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

.dashboard-table tr.no-data td {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
    font-style: italic;
}

.tender-title-cell {
    max-width: 450px;
    min-width: 250px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

.tender-id-badge {
    background: rgba(124, 77, 255, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    color: #b388ff;
    font-family: var(--font-mono);
    font-size: 10px;
}

.package-badge {
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    color: #80deea;
    font-family: var(--font-mono);
    font-size: 10px;
    white-space: nowrap;
}

.division-badge {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    color: #90caf9;
    font-size: 11px;
    white-space: nowrap;
}


.tender-cost {
    font-weight: 600;
}

.bidders-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 11px;
}

/* Modals & Popups */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 3, 9, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 600px;
    max-width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin-bottom: 0;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.close-modal-btn:hover {
    color: white;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tender-meta-summary {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.modal-table-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.modal-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    padding: 10px 16px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.modal-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.rank-badge {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
}

.rank-1 { background: rgba(0, 230, 118, 0.15); color: #00e676; border: 1px solid rgba(0, 230, 118, 0.3); }
.rank-2 { background: rgba(255, 215, 0, 0.15); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.3); }
.rank-other { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .stats-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .stat-card {
        flex: 1 1 200px;
    }
}

/* Tabs Parameter Card Styling */
.tab-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

.tab-btn.active {
    border-bottom: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    background: rgba(124, 77, 255, 0.05) !important;
}

.tab-panel {
    animation: fadeIn 0.4s ease-out;
}

.captcha-container .input-group input {
    background: rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 2px;
    font-weight: 600;
    font-size: 14px;
}

#btn-refresh-captcha:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--primary) !important;
}

/* Sidebar Nav Buttons */
.nav-btn {
    transition: var(--transition);
}
.nav-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}
.nav-btn.active {
    color: var(--primary) !important;
    background: rgba(124, 77, 255, 0.06) !important;
    box-shadow: inset 3px 0 0 0 var(--primary);
}

/* Portal Specific Styles */
.portal-badge {
    background: rgba(124, 77, 255, 0.08);
    border: 1px solid rgba(124, 77, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    color: #b388ff;
    font-size: 10px;
    white-space: nowrap;
    display: inline-block;
}

.portal-filter select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    cursor: pointer;
    padding-right: 8px;
}

.portal-selector-wrapper select {
    transition: var(--transition);
}

.portal-selector-wrapper select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.25) !important;
}

#form-add-portal input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.25);
}

/* Sticky Column & Header Styles (Frozen Headers & Columns up to Tender ID) */
.dashboard-table th.sticky-col-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 25 !important;
    background: #181635 !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Table 1 & 3: Standard Sticky Columns (Col 1, 2, 3) */
.dashboard-table th.sticky-col-1,
.dashboard-table td.sticky-col-1 {
    position: sticky !important;
    left: 0px !important;
    z-index: 5;
    background: #0f0d22;
}

.dashboard-table th.sticky-col-2,
.dashboard-table td.sticky-col-2 {
    position: sticky !important;
    left: 40px !important;
    z-index: 5;
    background: #0f0d22;
}

.dashboard-table th.sticky-col-3,
.dashboard-table td.sticky-col-3 {
    position: sticky !important;
    left: 360px !important;
    z-index: 5;
    background: #0f0d22;
    box-shadow: 5px 0 10px rgba(0, 0, 0, 0.45);
}

/* Table 2: Upcoming Tenders Sticky Columns (Col 1, 2, 3, 4) */
.dashboard-table th.sticky-upcoming-1,
.dashboard-table td.sticky-upcoming-1 {
    position: sticky !important;
    left: 0px !important;
    z-index: 5;
    background: #0f0d22;
}

.dashboard-table th.sticky-upcoming-2,
.dashboard-table td.sticky-upcoming-2 {
    position: sticky !important;
    left: 40px !important;
    z-index: 5;
    background: #0f0d22;
}

.dashboard-table th.sticky-upcoming-3,
.dashboard-table td.sticky-upcoming-3 {
    position: sticky !important;
    left: 80px !important;
    z-index: 5;
    background: #0f0d22;
}

.dashboard-table th.sticky-upcoming-4,
.dashboard-table td.sticky-upcoming-4 {
    position: sticky !important;
    left: 380px !important;
    z-index: 5;
    background: #0f0d22;
    box-shadow: 5px 0 10px rgba(0, 0, 0, 0.45);
}

.dashboard-table th.sticky-col-header.sticky-col-1,
.dashboard-table th.sticky-col-header.sticky-col-2,
.dashboard-table th.sticky-col-header.sticky-col-3,
.dashboard-table th.sticky-col-header.sticky-upcoming-1,
.dashboard-table th.sticky-col-header.sticky-upcoming-2,
.dashboard-table th.sticky-col-header.sticky-upcoming-3,
.dashboard-table th.sticky-col-header.sticky-upcoming-4 {
    z-index: 30 !important;
}

.dashboard-table tr:hover td.sticky-col-1,
.dashboard-table tr:hover td.sticky-col-2,
.dashboard-table tr:hover td.sticky-col-3,
.dashboard-table tr:hover td.sticky-upcoming-1,
.dashboard-table tr:hover td.sticky-upcoming-2,
.dashboard-table tr:hover td.sticky-upcoming-3,
.dashboard-table tr:hover td.sticky-upcoming-4 {
    background: #1d1942 !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM (MOBILE, TABLET, DESKTOP)
   ========================================================================== */

/* Mobile Top Header (hidden on desktop) */
.mobile-top-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(10, 9, 22, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1005;
    width: 100%;
    backdrop-filter: blur(16px);
}

#btn-mobile-menu-toggle {
    background: rgba(124, 77, 255, 0.15);
    color: var(--primary);
    border: 1px solid rgba(124, 77, 255, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.mobile-logo-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Off-canvas Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.sidebar-backdrop.active {
    display: block;
}

/* Tablets & Mobile Screens (< 992px) */
@media (max-width: 992px) {
    .mobile-top-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 1010 !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

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

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 14px 14px 30px 14px !important;
    }
}

/* Medium Screens & Small Tablets (< 768px) */
@media (max-width: 768px) {
    .portal-selector-wrapper > div {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .portal-mode-toggle, .upcoming-portal-mode-toggle {
        width: 100% !important;
        justify-content: center !important;
    }

    .btn-portal-mode, .btn-upcoming-portal-mode {
        flex: 1 !important;
        text-align: center !important;
    }

    .tabs-header {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .actions-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .actions-left, .actions-right {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .search-box {
        width: 100% !important;
        max-width: none !important;
    }

    .search-box input {
        width: 100% !important;
    }

    .portal-filter, .status-filter {
        width: 100% !important;
    }

    .portal-filter select, .status-filter select {
        width: 100% !important;
    }

    .table-footer {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* Disable frozen columns on mobile touch screens to prevent content overlap */
    .dashboard-table th.sticky-col-2,
    .dashboard-table td.sticky-col-2,
    .dashboard-table th.sticky-col-3,
    .dashboard-table td.sticky-col-3,
    .dashboard-table th.sticky-upcoming-2,
    .dashboard-table td.sticky-upcoming-2,
    .dashboard-table th.sticky-upcoming-3,
    .dashboard-table td.sticky-upcoming-3,
    .dashboard-table th.sticky-upcoming-4,
    .dashboard-table td.sticky-upcoming-4 {
        position: static !important;
        box-shadow: none !important;
    }
}

/* Small Mobile Screens (< 576px) */
@media (max-width: 576px) {
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .input-group[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }

    #tender-status-multi-container,
    #multi-portal-checkboxes,
    #upcoming-multi-portal-checkboxes {
        grid-template-columns: 1fr !important;
    }

    .modal-content {
        width: 95% !important;
        padding: 16px !important;
        margin: 10px auto !important;
    }
}


