/* KIM LONG MOTOR - EHS Portal Stylesheet */

/* ==========================================================================
   1. VARIABLES & THEMES
   ========================================================================== */
:root {
    /* Color Palette - Light Mode */
    --primary-hsl: 156, 72%, 35%; /* Emerald green */
    --primary: hsl(var(--primary-hsl));
    --primary-hover: hsl(156, 72%, 28%);
    --primary-light: hsl(156, 72%, 95%);
    --primary-glow: rgba(16, 185, 129, 0.15);
    
    --secondary-hsl: 185, 60%, 45%; /* Teal */
    --secondary: hsl(var(--secondary-hsl));
    
    --bg-app: #f4f7f6;
    --bg-sidebar: #0f1d19; /* Very dark green/navy */
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-color: rgba(16, 185, 129, 0.12);
    
    --text-main: #2d3a36;
    --text-muted: #6b7a74;
    --text-on-dark: #e8f5e9;
    
    /* Hazard Level Colors */
    --color-high: #ef4444; /* Red */
    --color-medium: #f59e0b; /* Orange/Yellow */
    --color-low: #10b981; /* Green */
    
    /* Glassmorphism Variables */
    --glass-blur: 16px;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.04);
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-app: #080d0b;
    --bg-sidebar: #050a08;
    --bg-card: rgba(20, 32, 28, 0.8);
    --border-color: rgba(16, 185, 129, 0.2);
    
    --text-main: #e2f1ec;
    --text-muted: #8ca39a;
    
    --primary-light: rgba(16, 185, 129, 0.08);
    --primary-glow: rgba(16, 185, 129, 0.3);
    
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
}

ul {
    list-style: none;
}

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

button, input, select {
    font-family: inherit;
    outline: none;
}

/* ==========================================================================
   3. LAYOUT CONTAINER
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* ==========================================================================
   4. SIDEBAR STYLE
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
}

.logo-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--secondary);
}

/* Menu Items */
.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-menu ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(232, 245, 233, 0.7);
    transition: var(--transition);
}

.menu-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: var(--transition);
}

.menu-item:hover a {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.menu-item.active a {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.menu-item.active .menu-icon {
    transform: scale(1.1);
}

/* Footer / Theme Button */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.theme-icon {
    width: 18px;
    height: 18px;
}

.sidebar-credit {
    font-size: 0.68rem;
    color: rgba(232, 245, 233, 0.4);
    text-align: center;
    line-height: 1.4;
}

/* ==========================================================================
   5. MAIN CONTENT & HEADER
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: var(--header-height);
    background-color: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: var(--transition);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-app);
    padding: 8px 16px;
    border-radius: 30px;
    width: 380px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.header-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background-color: var(--bg-card);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.header-search input {
    border: none;
    background: none;
    width: 100%;
    color: var(--text-main);
    font-size: 0.9rem;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--color-low);
    box-shadow: 0 0 8px var(--color-low);
}

.profile-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.content-wrapper {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

/* ==========================================================================
   6. GLOBAL APP CLASSES (GLASSMORPHISM, ETC.)
   ========================================================================== */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass {
    background-color: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.glass:hover {
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.06);
}

.section-header {
    margin-bottom: 28px;
}

.section-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   7. DASHBOARD STYLE
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.metric-icon svg {
    width: 26px;
    height: 26px;
}

.bg-emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.bg-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 82, 246, 0.2);
}

.bg-orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.bg-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.metric-details h3 {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
}

.metric-details p {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dashboard-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

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

.chart-card {
    padding: 24px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.chart-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
}

.svg-chart-wrapper {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 500;
}

.legend-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Info Cards */
.info-card {
    padding: 24px;
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* Timeline Layout */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 15px;
    bottom: -25px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 4px;
    z-index: 2;
}

.timeline-content {
    flex: 1;
}

.timeline-time {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 2px 0 4px 0;
}

.timeline-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Quick links tiles */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.quick-link-tile {
    padding: 18px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    color: #ffffff;
    transition: var(--transition);
}

.tile-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-icon svg {
    width: 20px;
    height: 20px;
}

.tile-emerald {
    background: linear-gradient(135deg, #10b981, #047857);
}

.tile-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.tile-red {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.tile-orange {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.quick-link-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.safety-slogan-box {
    background-color: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.slogan-icon {
    font-size: 1.3rem;
}

.slogan-text strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
}

.slogan-text p {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--text-muted);
}

/* ==========================================================================
   8. TABLES & DATA LISTS
   ========================================================================== */
.filters-bar {
    padding: 20px 24px;
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

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

.filter-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input, .filter-group select {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-group input:focus, .filter-group select:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

.search-group {
    flex: 2;
}

/* Table Design */
.table-card {
    padding: 12px;
}

.table-responsive {
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.92rem;
    table-layout: fixed;
}

/* Fixed column widths for chemicals table
   Total: 4 + 24 + 11 + 4 + (6×4=24) + 12 + 10 = ~89% (remaining distributed) */
.col-stt { width: 4%; }
.col-name { width: 24%; }
.col-workshop { width: 11%; }
.col-unit { width: 4%; }
.col-inv { width: 6.5%; }
.col-hazard { width: 12%; }
.col-msds { width: 10%; }

/* Chemical name column - allow text wrapping for long names */
.data-table td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
}

/* Workshop column - allow wrapping */
.data-table td:nth-child(3),
.data-table th:nth-child(3) {
    white-space: normal;
    word-break: break-word;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--primary-light);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Dark mode sticky header */
[data-theme="dark"] .data-table th {
    background-color: hsl(156, 30%, 12%);
}

/* GHS hazard pictogram images */
.ghs-icons-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.ghs-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: help;
}
.ghs-icon-img:hover {
    transform: scale(1.4);
    z-index: 5;
    position: relative;
}
/* JS-based floating sticky header */
.floating-table-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    pointer-events: auto;
    background: var(--primary-light);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid var(--primary);
}
.floating-table-header .floating-header-table {
    margin: 0;
}
.floating-table-header .floating-header-table th {
    position: static;
    box-shadow: none;
}
[data-theme="dark"] .floating-table-header {
    background: hsl(156, 30%, 12%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.data-table tr:hover td {
    background-color: rgba(16, 185, 129, 0.02);
}

/* Sub-header row for inventory columns */
.sub-header-row th {
    font-size: 0.72rem !important;
    padding: 6px 12px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    opacity: 0.85;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Inventory cells */
.inv-cell {
    text-align: right !important;
    white-space: nowrap;
    font-size: 0.88rem;
}

/* Year selector button in table header */
.year-select-btn {
    padding: 5px 16px;
    border-radius: 8px;
    border: 2px solid hsl(156, 72%, 35%);
    background: linear-gradient(135deg, hsl(156, 60%, 94%), hsl(156, 50%, 88%));
    color: hsl(156, 60%, 22%);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    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='%23166534'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 24px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}
.year-select-btn:hover {
    background: linear-gradient(135deg, hsl(156, 65%, 88%), hsl(156, 55%, 82%));
    border-color: hsl(156, 72%, 28%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.year-select-btn:focus {
    outline: 2px solid hsl(156, 72%, 35%);
    outline-offset: 2px;
}
.year-select-btn option {
    background: #1a2332;
    color: #fff;
    font-weight: 700;
}

/* Dark mode year selector */
[data-theme="dark"] .year-select-btn {
    background: linear-gradient(135deg, hsl(156, 40%, 18%), hsl(156, 35%, 14%));
    color: hsl(156, 70%, 75%);
    border-color: hsl(156, 50%, 35%);
    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='%2368d9a8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}
[data-theme="dark"] .year-select-btn:hover {
    background: linear-gradient(135deg, hsl(156, 45%, 22%), hsl(156, 40%, 18%));
    border-color: hsl(156, 60%, 45%);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
}

.badge-high {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-high);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-medium {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-medium);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-low {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-low);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* GHS Pictograms Icons */
.ghs-icons-cell {
    display: flex;
    gap: 6px;
}

.ghs-mini-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: help;
}

/* Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 6px;
}

.page-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.page-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button general */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-open-pdf {
    background-color: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.btn-open-pdf:hover {
    background-color: #dc2626;
    color: #ffffff;
}

/* ==========================================================================
   9. MSDS LIBRARY STYLE
   ========================================================================== */
.msds-controls-bar {
    padding: 18px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msds-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-app);
    padding: 10px 18px;
    border-radius: 30px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.msds-search-box:focus-within {
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 10px var(--primary-glow);
}

.msds-search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.msds-search-box input {
    border: none;
    background: none;
    width: 100%;
    color: var(--text-main);
    font-size: 0.95rem;
}

.msds-shop-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.msds-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.msds-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.msds-tab.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.msds-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* MSDS Card Item */
.msds-item-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
}

.msds-card-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.pdf-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-high);
    font-weight: 800;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.msds-info {
    flex: 1;
}

.msds-info h4 {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.msds-info p {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.msds-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.shop-badge {
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: block;
    width: 100%;
    box-sizing: border-box;
    letter-spacing: 0.2px;
    line-height: 1.3;
    text-align: center;
    border: 1px solid transparent;
}

/* Workshop color palette - each workshop gets a unique color */
.shop-xuong-lap-rap {
    background-color: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.25);
}
.shop-xuong-son {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}
.shop-to-hop-dot-dap {
    background-color: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
}
.shop-to-hop-gc-thep {
    background-color: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
    border-color: rgba(168, 85, 247, 0.2);
}
.shop-ban-hsse {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.25);
}
.shop-xuong-han {
    background-color: rgba(249, 115, 22, 0.1);
    color: #c2410c;
    border-color: rgba(249, 115, 22, 0.2);
}
.shop-xuong-gcck {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.2);
}
.shop-kho-vat-tu {
    background-color: rgba(120, 113, 108, 0.1);
    color: #57534e;
    border-color: rgba(120, 113, 108, 0.2);
}
.shop-nm-dong-co {
    background-color: rgba(236, 72, 153, 0.1);
    color: #be185d;
    border-color: rgba(236, 72, 153, 0.2);
}
.shop-xuong-composite {
    background-color: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.2);
}
.shop-xuong-bao-tri {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.2);
}
.shop-xuong-pdi {
    background-color: rgba(20, 184, 166, 0.1);
    color: #0f766e;
    border-color: rgba(20, 184, 166, 0.2);
}
.shop-phong-ky-thuat {
    background-color: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
    border-color: rgba(139, 92, 246, 0.2);
}
.shop-xuong-mau {
    background-color: rgba(251, 191, 36, 0.12);
    color: #92400e;
    border-color: rgba(251, 191, 36, 0.3);
}
.shop-toan-nha-may {
    background-color: rgba(100, 116, 139, 0.1);
    color: #475569;
    border-color: rgba(100, 116, 139, 0.2);
}

/* Dark mode: boost text brightness for workshop badges */
[data-theme="dark"] .shop-badge {
    filter: brightness(1.3);
}

.btn-open-link {
    padding: 6px 12px;
    border-radius: 6px;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-open-link:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 10px var(--primary-glow);
}

/* ==========================================================================
   10. DOCUMENTS EXPLORER STYLE
   ========================================================================== */
.explorer-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .explorer-layout {
        grid-template-columns: 1fr;
    }
}

.explorer-tree-card {
    padding: 20px;
    height: 600px;
    overflow-y: auto;
}

.explorer-tree-card h3, .explorer-files-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.explorer-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tree-folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.tree-folder-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.tree-folder-item.active {
    background-color: var(--primary);
    color: #ffffff;
}

.tree-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.explorer-files-card {
    padding: 24px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

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

.explorer-search input {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-main);
    font-size: 0.85rem;
    width: 240px;
}

.explorer-search input:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

.explorer-files-container {
    flex: 1;
    overflow-y: auto;
}

.explorer-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* File Tiles */
.file-tile-item {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 140px;
    justify-content: space-between;
    transition: var(--transition);
}

.file-tile-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 6px 15px rgba(0,0,0,0.04);
}

.file-tile-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.file-tile-top h4 {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
}

.doc-tile-docx {
    background-color: #2b579a;
}

.doc-tile-xlsx {
    background-color: #217346;
}

.doc-tile-pptx {
    background-color: #b7472a;
}

.doc-tile-pdf {
    background-color: #d24726;
}

.doc-tile-unknown {
    background-color: #7f8c8d;
}

.file-tile-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-tile-size {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.file-tile-btn {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
}

.file-tile-btn:hover {
    text-decoration: underline;
}

/* ==========================================================================
   11. EMERGENCY RESPONSE STYLE
   ========================================================================== */
.emergency-flow-card {
    padding: 32px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.emergency-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.danger-alert {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-high);
    border: 1px solid var(--color-high);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.emergency-flow-card h2 {
    font-size: 1.3rem;
    margin-bottom: 24px;
}

.spill-flowchart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 1024px) {
    .spill-flowchart {
        flex-direction: column;
        align-items: stretch;
    }
    .flow-arrow {
        transform: rotate(90deg);
        margin: 8px 0;
        text-align: center;
    }
}

.flow-step {
    flex: 1;
    background-color: var(--primary-light);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    position: relative;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin: 0 auto 12px auto;
}

.flow-step h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.flow-step p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.flow-arrow {
    font-size: 1.2rem;
    color: var(--primary);
}

/* Static Tables inside Info Cards */
.static-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.static-table th, .static-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.static-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.emergency-files-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-download-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.doc-download-item:hover {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

.doc-icon {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
}

.docx-style {
    background-color: #2b579a;
}

.pdf-style {
    background-color: #dc2626;
}

.xlsx-style {
    background-color: #217346;
}

.doc-details {
    flex: 1;
}

.doc-details h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.doc-details p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.download-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

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

/* ==========================================================================
   12. TRAINING & DRILLS STYLING
   ========================================================================== */
.training-files-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-drills {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drill-card-inner {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    position: relative;
}

.drill-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.drill-badge.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-low);
}

.drill-badge.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-medium);
}

.drill-card-inner h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    padding-right: 100px;
}

.drill-card-inner p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.drill-links {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.text-docx {
    background-color: rgba(43, 87, 154, 0.08);
    color: #2b579a;
}

.text-docx:hover {
    background-color: #2b579a;
    color: #ffffff;
}

.text-pdf {
    background-color: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.text-pdf:hover {
    background-color: #dc2626;
    color: #ffffff;
}

.highlight-border {
    border: 1.5px dashed var(--primary);
    background-color: var(--primary-light);
}

/* ==========================================================================
   13. RISK MATRIX & GHS PICTO STYLING
   ========================================================================== */
.risk-matrix-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    border-radius: var(--border-radius);
    padding: 32px;
    margin-bottom: 32px;
}

.matrix-text h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.matrix-text p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    max-width: 800px;
}

.xlsx-style-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 8px;
    background-color: #217346;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
}

.xlsx-style-btn:hover {
    background-color: #1e663e;
    box-shadow: 0 4px 15px rgba(33, 115, 70, 0.4);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.ghs-reference-card {
    padding: 32px;
}

.ghs-reference-card h2 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.ghs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.ghs-item {
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    background-color: var(--bg-app);
}

.ghs-symbol-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.bg-red-badge {
    background-color: rgba(239, 68, 68, 0.08);
    border: 2px solid var(--color-high);
}

.ghs-item h4 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.ghs-item p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================================================
   CHEMICAL DETAIL MODAL
   ========================================================================== */
.chem-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}
.chem-row-clickable:hover {
    background-color: var(--primary-light) !important;
    transform: scale(1.003);
}
.chem-row-clickable:active {
    transform: scale(0.998);
}

.chem-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.chem-modal-overlay.active {
    opacity: 1;
}

.chem-modal-content {
    position: relative;
    width: 100%;
    max-width: 880px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 40px var(--primary-glow);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.chem-modal-overlay.active .chem-modal-content {
    transform: translateY(0) scale(1);
}

.chem-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.chem-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.chem-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-light), transparent);
}

.chem-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    border: 2px solid var(--primary);
}

.chem-modal-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
}

.chem-modal-code {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.chem-modal-body {
    padding: 24px 32px 32px;
}

.chem-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chem-modal-section {
    background: var(--bg-app);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.chem-modal-section h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.chem-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    gap: 12px;
}
.chem-info-row:last-child {
    border-bottom: none;
}

.chem-info-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 120px;
    flex-shrink: 0;
}

.chem-info-value {
    font-size: 0.88rem;
    color: var(--text-main);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.chem-cas-value {
    font-family: 'JetBrains Mono', monospace;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.chem-conc-value {
    color: var(--primary);
    font-weight: 700;
}

/* NĐ 24/2026 Cross-Reference Table */
.nd24-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--primary);
}
.nd24-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}
.nd24-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.nd24-table thead th {
    background: linear-gradient(135deg, hsl(156, 72%, 28%), hsl(156, 72%, 38%));
    color: white;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}
.nd24-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.nd24-table tbody tr:nth-child(even) {
    background: rgba(16, 185, 129, 0.04);
}
.nd24-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.08);
}
.nd24-badge {
    display: block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    margin: 3px 0;
    line-height: 1.3;
    white-space: normal;
}
.nd24-badge-pli {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.nd24-badge-plii {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.nd24-badge-pliii {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.nd24-badge-pliv {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.25);
}
[data-theme="dark"] .nd24-badge-pli { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
[data-theme="dark"] .nd24-badge-plii { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
[data-theme="dark"] .nd24-badge-pliii { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
[data-theme="dark"] .nd24-badge-pliv { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
[data-theme="dark"] .nd24-table thead th { background: linear-gradient(135deg, hsl(156, 50%, 18%), hsl(156, 60%, 30%)); }

/* NĐ 24 - Threshold Column (Phụ lục IV) */
.nd24-threshold-cell {
    text-align: center;
    white-space: nowrap;
}
.nd24-threshold-value {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    color: #dc2626;
    letter-spacing: 0.3px;
}
.nd24-threshold-na {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}
/* PL4 Warning Box */
.nd24-pl4-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(220, 38, 38, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}
.nd24-pl4-warning-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.nd24-pl4-warning-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.nd24-pl4-warning-text strong {
    color: #b45309;
}
.nd24-pl4-warning-text em {
    color: #dc2626;
    font-style: normal;
    font-weight: 600;
}
[data-theme="dark"] .nd24-threshold-value {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(139, 92, 246, 0.15));
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.3);
}
[data-theme="dark"] .nd24-pl4-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(220, 38, 38, 0.08));
    border-color: rgba(245, 158, 11, 0.4);
}
[data-theme="dark"] .nd24-pl4-warning-text strong { color: #fcd34d; }
[data-theme="dark"] .nd24-pl4-warning-text em { color: #fca5a5; }

/* GHS Detail Section - Professional Layout */
.ghs-detail-section {
    margin-top: 12px;
    padding: 0;
}
.ghs-detail-header {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-color);
}
.ghs-detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ghs-detail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: 10px;
    min-width: 80px;
    max-width: 100px;
    transition: all 0.2s ease;
}
.ghs-detail-card:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}
.ghs-detail-card-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}
.ghs-detail-card-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #b91c1c;
    text-align: center;
    line-height: 1.2;
}
.ghs-detail-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
}

/* Dark mode adjustments */
[data-theme="dark"] .ghs-detail-card {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}
[data-theme="dark"] .ghs-detail-card:hover {
    background: rgba(239, 68, 68, 0.14);
}
[data-theme="dark"] .ghs-detail-card-label {
    color: #fca5a5;
}

.chem-usage-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.chem-usage-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.chem-usage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.chem-usage-year {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.chem-usage-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

/* Modal responsive */
@media (max-width: 768px) {
    .chem-modal-content {
        max-width: 100%;
        border-radius: 14px;
    }
    .chem-modal-grid {
        grid-template-columns: 1fr;
    }
    .chem-modal-header {
        padding: 20px;
    }
    .chem-modal-body {
        padding: 16px;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .chem-modal-content {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .chem-modal-section {
    background: rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .chem-modal-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
}
[data-theme="dark"] .chem-usage-card {
    background: rgba(0, 0, 0, 0.15);
}

/* Full-width ingredients section */
.chem-modal-section-full {
    grid-column: 1 / -1;
}

/* Ingredients detail table */
.chem-ingredients-table-wrapper {
    border-radius: 8px;
}
.ingredients-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.ingredients-detail-table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 8px 12px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 2;
}
.ingredients-detail-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.ingredients-detail-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.04);
}
.ingredients-detail-table .chem-cas-value {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
}
.ingredients-detail-table .chem-conc-value {
    color: var(--secondary);
    font-weight: 600;
}
[data-theme="dark"] .ingredients-detail-table th {
    background: hsl(156, 40%, 18%);
}
[data-theme="dark"] .ingredients-detail-table td {
    border-color: rgba(255, 255, 255, 0.06);
}

/* =============================================
   USER PROFILE IN SIDEBAR
============================================= */
.sidebar-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 12px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
    text-transform: uppercase;
}
.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-msnv {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}
.btn-logout {
    width: 32px; height: 32px;
    border: none; border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: scale(1.05);
}
[data-theme="dark"] .sidebar-user-profile {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
}
