@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
/* 
   HSE MANAGEMENT SYSTEM - MIDNIGHT NEO DESIGN
   Color Palette:
   - Primary: #10b981 (Emerald Green)
   - Secondary: #3b82f6 (Blue)
   - Warning: #f59e0b (Amber)
   - Danger: #ef4444 (Red)
   - Dark: #0f172a / #1e293b
*/

:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --secondary: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.midnight-neo {
    font-family: 'Montserrat', sans-serif;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

h1,
h2,
h3,
.brand-text {
    font-family: 'Montserrat', sans-serif;
}

/* Search & Brand Section (Below Fixed Header) */
.search-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 2rem 1.5rem 2rem;
    text-align: center;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #10b981 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Search Bar */
.search-bar {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: var(--transition);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    color: var(--text-muted);
}

#globalSearch {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
}

#globalSearch::placeholder {
    color: var(--text-muted);
}

/* User Profile info styles removed (using standard header) */

/* Dashboard Grid */
.dashboard-content {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    position: relative;
    min-height: 400px;
}

/* Responsive Grid */
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Glass Card Style */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-shadow: var(--card-shadow);
}

.glass-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Module Icon Colors */
.card-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.card-icon svg {
    width: 14px;
    height: 14px;
}

.icon-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.icon-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--secondary);
}

.icon-amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.icon-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Card Content */
.card-header h3 {
    font-size: 0.85rem;
    margin-bottom: 0;
    color: var(--text-main);
}

.card-desc {
    display: none;
    /* Hidden for extra small view */
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.status-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-live {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.btn-more {
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.btn-more svg {
    width: 10px;
    height: 10px;
}

.btn-more:hover {
    gap: 0.75rem;
}

/* Loading Overlay */
.loading-overlay {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1000;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0.5rem;
    min-width: 100px;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0rem;
    position: relative;
}

#modalTitle {
    margin: 0;
    text-align: center;
    width: 100%;
}

.close-modal {
    position: absolute;
    right: 0;
    top: -10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

/* Table Styles inside cards/modals */
.hse-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.hse-table th {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--glass-border);
}

.hse-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .hse-table {
        min-width: 600px;
    }
    .hse-table th, .hse-table td {
        white-space: nowrap;
    }
    .hse-table .col-content-wide {
        white-space: normal;
        min-width: 250px;
        width: 100%;
    }
}

/* Gallery inside Modals */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.img-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.img-thumb:hover {
    transform: scale(1.05);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0.6rem 0 0.5rem 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--bs-heading-color)
}
/* --- Table Cell Image Styles --- */
.cell-image-container {
    position: relative;
    width: 60px;
    height: 40px;
    margin: 0 auto;
    border-radius: 4px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--glass-border);
    transition: var(--transition);
}

.cell-image-container:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.table-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.table-img-thumb:hover {
    filter: brightness(1.1);
}

.btn-cell-upload {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border: 2px solid #1e293b;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-cell-upload svg {
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

.btn-cell-upload:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

.btn-cell-delete {
    position: absolute;
    bottom: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    border: 2px solid #1e293b;
    border-radius: 50%;
    color: white;
    vertical-align: middle;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-cell-delete svg {
    width: 12px;
    height: 12px;
}

.btn-cell-delete:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.cell-image-container.empty {
    width: auto;
    min-width: 100px;
    height: auto;
    border: none;
    background: transparent;
}

.btn-cell-upload.large {
    position: static;
    width: 100%;
    height: auto;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-cell-upload.large svg {
    width: 14px;
    height: 14px;
}

.btn-cell-upload.large:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: none;
}

.upload-progress-overlay {
    animation: fadeIn 0.3s ease;
}

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

/* Permission Modal Styles */
#permission-modal .modal-content {
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* ==========================================================================
   CATEGORY PILL TABS
   ========================================================================== */
.category-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.tab-pill {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    color: var(--text-muted);
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    outline: none;
}

.tab-pill:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.tab-pill.active {
    background: rgba(16, 185, 129, 0.16);
    border-color: var(--primary);
    color: #34d399;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.tab-count {
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    color: var(--text-muted);
    font-weight: 600;
}

.tab-pill.active .tab-count {
    background: var(--primary);
    color: #042f2e;
    font-weight: 700;
}

/* ==========================================================================
   WORKSPACE INLINE VIEW LAYOUT
   ========================================================================== */
.view-section {
    animation: fadeIn 0.35s ease;
}

.workspace-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 12px;
    padding: 1.1rem 1.75rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--card-shadow);
}

.workspace-nav-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-back-hub {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-back-hub:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary);
    color: #34d399;
    transform: translateX(-3px);
}

.workspace-title-box {
    display: flex;
    flex-direction: column;
}

.workspace-breadcrumb {
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.workspace-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.workspace-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.workspace-body {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 550px;
    box-shadow: var(--card-shadow);
    position: relative;
}

/* ==========================================================================
   WORKSPACE ENHANCEMENTS: TABLE & SEARCH & MONTHS
   ========================================================================== */
.workspace-search-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.workspace-search-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.55rem 1rem;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    min-width: 260px;
    transition: var(--transition);
}

.workspace-search-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    max-height: 72vh;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hse-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.hse-table thead th {
    position: sticky;
    top: 0;
    background: #1e293b;
    z-index: 10;
    border-bottom: 2px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    white-space: nowrap;
}

.hse-table tbody tr {
    transition: var(--transition);
}

.hse-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Month Grid Improvements */
.month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.month-card {
    cursor: pointer;
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: var(--transition);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.month-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.card-category-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: block;
}

/* ==========================================================================
   LIGHTBOX NAVIGATION BUTTONS & COUNTER
   ========================================================================== */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    z-index: 10002;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    outline: none;
}

.lightbox-nav-btn:hover {
    background: rgba(16, 185, 129, 0.9);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.55);
}

.lightbox-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-nav-btn.prev {
    left: 28px;
}

.lightbox-nav-btn.next {
    right: 28px;
}

.lightbox-counter-badge {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    padding: 6px 18px;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 10001;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .lightbox-nav-btn {
        width: 44px;
        height: 44px;
    }
    .lightbox-nav-btn.prev {
        left: 12px;
    }
    .lightbox-nav-btn.next {
        right: 12px;
    }
    .lightbox-counter-badge {
        top: 16px;
        font-size: 0.8rem;
        padding: 4px 14px;
    }
}

/* ==========================================================================
   EQUIPMENT CHECKLIST REDESIGN STYLES
   ========================================================================== */
.chk-month-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    scrollbar-width: thin;
}
.chk-month-tab {
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.chk-month-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.chk-month-tab.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.15));
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.chk-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.chk-kpi-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(8px);
}
.chk-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chk-kpi-icon.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.chk-kpi-icon.icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.chk-kpi-icon.icon-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.chk-kpi-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.chk-kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

.chk-form-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.chk-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.chk-form-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chk-form-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.chk-input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.chk-input-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.chk-input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.chk-device-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.chk-device-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.chk-device-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #f1f5f9;
}
.chk-toggle-group {
    display: flex;
    gap: 0.4rem;
}
.chk-toggle-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.chk-toggle-btn.btn-pass:hover, .chk-toggle-btn.btn-pass.active {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    color: #34d399;
}
.chk-toggle-btn.btn-fail:hover, .chk-toggle-btn.btn-fail.active {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #f87171;
}

.chk-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-quick-pass {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-quick-pass:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}
.btn-chk-save {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: var(--transition);
}
.btn-chk-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.badge-chk-pass {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.badge-chk-fail {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.badge-chk-na {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}
.btn-edit-row {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-edit-row:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================================================================
   MODULE: 5S RACE (THI ĐUA 5S & BẢNG XẾP HẠNG LEADERBOARD)
   ========================================================================== */
.race-tab-switch {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.5rem;
    gap: 4px;
}
.race-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.race-tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.race-podium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: end;
    margin-bottom: 2rem;
}
.race-podium-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.race-podium-card:hover {
    transform: translateY(-4px);
}
.podium-rank-1 {
    order: 2;
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.7) 100%);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.15);
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.podium-rank-2 {
    order: 1;
    border-color: rgba(148, 163, 184, 0.4);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}
.podium-rank-3 {
    order: 3;
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.podium-crown {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
    display: block;
    animation: floatCrown 3s ease-in-out infinite;
}
@keyframes floatCrown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.podium-badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.badge-gold { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-silver { background: rgba(148, 163, 184, 0.2); color: #e2e8f0; border: 1px solid rgba(148, 163, 184, 0.4); }
.badge-bronze { background: rgba(217, 119, 6, 0.2); color: #f59e0b; border: 1px solid rgba(217, 119, 6, 0.4); }

.podium-area-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}
.podium-score {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.podium-rank-1 .podium-score { color: #fbbf24; text-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
.podium-rank-2 .podium-score { color: #e2e8f0; }
.podium-rank-3 .podium-score { color: #f59e0b; }

.race-score-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.race-score-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-excellent { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-good { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-warning { background: linear-gradient(90deg, #ef4444, #f87171); }

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}
.trend-up { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.trend-down { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.trend-same { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* ==========================================================================
   MODULE: TOOLS & INVENTORY (CCDC & TIÊU CHUẨN LOẠI BỎ)
   ========================================================================== */
.tools-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.tools-filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tool-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.tool-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.view-mode-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px;
}
.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}
.view-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.tools-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.tool-item-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}
.tool-item-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}
.tool-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.tool-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    margin: 0;
}
.tool-code-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.tool-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

/* Disposal Standards Cards */
.disposal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.disposal-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.35rem;
    transition: var(--transition);
}
.disposal-card:hover {
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}
.criterion-box {
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}
.criterion-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}
.criterion-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fde68a;
}

/* ==========================================================================
   MODULE: SCRAP CATEGORIES (PHÂN LOẠI PHẾ LIỆU MÃ MÀU)
   ========================================================================== */
.scrap-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.scrap-group-card {
    background: var(--glass-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.scrap-group-card:hover {
    transform: translateY(-3px);
}
.scrap-yellow {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, rgba(15, 23, 42, 0.6) 100%);
}
.scrap-blue {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.06) 0%, rgba(15, 23, 42, 0.6) 100%);
}
.scrap-red {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.06) 0%, rgba(15, 23, 42, 0.6) 100%);
}
.scrap-gray {
    border-color: rgba(148, 163, 184, 0.4);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.06) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.scrap-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.scrap-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    box-shadow: 0 0 10px currentColor;
}
.scrap-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.scrap-item-row {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* ==========================================================================
   MODULE: JOB PLAN & CLEAN SCHEDULE (KẾ HOẠCH & LỊCH TRỰC)
   ========================================================================== */
.duty-spotlight-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.deadline-badge-overdue {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.deadline-badge-soon {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.deadline-badge-done {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

@media (max-width: 768px) {
    .race-podium-grid {
        grid-template-columns: 1fr;
    }
    .podium-rank-1 { order: 1; }
    .podium-rank-2 { order: 2; }
    .podium-rank-3 { order: 3; }
    .scorecards-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Monthly Scorecards Showcase */
.scorecards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}
.scorecard-month-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 14px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.scorecard-month-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.scorecard-card-header {
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.scorecard-card-img-wrap {
    position: relative;
    cursor: pointer;
    background: #0f172a;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.scorecard-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.3s ease;
}
.scorecard-card-img-wrap:hover .scorecard-card-img {
    transform: scale(1.04);
}
.scorecard-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 0.4rem;
}
.scorecard-card-img-wrap:hover .scorecard-card-overlay {
    opacity: 1;
}
.scorecard-card-footer {
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.scorecard-origin-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.scorecard-month-select {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}
.scorecard-month-select:hover, .scorecard-month-select:focus {
    border-color: var(--primary);
}

