.dashboard-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-chart-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .dashboard-chart-grid .dashboard-chart-container,
    .dashboard-lite-charts .lite-chart-card {
        min-height: 260px;
    }
}

.lab-status-default {
    background: #7f8c8d;
    color: #ffffff;
}

.lab-status-disabled {
    background: #bdc3c7;
    color: #ffffff;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.lab-status-in-progress {
    background: #8e44ad;
    color: #ffffff;
}

.lab-status-parts {
    background: #ff9800;
    color: #ffffff;
}

.lab-status-complete {
    background: #27ae60;
    color: #ffffff;
}
/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}





/* Navbar */
.navbar {
    background: white;
    color: #1e293b;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 0;
    transition: margin-left 0.3s ease;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: none;
    min-height: 80px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-hamburger {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.navbar-hamburger:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.navbar-hamburger svg {
    width: 20px;
    height: 20px;
}

.navbar h1 {
    font-size: 1.5rem;
    margin: 0;
}

.navbar-logo-container {
    display: flex;
    align-items: center;
    gap: 0;
}

.navbar-logo {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
    max-width: 70px;
    max-height: 70px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.navbar-logo.hidden {
    display: none;
}

.navbar-user, .navbar-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.navbar-user-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.navbar-user-name {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s, opacity 0.2s;
}

.navbar-user-name:hover {
    color: #667eea;
    opacity: 0.8;
}

.navbar-user-menu {
    position: relative;
}

.navbar-menu-label {
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    background: transparent;
    font-weight: 500;
}

.navbar-menu-label:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.navbar-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    display: none;
    border: 1px solid #e2e8f0;
}

.navbar-user-menu:hover .navbar-menu-dropdown {
    display: block;
}

.navbar-menu-item {
    padding: 0.75rem 1.5rem;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.navbar-menu-item:last-child {
    border-bottom: none;
}

.navbar-menu-item:hover {
    background: #f8fafc;
}

.navbar-menu-item svg {
    color: #64748b;
    stroke: #64748b;
}

/* Section Header */
.section-header {
    background: white;
    color: #1e293b;
    padding: 1.5rem 2rem;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: none;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* User Menu */
.user-menu-container {
    position: relative;
}

.user-menu-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.user-menu-dropdown.hidden {
    display: none;
}

.user-menu-item {
    padding: 0.75rem 1.5rem;
    color: #2c3e50;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #eee;
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background: #f8f9fa;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c3e50;
}

.btn-info {
    background: #e2e8f0;
    color: #1e293b;
    border: 1px solid #cbd5f5;
}

.btn-info:hover {
    background: #cbd5f5;
}

.btn-info.active {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.35);
    border: 1px solid rgba(234, 88, 12, 0.5);
}

.btn-block {
    width: 100%;
}

/* Tabs */
.tabs {
    display: none !important; /* Navigation gestita dal menu laterale */
}

.tab {
    display: none;
}


.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Filters Menu */
.filter-wrapper {
    position: relative;
    display: inline-block;
}

.filters-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    min-width: 300px;
    max-width: 500px;
    z-index: 1000;
    border: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

.filters-menu.show {
    display: block;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.filter-item .filter-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #1e293b;
}

.filter-item .filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Content */
.content {
    padding: 2.5rem;
    background: transparent;
}

.tab-content {
    min-height: unset;
}

.section-content {
    min-height: unset;
}

.tab-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.filter-select {
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
}

.metric-value {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: #64748b;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    max-width: 100%;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
}

.table-scroll-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 80vh;
    width: 100%;
}

.table-scroll-wrapper::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Vertical scrollbar */
.table-scroll-wrapper::-webkit-scrollbar:vertical {
    width: 12px;
}

/* Scrollbar superiore */
.table-scroll-top {
    position: relative;
    width: 100%;
    height: 17px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 5px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 4px;
    z-index: 10;
    direction: ltr; /* Normal direction for proper scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.table-scroll-top > div {
    direction: ltr; /* Contenuto normale */
    pointer-events: none; /* Don't interfere with scrolling */
}

.table-scroll-top::-webkit-scrollbar {
    height: 12px;
}

.table-scroll-top::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-scroll-top::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

.table-scroll-top::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 3000px; /* Force horizontal scroll - colonne più larghe */
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    min-width: 200px; /* Colonne più larghe */
}

/* Resizable column handle */
th {
    position: relative;
}

th .resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.2s;
}

th .resize-handle:hover {
    background: rgba(255, 255, 255, 0.3);
}

th .resize-handle.active {
    background: rgba(255, 255, 255, 0.5);
}

/* Selected row styling */
tr.selected {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border-left: 4px solid #667eea;
}

tr.selected td {
    background: transparent;
}

tr.selected:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important;
}

th:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

th.sorted {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

th.sorted::after {
    content: ' ▲';
    font-size: 0.7em;
}

th.sorted.desc::after {
    content: ' ▼';
    font-size: 0.7em;
}

td {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
    min-width: 200px; /* Colonne più larghe */
    white-space: nowrap;
}

tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

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

/* Login */
/* Login Screen Wrapper */
.login-screen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    min-height: 100vh;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    background-position: center;
    background-repeat: no-repeat;
    animation: gradientShift 15s ease infinite;
}

/* Custom background image overlay */
.login-background.has-custom-bg {
    background: url('/static/login-background.jpg') center/cover no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    animation: none !important;
}

.login-background.has-custom-bg .login-background-pattern {
    opacity: 0.3;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    opacity: 0.6;
}

.login-container {
    position: relative;
    max-width: 450px;
    width: 90%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
    z-index: 10;
    animation: slideUp 0.5s ease;
}

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

.login-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.login-logo-fallback {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-logo-text {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    animation: logoFloat 3s ease-in-out infinite;
}

.login-container h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-container p {
    text-align: center;
    color: rgba(71, 85, 105, 0.9);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1e293b;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="checkbox"] {
    width: auto;
}

/* Inline editing in tables */
table input[type="text"],
table input[type="number"],
table select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9rem;
    width: 100%;
    min-width: 80px;
}

table input[type="text"]:focus,
table input[type="number"]:focus {
    outline: 2px solid #3498db;
    border-color: #3498db;
}

/* Notes column highlighted */
.notes-cell {
    background: #fffacd !important;
    min-width: 200px;
}

.notes-cell:hover {
    background: #fff9c4 !important;
}

input.order-notes {
    background: transparent;
    border: 2px solid #3498db;
}

/* Product checkboxes in modal */
.product-checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.product-checkbox-container:hover {
    background: #f0f0f0;
}

.product-checkbox-label {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

.product-checkbox-label strong {
    color: #2c3e50;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999 !important;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(102, 126, 234, 0.1);
    animation: slideUp 0.3s ease;
    z-index: 10000 !important;
    position: relative;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

/* Priority Colors */
.priority-yellow {
    background: #fff9c4;
}

.priority-orange {
    background: #ffe082;
}

.priority-red {
    background: #ffccbc;
}

/* Sidebar Menu */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 2px 0 10px rgba(15, 23, 42, 0.08);
    z-index: 1100;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid #e2e8f0;
    transform: translateX(0);
}

.sidebar-collapsed {
    width: 72px;
}

.sidebar-collapsed .menu-text,
.sidebar-collapsed .menu-arrow {
    display: none;
}

.sidebar-collapsed .sub-menu {
    display: none !important;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1090;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }
    
    .sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(15, 23, 42, 0.3);
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
    
    .navbar {
        margin-left: 0;
    }
}

@media (min-width: 1025px) {
    #sidebar-overlay {
        display: none !important;
    }
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    min-height: 120px;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.sidebar-logo-expand {
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    margin: 0 auto;
    background: transparent;
    border: none;
}

.sidebar-logo-expand:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.sidebar-logo-expand.hidden {
    display: none;
}

/* Hide broken image placeholder */
.sidebar-logo-expand[src=""],
img[src="/static/logo.png"]:not([src*="?"]) {
    background: transparent;
}

/* Remove white background on image error */
.sidebar-logo-expand::before {
    content: none;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.logo-img {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
    display: block;
}

.logo-img.hidden {
    display: none;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    border-radius: 4px;
    color: #1e293b;
}

.sidebar-menu {
    padding: 10px 0;
}

.menu-item-parent {
    border-bottom: 1px solid #f1f5f9;
}

.menu-item-main {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

.menu-item-main:hover {
    background: #f8fafc;
    border-left-color: #667eea;
    color: #1e293b;
}

.menu-item-main.active {
    background: #f1f5f9;
    border-left-color: #667eea;
    color: #1e293b;
    font-weight: 600;
}

.menu-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.menu-item-main.active .menu-arrow {
    transform: rotate(90deg);
}

.sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8fafc;
}

.sub-menu.expanded {
    max-height: 1000px;
}

.sub-menu-item {
    padding: 10px 20px 10px 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    color: #64748b;
}

.sub-menu-item:hover {
    background: #f1f5f9;
    border-left-color: #667eea;
    color: #1e293b;
}

.sub-menu-item.active {
    background: #e2e8f0;
    border-left-color: #667eea;
    font-weight: 600;
    color: #1e293b;
}

.menu-icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #64748b;
    stroke: #64748b;
    fill: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon-white {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #64748b;
    stroke: #64748b;
    fill: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-text {
    font-size: 0.95rem;
}

.menu-item-main .menu-text {
    color: inherit;
}

.sub-menu-item .menu-text {
    color: inherit;
}

/* Return Photos & Annotation */
.return-photos-modal {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 820px;
}

.return-photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2c3e50;
    color: white;
    padding: 16px 20px;
    border-radius: 10px;
}

.return-photos-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.return-photos-header p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

.return-photos-actions {
    display: flex;
    gap: 10px;
}

.return-photos-upload {
    border: 1px dashed #ced4da;
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.return-photos-upload-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.return-photos-upload-controls input[type="file"] {
    flex: 1;
}

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

.photo-grid-empty {
    text-align: center;
    color: #6c757d;
    font-size: 0.95rem;
    padding: 30px 0;
}

.photo-card-advanced {
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e7ff;
}

.photo-card-preview {
    position: relative;
    width: 100%;
    padding-top: 70%;
    overflow: hidden;
}

.photo-card-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-annotated-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(46, 204, 113, 0.9);
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.photo-card-info {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
}

.photo-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 6px;
}

.photo-annotation-comment {
    font-size: 0.85rem;
    color: #2c3e50;
    background: #fff;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #dee2e6;
}

.photo-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
}

.annotation-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 860px;
}

.annotation-toolbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #2c3e50;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
}

.annotation-tools,
.annotation-colors,
.annotation-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.annotation-tool-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

.annotation-tool-btn.active {
    background: #1abc9c;
    border-color: #1abc9c;
}

.annotation-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer;
    display: inline-block;
}

.annotation-color-swatch.active {
    box-shadow: 0 0 0 2px white;
}

.annotation-tool-secondary {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    color: white;
    padding: 7px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}

.annotation-canvas-wrapper {
    background: #edf2f6;
    border: 1px solid #dce2ec;
    border-radius: 10px;
    padding: 12px;
    overflow: auto;
    max-height: 580px;
}

.annotation-comment textarea {
    width: 100%;
    min-height: 80px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px;
    font-size: 0.95rem;
    resize: vertical;
}

.annotation-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.photo-preview-modal {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.photo-preview-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 14px;
}

.preview-buttons {
    display: flex;
    gap: 10px;
}

.photo-preview-container {
    background: #000;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.photo-preview-container img {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    border-radius: 6px;
}

.photo-preview-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.photo-preview-toggle .toggle-btn {
    background: #dee2e6;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
}

.photo-preview-toggle .toggle-btn.active {
    background: #2c3e50;
    color: white;
}

.photo-preview-comment {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.photo-preview-actions {
    display: flex;
    justify-content: flex-end;
}

.returns-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.refunds-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.refund-summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border: 1px solid rgba(44, 62, 80, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.refund-summary-title {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.refund-summary-value {
    font-size: 1.6rem;
    color: #2c3e50;
    font-weight: 700;
}

.refund-summary-amount {
    font-size: 0.95rem;
    color: #4b5563;
}

.refund-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

.refund-deadline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.refund-table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.refund-detail-wrapper {
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.refund-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.refund-detail-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #2c3e50;
}

.refund-detail-alert {
    background: linear-gradient(135deg, #ffe0e0 0%, #ffd1d1 100%);
    color: #a94442;
    border-radius: 10px;
    padding: 14px;
    font-weight: 600;
    border: 1px solid rgba(169, 68, 66, 0.2);
}

.refund-detail-section {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(44, 62, 80, 0.08);
    padding: 16px 18px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.refund-detail-section h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #2c3e50;
}

.refund-history-item {
    border-left: 3px solid #2c3e50;
    padding-left: 12px;
    margin-bottom: 12px;
}

.refund-history-item strong {
    color: #1f2933;
}

.refund-history-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

.refund-decision-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.refund-decision-form textarea {
    width: 100%;
    min-height: 90px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 10px;
    font-size: 0.95rem;
    resize: vertical;
}

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

.reassignments-section {
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    padding: 1rem 0;
    margin-top: 32px;
    border-top: 2px solid #e2e8f0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.reassignments-section h3 {
    margin-bottom: 12px;
    color: #2c3e50;
}

.returns-archive-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.returns-archive-panel.hidden {
    display: none;
}

.returns-archive-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.returns-archive-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #0f172a;
}

.returns-archive-header p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.returns-archive-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.returns-archive-actions input,
.returns-archive-actions select {
    padding: 0.55rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
}

.returns-archive-actions .btn {
    white-space: nowrap;
}

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

/* Sidebar Description Panel */
.sidebar-description {
    position: fixed;
    left: 250px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 999;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-description.hidden {
    transform: translateX(-100%);
}

.description-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.description-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-desc {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-desc:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.description-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}

.description-content h4 {
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.description-content h4:first-child {
    margin-top: 0;
}

.description-content p {
    color: #555;
    margin-bottom: 15px;
}

.description-content ul {
    color: #555;
    margin-left: 20px;
    margin-bottom: 15px;
}

.description-content li {
    margin-bottom: 8px;
}

.description-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    color: #e74c3c;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: 72px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.sidebar:not(.sidebar-collapsed) ~ .main-wrapper {
    margin-left: 260px;
}

.sidebar-open-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 10px;
}

.sidebar-open-btn:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar h1 {
        font-size: 1.2rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }

    .sidebar-description {
        left: 0;
        width: 280px;
    }
}

/* Modern Dashboard Styles - Tradedoubler Style */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.dashboard-period-controls {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.period-selector,
.comparison-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.period-selector label,
.comparison-selector label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.period-input {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 180px;
}

.period-buttons,
.comparison-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.period-btn,
.comparison-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn:hover,
.comparison-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.period-btn.active,
.comparison-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.comparison-text {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    min-width: 180px;
    display: inline-block;
}

/* Dashboard quick metric highlight */
.dashboard-quick-metric {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 100%);
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12);
    margin-bottom: 1.5rem;
}

.quick-metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.quick-metric-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
}

.quick-metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #312e81;
    line-height: 1.1;
}

/* KPI Cards with Mini Charts */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.kpi-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-mini-chart {
    width: 120px;
    height: 40px;
    opacity: 0.7;
}

.kpi-mini-chart canvas {
    width: 100%;
    height: 100%;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.kpi-change.positive {
    color: #10b981;
}

.kpi-change.negative {
    color: #ef4444;
}

.kpi-change .change-arrow {
    font-size: 1rem;
}

.kpi-change .change-value {
    font-weight: 700;
}

/* Main Chart Container */
.dashboard-chart-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.chart-metric-select {
    padding: 0.75rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.chart-metric-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: 1rem;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    user-select: none;
}

.chart-wrapper canvas:active {
    cursor: grabbing;
}

.chart-tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
    z-index: 9999;
    transform: translate(-50%, -120%);
    white-space: nowrap;
}

.chart-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.current {
    background: #10b981;
}

.legend-dot.previous {
    background: #64748b;
}

/* Dashboard Lite */
.dashboard-lite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-lite-pill {
    background: #eef2ff;
    color: #4c1d95;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.dashboard-lite-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lite-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 120px;
}

.lite-card.highlight {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.lite-card.highlight .lite-sub,
.lite-card.highlight .lite-label {
    color: rgba(255, 255, 255, 0.85);
}

.lite-card.warning {
    border: 1px solid #f97316;
}

.lite-label {
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lite-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
}

.lite-card.highlight .lite-value {
    color: white;
}

.lite-sub {
    font-size: 0.9rem;
    color: #94a3b8;
}

.lite-sub.muted {
    color: #cbd5f5;
}

.dashboard-lite-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.lite-insight-card {
    background: #0f172a;
    color: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.lite-insight-title {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.lite-insight-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.dashboard-lite-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.lite-chart-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.lite-chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.lite-chart-card canvas {
    width: 100%;
    height: 220px;
}

.dashboard-lite-section {
    margin-top: 2.5rem;
}

.lite-supplier-ranking {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.lite-supplier-ranking .lite-card {
    min-height: auto;
}

@media (max-width: 768px) {
    .dashboard-lite-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-lite-charts {
        grid-template-columns: 1fr;
    }
    .lite-card {
        min-height: 100px;
    }
}

