/* ========================================================================
   MASTER COLOR SYSTEM - SINGLE SOURCE OF TRUTH
   This file loads LAST and overrides everything else
   All color changes should be made HERE and ONLY here
   ======================================================================== */

/* ========================================================================
   CSS VARIABLES - Use these in other files for consistency
   ======================================================================== */
:root {
    /* Sidebar Colors */
    --sidebar-link-color: #ffffff;
    --sidebar-link-bg: rgba(255, 255, 255, 0.1);
    --sidebar-link-hover-bg: rgba(255, 255, 255, 0.15);
    --sidebar-dashboard-bg: #e9ecef;
    --sidebar-dashboard-color: #212529;
    --sidebar-dashboard-border: #dee2e6;
    
    /* Button Background - Muted */
    --sidebar-button-bg: rgba(108, 117, 125, 0.08);
    --sidebar-button-border: #dee2e6;
    
    /* Icon Colors - Colorful */
    --icon-green: #28a745;
    --icon-indigo: #6610f2;
    --icon-pink: #e83e8c;
    --icon-lime: #87ce32;
    --icon-orange: #ffc107;
    --icon-cyan: #17a2b8;
    --icon-purple: #6f42c1;
    --icon-teal: #20c997;
    --icon-red: #dc3545;
    --icon-gray: #6c757d;
    --icon-blue: #007bff;
}

/* ========================================================================
   SIDEBAR COLORS
   ======================================================================== */

/* General Sidebar Links - Default White on Dark Background */
html body #sidebar a,
html body .sidebar a {
    color: var(--sidebar-link-color) !important;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin: 6px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    background: var(--sidebar-link-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

html body #sidebar a:hover,
html body .sidebar a:hover {
    background: var(--sidebar-link-hover-bg);
    transform: translateX(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Dashboard Link - Light Gray Background with Dark Text */
/* MUST come after .sidebar a:hover to override */
/* Using ID selector + html body for MAXIMUM specificity */
html body #sidebar a.dashboard-link,
html body #sidebar a.dashboard-link:visited,
html body #sidebar a.dashboard-link:link,
html body #sidebar a.dashboard-link:hover,
html body #sidebar a.dashboard-link:active,
html body #sidebar a.dashboard-link:focus {
    background: #212529 !important;
    color: #e9ecef !important;
    border: 1px solid #dee2e6 !important;
}

/* Dashboard Icon - Blue */
html body #sidebar a.dashboard-link i.bi-house-door-fill {
    color: #007bff !important;
}

/* Sidebar Button Backgrounds - All Muted Gray */
.sidebar a.my-gages-btn,
.sidebar a.browse-request-gages-btn,
.sidebar a.transfer-requests-btn,
.sidebar a.calibration-calendar-btn,
.sidebar a.regional-dashboard-btn,
.sidebar a.national-overview-btn,
.sidebar a.manage-gages-btn,
.sidebar a.manage-users-btn,
.sidebar a.manage-assignments-btn,
.sidebar a.generate-report-btn,
.sidebar a.service-excellence-btn,
.sidebar a.settings-btn,
.sidebar a.logout-btn {
    background: rgba(108, 117, 125, 0.08) !important;
    border-left: 4px solid #dee2e6 !important;
    color: #ffffff !important;
}

.sidebar a.my-gages-btn:hover,
.sidebar a.browse-request-gages-btn:hover,
.sidebar a.transfer-requests-btn:hover,
.sidebar a.calibration-calendar-btn:hover,
.sidebar a.regional-dashboard-btn:hover,
.sidebar a.national-overview-btn:hover,
.sidebar a.manage-gages-btn:hover,
.sidebar a.manage-users-btn:hover,
.sidebar a.manage-assignments-btn:hover,
.sidebar a.generate-report-btn:hover,
.sidebar a.service-excellence-btn:hover,
.sidebar a.settings-btn:hover,
.sidebar a.logout-btn:hover {
    background: rgba(108, 117, 125, 0.15) !important;
}

/* Sidebar Icon Colors - Colorful for Visual Distinction */
.sidebar a i.bi-box-seam-fill { color: #28a745 !important; } /* My Gages - Green */
.sidebar a i.bi-box-seam { color: #8b5cf6 !important; } /* Gage Operations - Purple */
.sidebar a i.bi-search { color: #17a2b8 !important; } /* Browse - Cyan */
.sidebar a i.bi-rulers { color: #6610f2 !important; } /* Manage Gages - Indigo */
.sidebar a i.bi-people { color: #e83e8c !important; } /* Manage Users - Pink */
.sidebar a i.bi-list-task { color: #87ce32 !important; } /* Assignments - Lime */
.sidebar a i.bi-arrow-left-right { color: #ffc107 !important; } /* Transfer - Orange */
.sidebar a i.bi-calendar-check { color: #17a2b8 !important; } /* Calendar - Cyan */
.sidebar a i.bi-globe-americas { color: #eab308 !important; } /* National - Gold */
.sidebar a i.bi-graph-up { color: #20c997 !important; } /* Reports - Teal */
.sidebar a i.bi-cloud-arrow-up { color: #fd7e14 !important; } /* Service - Orange */
.sidebar a i.bi-gear { color: #adb5bd !important; } /* Settings - Gray */
.sidebar a i.bi-box-arrow-right { color: #dc3545 !important; } /* Logout - Red */

/* ========================================================================
   CARD & HEADER COLORS
   ======================================================================== */

/* Card Background - Subtle Blue-Tinted Dark */
.card {
    background: linear-gradient(135deg, #1a1f2e 0%, #16202d 100%) !important;
    border: 1px solid rgba(100, 150, 200, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important;
}

.card-header {
    background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%) !important;
    border-bottom: 1px solid rgba(100, 150, 200, 0.15) !important;
    padding: 18px 24px !important;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%) !important;
    border-bottom: 1px solid rgba(100, 150, 200, 0.2) !important;
}

/* ========================================================================
   BUTTON COLORS
   ======================================================================== */

/* Primary Action Buttons */
.btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

/* Success Buttons */
.btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background-color: #218838 !important;
    border-color: #218838 !important;
}

/* Danger Buttons */
.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #c82333 !important;
}

/* Warning Buttons */
.btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}

.btn-warning:hover {
    background-color: #e0a800 !important;
    border-color: #e0a800 !important;
}

/* Info Buttons */
.btn-info {
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: #ffffff !important;
}

.btn-info:hover {
    background-color: #138496 !important;
    border-color: #138496 !important;
}

/* Secondary Buttons */
.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.btn-secondary:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
}

/* ========================================================================
   STATUS COLORS
   ======================================================================== */

.badge-available { background-color: #28a745 !important; color: #ffffff !important; }
.badge-assigned { background-color: #6c757d !important; color: #ffffff !important; }
.badge-overdue { background-color: #dc3545 !important; color: #ffffff !important; }
.badge-due-soon { background-color: #ffc107 !important; color: #212529 !important; }

/* ========================================================================
   LIST VIEW TABLE - FORCE WHITE TEXT
   ======================================================================== */

/* Force white text in list view table */
#gagesTable,
#gagesTable thead,
#gagesTable thead th,
#gagesTable tbody,
#gagesTable tbody tr,
#gagesTable tbody td {
    color: #ffffff !important;
}

/* Ensure table headers are bright white */
#gagesTable thead th {
    color: #ffffff !important;
    font-weight: 500 !important;
}

/* Ensure table body cells are bright white */
#gagesTable tbody td {
    color: #ffffff !important;
    font-weight: 400 !important;
}

/* Keep gage number links visible */
#gagesTable tbody td a {
    color: #ffc107 !important;
    font-weight: 500 !important;
}

/* ========================================================================
   ALL TABLES - DARK THEME (SINGLE SOURCE OF TRUTH)
   ======================================================================== */

/* Force dark theme on ALL tables */
.table,
.table thead,
.table tbody {
    background: transparent !important;
}

.table thead th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #b0b0b0 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.table tbody td {
    color: #e0e0e0 !important;
    background: transparent !important;
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Card body should be transparent so dark card background shows */
.card-body {
    background: transparent !important;
}

/* ========================================================================
   END OF MASTER COLOR SYSTEM
   ======================================================================== */
