@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* CSS Design System for AuraBio Lab - Research Sample Tracker */

:root {
    --bg-base: #f0f3f9;
    --bg-sidebar: rgba(255, 255, 255, 0.45);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(108, 93, 211, 0.12);
    --border-focus: hsl(250, 84%, 60%);
    
    --text-primary: #1e1b4b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --color-primary: hsl(250, 84%, 60%);
    --color-primary-rgb: 108, 93, 211;
    --color-accent: hsl(180, 100%, 35%);
    --color-accent-rgb: 0, 179, 179;
    
    --color-success: hsl(142, 70%, 35%);
    --color-warning: hsl(38, 92%, 42%);
    --color-danger: hsl(350, 89%, 52%);
    
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(9, 30, 66, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(9, 30, 66, 0.06), 0 0 1px rgba(9, 30, 66, 0.12);
    --shadow-glow: 0 0 25px rgba(108, 93, 211, 0.12);
    --shadow-glow-accent: 0 0 25px rgba(0, 179, 179, 0.12);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, #e0e7ff 0px, transparent 40%),
        radial-gradient(at 100% 100%, #fae8ff 0px, transparent 40%),
        radial-gradient(at 50% 50%, #e0f2fe 0px, transparent 65%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.brand-icon i {
    color: white;
    width: 22px;
    height: 22px;
}

.brand-text h1 {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(to right, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.brand-text span {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 99px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.nav-item {
    background: none;
    border: none;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-card-hover);
}

.nav-item:hover i {
    transform: translateX(3px);
}

.nav-item.active {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-left: -24px;
    padding-left: 21px;
}

/* 1. Tổng quan - Indigo */
.nav-item:nth-child(1) i { color: #6366F1; }
.nav-item:nth-child(1):hover { background-color: rgba(99, 102, 241, 0.08); color: #6366F1; }
.nav-item:nth-child(1).active {
    color: #6366F1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.04));
    border-left: 3px solid #6366F1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}
.nav-item:nth-child(1).active i { color: #6366F1; }

/* 2. Quản lý mẫu lưu - Emerald */
.nav-item:nth-child(2) i { color: #10B981; }
.nav-item:nth-child(2):hover { background-color: rgba(16, 185, 129, 0.08); color: #10B981; }
.nav-item:nth-child(2).active {
    color: #10B981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.04));
    border-left: 3px solid #10B981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}
.nav-item:nth-child(2).active i { color: #10B981; }

/* 3. Mẫu đã hủy - Rose */
.nav-item:nth-child(3) i { color: #EF4444; }
.nav-item:nth-child(3):hover { background-color: rgba(239, 68, 68, 0.08); color: #EF4444; }
.nav-item:nth-child(3).active {
    color: #EF4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.04));
    border-left: 3px solid #EF4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}
.nav-item:nth-child(3).active i { color: #EF4444; }

/* 4. Trích xuất Email - Sky */
.nav-item:nth-child(4) i { color: #0EA5E9; }
.nav-item:nth-child(4):hover { background-color: rgba(14, 165, 233, 0.08); color: #0EA5E9; }
.nav-item:nth-child(4).active {
    color: #0EA5E9;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.04));
    border-left: 3px solid #0EA5E9;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}
.nav-item:nth-child(4).active i { color: #0EA5E9; }

/* 5. Theo dõi độ ổn định - Pink */
.nav-item:nth-child(5) i { color: #D946EF; }
.nav-item:nth-child(5):hover { background-color: rgba(217, 70, 239, 0.08); color: #D946EF; }
.nav-item:nth-child(5).active {
    color: #D946EF;
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(217, 70, 239, 0.04));
    border-left: 3px solid #D946EF;
    box-shadow: 0 4px 15px rgba(217, 70, 239, 0.1);
}
.nav-item:nth-child(5).active i { color: #D946EF; }

/* 6. Đề xuất gửi mẫu - Amber */
.nav-item:nth-child(6) i { color: #F59E0B; }
.nav-item:nth-child(6):hover { background-color: rgba(245, 158, 11, 0.08); color: #F59E0B; }
.nav-item:nth-child(6).active {
    color: #F59E0B;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.04));
    border-left: 3px solid #F59E0B;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
}
.nav-item:nth-child(6).active i { color: #F59E0B; }

/* 7. Sơ đồ tủ lưu trữ - Blue */
.nav-item:nth-child(7) i { color: #3B82F6; }
.nav-item:nth-child(7):hover { background-color: rgba(59, 130, 246, 0.08); color: #3B82F6; }
.nav-item:nth-child(7).active {
    color: #3B82F6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.04));
    border-left: 3px solid #3B82F6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}
.nav-item:nth-child(7).active i { color: #3B82F6; }

/* 8. Tích hợp & Cloud - Teal */
.nav-item:nth-child(8) i { color: #14B8A6; }
.nav-item:nth-child(8):hover { background-color: rgba(20, 184, 166, 0.08); color: #14B8A6; }
.nav-item:nth-child(8).active {
    color: #14B8A6;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.04));
    border-left: 3px solid #14B8A6;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.1);
}
.nav-item:nth-child(8).active i { color: #14B8A6; }

/* Sidebar Submenu */
.sidebar-sub-menu {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-nav-item {
    position: relative;
    border-left: 2px solid transparent !important;
}

.sub-nav-item:hover {
    background-color: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
    transform: translateX(3px);
}

.sub-nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.04)) !important;
    color: var(--color-primary) !important;
    font-weight: 700 !important;
    border-left: 3px solid var(--color-primary) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.sub-nav-item.active i {
    transform: scale(1.15);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Warehouse Switcher */
.warehouse-switcher {
    display: flex;
    background: rgba(108, 93, 211, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.switcher-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 8px;
    border-radius: calc(var(--radius-md) - 2px);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switcher-btn i {
    width: 14px;
    height: 14px;
}

.switcher-btn.active {
    background-color: var(--bg-card-hover);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.switcher-btn[data-warehouse="production"].active {
    color: var(--color-danger);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-meta h4 {
    font-size: 14px;
    color: var(--text-primary);
}

.user-meta span {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background-image: radial-gradient(circle at 80% 20%, hsla(250, 84%, 67%, 0.05), transparent 45%),
                      radial-gradient(circle at 10% 90%, hsla(180, 100%, 45%, 0.03), transparent 35%);
    background-size: cover;
}

/* Topbar Styling */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background-color: hsl(250, 84%, 72%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 93, 211, 0.4);
}

.btn-accent {
    background-color: var(--color-accent);
    color: hsl(222, 47%, 8%);
    box-shadow: var(--shadow-glow-accent);
}

.btn-accent:hover {
    background-color: hsl(180, 100%, 55%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 229, 0.4);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-card);
    border-color: var(--text-secondary);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover:not(:disabled) {
    background-color: var(--bg-card-hover);
    border-color: var(--text-secondary);
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: var(--shadow-glow);
    border-color: rgba(108, 93, 211, 0.25);
    transform: translateY(-2px);
}

/* Tab Panels */
.tab-panel {
    display: none;
    padding: 40px;
    animation: fadeIn 0.4s ease forwards;
}

.tab-panel.active {
    display: block;
}

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

/* Stats Overview */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 26px;
    height: 26px;
}

.stat-data h3 {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-family: var(--font-heading);
    font-weight: 800;
    color: white;
}

.stat-glow {
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    filter: blur(35px);
    opacity: 0.15;
}

/* Individual Stat Themes */
.total-samples .stat-icon {
    background-color: rgba(108, 93, 211, 0.15);
    border: 1px solid rgba(108, 93, 211, 0.3);
}
.total-samples i { color: var(--color-primary); }
.total-samples .stat-glow { background-color: var(--color-primary); }

.active-samples .stat-icon {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.active-samples i { color: var(--color-success); }
.active-samples .stat-glow { background-color: var(--color-success); }

.warning-samples .stat-icon {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.warning-samples i { color: var(--color-warning); }
.warning-samples .stat-glow { background-color: var(--color-warning); }

.expired-samples .stat-icon {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.expired-samples i { color: var(--color-danger); }
.expired-samples .stat-glow { background-color: var(--color-danger); }

/* Dashboard Charts Layout */
.dashboard-details {
    display: grid;
    grid-template-columns: 4fr 5fr;
    gap: 32px;
}

.dashboard-details h3 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 700;
}

/* CSS Pie Chart */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
}

.css-pie-chart {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    background: conic-gradient(
        var(--color-success) 0% var(--pct-active, 0%),
        var(--color-warning) var(--pct-active, 0%) var(--pct-warning, 0%),
        var(--color-danger) var(--pct-warning, 0%) 100%
    );
    transition: background 0.5s ease;
}

.pie-center {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 140px;
    height: 140px;
    border-radius: var(--radius-full);
    background-color: hsl(223, 47%, 12%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#chart-center-val {
    font-size: 28px;
    font-family: var(--font-heading);
    font-weight: 800;
    color: white;
}

.pie-center span:last-child {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.legend-item {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.dot.active { background-color: var(--color-success); }
.dot.warning { background-color: var(--color-warning); }
.dot.expired { background-color: var(--color-danger); }

/* Timeline Activity */
.activity-timeline {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
}

.timeline-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 40px 0;
}

.activity-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-badge i {
    width: 16px;
    height: 16px;
}

.activity-badge.add { background-color: rgba(108, 93, 211, 0.12); color: var(--color-primary); }
.activity-badge.import { background-color: rgba(0, 229, 229, 0.12); color: var(--color-accent); }
.activity-badge.delete { background-color: rgba(239, 68, 68, 0.12); color: var(--color-danger); }

.activity-text {
    flex-grow: 1;
}

.activity-text p {
    font-size: 13px;
    color: var(--text-primary);
}

.activity-text span {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Toolbar & Filters */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 500px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.filters {
    display: flex;
    gap: 12px;
}

select {
    padding: 12px 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

select:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

select option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}

/* Excel Actions Grid */
.excel-actions-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.drag-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background-color: hsla(223, 47%, 14%, 0.3);
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drag-drop-area:hover, .drag-drop-area.drag-over {
    border-color: var(--color-accent);
    background-color: hsla(180, 100%, 45%, 0.05);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.drag-drop-area:hover .upload-icon {
    color: var(--color-accent);
}

.drag-drop-area h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.drag-drop-area p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.drag-drop-area span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hidden-input {
    display: none;
}

.quick-excel-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px;
}

.quick-excel-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.quick-excel-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.sample-actions {
    display: flex;
    gap: 12px;
}

/* Data Table Panel */
.table-panel {
    padding: 0;
    overflow: hidden;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: hsla(223, 47%, 10%, 0.5);
    white-space: nowrap;
    font-size: 11px;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    white-space: nowrap;
    font-size: 11px;
}

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

tr:hover td {
    background-color: hsla(250, 84%, 60%, 0.04);
}

.table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 11px;
}

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

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

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

/* Pagination */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: hsl(210, 50%, 99%);
}

.pagination-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-page-num {
    font-size: 13px;
    font-weight: 600;
    color: white;
    min-width: 24px;
    text-align: center;
}

/* Action icons inside table */
.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-table-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-table-icon i {
    width: 14px;
    height: 14px;
}

.btn-table-icon.edit:hover {
    color: var(--color-accent);
    background-color: rgba(0, 229, 229, 0.1);
    border-color: rgba(0, 229, 229, 0.2);
}

.btn-table-icon.delete:hover {
    color: var(--color-danger);
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Email Parser Screen */
.parser-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.section-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    margin-top: 4px;
}

.mock-email-selector {
    margin-bottom: 16px;
}

.mock-email-selector label {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mock-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-mock-select {
    background-color: hsla(223, 47%, 10%, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}

.btn-mock-select:hover {
    background-color: var(--bg-card-hover);
    color: white;
    border-color: var(--text-secondary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input, .form-group textarea {
    padding: 10px 14px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 13px;
    transition: all 0.3s ease;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.form-row {
    display: flex;
    gap: 16px;
    width: 100%;
}

.col-6 { width: 50%; }
.col-12 { width: 100%; }

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-muted);
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background-color: hsla(223, 47%, 10%, 0.2);
}

.result-placeholder i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.parsed-form {
    animation: fadeIn 0.3s ease;
}

.parsed-form.hidden {
    display: none !important;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* Storage Map Page */
.storage-layout-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 32px;
}

.storage-selector {
    margin-bottom: 24px;
}

.storage-legend h4 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.legend-scale {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scale-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.color-box {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.color-box.empty { background-color: hsla(223, 30%, 15%, 0.5); border: 1px solid var(--border-color); }
.color-box.low { background-color: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35); }
.color-box.medium { background-color: rgba(245, 158, 11, 0.2); border: 1px solid rgba(245, 158, 11, 0.45); }
.color-box.high { background-color: rgba(239, 68, 68, 0.25); border: 1px solid rgba(239, 68, 68, 0.5); }

.slot-details-panel {
    margin-top: 32px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.slot-details-panel h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

.detail-empty {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-badge-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.detail-badge.count {
    background-color: rgba(108, 93, 211, 0.15);
    color: var(--color-primary);
    border-color: rgba(108, 93, 211, 0.3);
}

.slot-samples-list {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slot-samples-list li {
    font-size: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background-color: hsla(223, 47%, 10%, 0.4);
    border-left: 2px solid var(--color-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-samples-list li span:last-child {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
}

/* Visual Freezer Styling */
.freezer-casing {
    background-color: hsl(223, 30%, 15%);
    border: 4px solid hsl(223, 20%, 25%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    height: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.freezer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid hsl(223, 20%, 25%);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.freezer-badge {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.freezer-status-light {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.blinking {
    animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0.4; }
}

.freezer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
    align-content: start;
    flex-grow: 1;
    max-height: 480px;
    overflow-y: auto;
    padding: 6px;
}

.freezer-shelf {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 4 Compartments per shelf */
    gap: 12px;
    background-color: hsl(223, 30%, 11%);
    border-bottom: 4px solid hsl(223, 20%, 22%);
    padding: 10px;
    border-radius: var(--radius-sm);
}

.grid-slot {
    background-color: hsla(223, 30%, 8%, 0.8);
    border: 1px solid hsla(223, 30%, 25%, 0.8);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.grid-slot:hover {
    border-color: var(--color-primary);
    transform: scale(1.03);
    box-shadow: var(--shadow-glow);
}

.grid-slot.selected {
    border-color: var(--color-accent) !important;
    background-color: hsla(180, 100%, 45%, 0.05) !important;
    box-shadow: var(--shadow-glow-accent) !important;
}

/* Density states in slot grid */
.grid-slot.density-empty { background-color: hsla(223, 30%, 8%, 0.5); }
.grid-slot.density-low { background-color: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.2); }
.grid-slot.density-medium { background-color: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); }
.grid-slot.density-high { background-color: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }

.grid-slot span {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.grid-slot .slot-label {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.grid-slot .slot-count-num {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* ensure overlay above all */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

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

.required {
    color: var(--color-danger);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* Automation and Scripts styles */
.automation-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.automation-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: rgba(108, 93, 211, 0.12);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.automation-title h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.automation-title p {
    font-size: 13px;
    color: var(--text-secondary);
}

.automation-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.step-card {
    background-color: hsla(223, 47%, 10%, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
}

.step-num {
    position: absolute;
    top: -12px;
    left: 20px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    box-shadow: var(--shadow-glow);
}

.step-body h4 {
    font-size: 14px;
    margin-bottom: 8px;
    margin-top: 4px;
    color: var(--text-primary);
}

.step-body p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.step-body code {
    background-color: hsla(0, 0%, 100%, 0.08);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    color: var(--color-accent);
}

.script-code-section {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.code-header {
    background-color: hsla(223, 47%, 10%, 0.8);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

pre {
    margin: 0;
    background-color: hsl(223, 47%, 6%);
    padding: 16px;
    overflow-x: auto;
}

code {
    font-family: monospace, Courier, monospace;
    font-size: 12px;
    color: hsl(210, 40%, 85%);
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--color-success); }
.toast.error { border-left: 4px solid var(--color-danger); }
.toast.info { border-left: 4px solid var(--color-accent); }

.toast i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast.success i { color: var(--color-success); }
.toast.error i { color: var(--color-danger); }
.toast.info i { color: var(--color-accent); }

.toast p {
    font-size: 13px;
    color: var(--text-primary);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Supabase Connection Status Badge */
.supabase-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
}

.supabase-status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--text-muted);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.supabase-status-badge.local .status-dot {
    background-color: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

.supabase-status-badge.connected .status-dot {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.supabase-status-badge.error .status-dot {
    background-color: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
}

.supabase-status-badge .status-text {
    color: var(--text-primary);
}

/* Integration Grid layout for Tab 5 */
.integration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

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

.supabase-config-panel, .gmail-automation-panel {
    display: flex;
    flex-direction: column;
}

.panel-header-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-header-icon h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.panel-header-icon i {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.icon-glow-accent {
    color: var(--color-accent) !important;
    filter: drop-shadow(0 0 8px rgba(0, 229, 229, 0.4));
}

.supabase-guide-links {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: hsla(180, 100%, 45%, 0.05);
    border: 1px dashed rgba(0, 229, 229, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.supabase-guide-links i {
    color: var(--color-accent);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.config-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.supabase-sync-actions {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.supabase-sync-actions.hidden {
    display: none !important;
}

.supabase-sync-actions h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sync-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.btn-danger-text {
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger-text:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border-color: var(--color-danger) !important;
    color: var(--color-danger) !important;
}

/* Step cards vertical alignment */
.automation-steps.vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.step-card-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: hsla(223, 47%, 10%, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.step-card-mini .step-num {
    position: static;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    font-size: 11px;
}

.step-card-mini p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.step-card-mini code {
    background-color: hsla(0, 0%, 100%, 0.08);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-size: 11px;
}

/* ==========================================================================
   PRODUCT REPOSITORY MAP STYLING
   ========================================================================== */
.storage-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 550px;
}

@media (max-width: 1024px) {
    .storage-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.product-catalog-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.catalog-search-box {
    position: relative;
    width: 280px;
}

.catalog-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.catalog-search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.3s ease;
}

.catalog-search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 6px;
    align-content: start;
}

/* Product Card Styling */
.product-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-focus);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    box-shadow: var(--shadow-glow);
}

.product-card.selected {
    border-color: var(--color-accent);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.product-card-code {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-accent);
    font-size: 14px;
    margin-bottom: 4px;
}

.product-card-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
    margin-top: auto;
}

.product-card-batches {
    background-color: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.catalog-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Product Detail Panel Styling */
.product-detail-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: var(--text-muted);
    padding: 40px;
}

.detail-placeholder i {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.detail-placeholder h4 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 10px;
}

.detail-placeholder p {
    font-size: 13px;
    line-height: 1.5;
}

.product-detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.product-badge {
    background-color: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: inline-block;
    margin-bottom: 8px;
}

.product-detail-header h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.detail-ingredient {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.detail-ingredient i {
    width: 14px;
    height: 14px;
    color: var(--color-accent);
}

.detail-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-meta i {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
}

.batches-section h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.batches-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.batch-card {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.batch-title {
    font-weight: 600;
    color: #a5b4fc;
    font-size: 13px;
}

.batch-date {
    font-size: 11px;
    color: var(--text-muted);
}

.batch-samples-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-sample-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 8px 10px;
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-success);
}

.sample-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sample-key {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
    background-color: hsla(250, 84%, 60%, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.sample-qty {
    color: #34d399;
    font-weight: 600;
}

.sample-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sample-loc {
    color: #f43f5e;
    font-weight: 600;
    background-color: rgba(244, 63, 94, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.col-ham-luong {
    white-space: normal !important;
    max-width: 150px !important;
    min-width: 120px !important;
    word-break: break-word !important;
}

/* Stability Tab Styling */
.stability-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.stability-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stability-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stability-info-panel {
    padding: 20px;
}

.stability-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.svg-chart-container {
    height: 260px;
    position: relative;
    background-color: var(--bg-base);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-data-msg {
    color: var(--text-muted);
    font-size: 12px;
}

.stability-table-panel {
    padding: 20px;
}

/* SVG Chart Specific Styles */
.chart-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-line-ph {
    stroke: var(--color-accent);
}

.chart-line-assay {
    stroke: #34d399;
}

.chart-point {
    cursor: pointer;
    transition: r 0.2s ease, fill 0.2s ease;
}

.chart-point-ph {
    fill: var(--color-accent);
    stroke: var(--bg-primary);
    stroke-width: 2;
}

.chart-point-assay {
    fill: #34d399;
    stroke: var(--bg-primary);
    stroke-width: 2;
}

.chart-point:hover {
    r: 7;
}

.chart-grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 4,4;
}

.chart-axis-line {
    stroke: var(--text-muted);
    stroke-width: 1;
}

.chart-text {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-body);
}

.chart-tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    pointer-events: none;
    z-index: 100;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Stability Matrix Tables Styling */
.stability-tables-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 24px;
}

.stability-matrix-card {
    border-radius: var(--radius-lg);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
}

.stability-matrix-card:hover {
    border-color: hsla(223, 30%, 30%, 0.5);
}

.stability-matrix-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 10px;
}

.stability-condition-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stability-condition-badge.luu-thuong {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stability-condition-badge.lao-hoa {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stability-condition-badge.luu-lanh {
    background-color: rgba(0, 229, 229, 0.15);
    color: var(--color-accent);
    border: 1px solid rgba(0, 229, 229, 0.3);
}

.stability-condition-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stability-matrix-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.stability-matrix-table th {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-secondary);
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background-color: hsl(210, 50%, 97.5%);
    font-size: 12px;
}

.stability-matrix-table th:first-child,
.stability-matrix-table th:nth-child(2) {
    text-align: left;
}

.stability-matrix-table td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
    vertical-align: middle;
}

.stability-matrix-table td:first-child {
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: hsl(210, 50%, 98.5%);
}

.stability-matrix-table td:nth-child(2) {
    text-align: left;
    color: var(--text-muted);
}

.stability-matrix-table tr:hover td {
    background-color: hsla(250, 84%, 60%, 0.04);
}

.stability-cell-empty {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.5;
}

.stability-cell-value {
    font-weight: 700;
    font-family: var(--font-heading);
}

.stability-cell-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
}

.stability-cell-badge.ph-badge {
    background-color: rgba(0, 229, 229, 0.08);
    color: var(--color-accent);
    border: 1px solid rgba(0, 229, 229, 0.2);
}

.stability-cell-badge.assay-badge {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stability-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.stability-status-badge.status-success {
    background-color: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.stability-status-badge.status-warning {
    background-color: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.stability-status-badge.status-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Contenteditable Placeholder */
#qc-paste-zone:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    font-style: italic;
    cursor: text;
}

/* GENERAL HIDDEN UTILITY */
.hidden {
    display: none !important;
}

/* LOGIN SCREEN STYLING */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, hsl(223, 47%, 9%) 0%, hsl(244, 45%, 15%) 100%);
    z-index: 9999;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: var(--radius-lg);
    background: hsla(223, 47%, 12%, 0.55);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 0 20px rgba(0, 229, 229, 0.3);
}

.login-logo i {
    width: 28px;
    height: 28px;
    color: white;
}

.login-header h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 14px 12px 42px !important;
    font-size: 13.5px;
}

.remember-me {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 24px;
}

.remember-me label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px 24px !important;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.login-footer {
    margin-top: 30px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* USER LIST MANAGEMENT ACTIONS */
.user-role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-role-badge.role-admin {
    background-color: rgba(0, 229, 229, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(0, 229, 229, 0.2);
}

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

.user-role-badge.role-viewer {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.btn-logout:hover i {
    color: var(--color-danger);
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

/* =========================================================================
   QC SAMPLE LABELS (IMAGE 3 FORM MATCH) & PRINT STYLES
   ========================================================================= */
.qc-labels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background-color: #ffffff;
    color: #000000;
    padding: 8px;
    font-family: Arial, Helvetica, sans-serif;
}

.qc-label-card {
    border: 1px dashed #d9d9d9;
    padding: 6px;
    font-size: 10.5px;
    line-height: 1.35;
    background: #ffffff;
    color: #000000;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    position: relative;
}

.qc-label-header {
    text-align: center;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    color: #000000;
    border-bottom: 1px solid #000000;
    padding-bottom: 3px;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

.qc-label-row {
    margin-bottom: 2.5px;
    display: flex;
    justify-content: space-between;
}

.qc-label-row strong {
    font-weight: 700;
    color: #000000;
}

.qc-label-val {
    color: #111827;
    font-weight: 500;
}

.qc-label-footer {
    border-top: 1px dashed #cccccc;
    margin-top: 4px;
    padding-top: 4px;
    font-size: 9.5px;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #374151;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
        font-family: Arial, Helvetica, sans-serif !important;
    }

    /* Hide UI navigation, headers, sidebars, buttons by default */
    .app-sidebar,
    .app-header,
    .tab-navigation,
    .btn,
    button,
    #qc-gsheet-url-card,
    #qc-analysis-result-panel,
    .qc-filter-bar,
    .toast-container,
    .modal-header,
    .btn-close,
    #btn-print-qc-labels-action {
        display: none !important;
    }

    .app-container,
    .main-content,
    .tab-panel {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
    }

    /* Printable Proposal Table 17 columns */
    #qc-final-submission-panel {
        display: block !important;
        border: none !important;
        background: #ffffff !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    #qc-final-submission-panel h3 {
        color: #000000 !important;
        font-size: 14pt !important;
        font-weight: bold !important;
        text-align: center !important;
        margin-bottom: 12px !important;
    }

    #qc-final-submission-table-container {
        overflow: visible !important;
    }

    #qc-final-submission-table-container table {
        width: 100% !important;
        border-collapse: collapse !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 8.5pt !important;
    }

    #qc-final-submission-table-container th,
    #qc-final-submission-table-container td {
        border: 1px solid #000000 !important;
        padding: 4px 5px !important;
        color: #000000 !important;
        text-align: left !important;
        background: #ffffff !important;
    }

    #qc-final-submission-table-container th {
        background-color: #e5e7eb !important;
        font-weight: bold !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #qc-final-submission-table-container select,
    #qc-final-submission-table-container input {
        border: none !important;
        background: transparent !important;
        color: #000000 !important;
        font-size: 8.5pt !important;
        font-weight: bold !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        padding: 0 !important;
        width: auto !important;
    }

    /* Modal Labels Printing (When printing labels from modal) */
    body.printing-qc-labels body * {
        visibility: hidden !important;
    }
    
    body.printing-qc-labels #modal-qc-labels,
    body.printing-qc-labels #modal-qc-labels * {
        visibility: visible !important;
    }
    
    body.printing-qc-labels #modal-qc-labels {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        height: auto !important;
        display: block !important;
        background: white !important;
        padding: 0 !important;
    }
    
    body.printing-qc-labels .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: white !important;
    }
    
    body.printing-qc-labels .qc-labels-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    body.printing-qc-labels .qc-label-card {
        border: 1px dashed #999999 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

