/* Import common variables and base styles */
@import url('/common.css');

/* Dark Mode Theme */
body.dark-mode {
    --primary: #1e293b;
    --primary-dark: #0f172a;
    --primary-light: #334155;
    --accent: #06b6d4;
    --accent-dark: #0891b2;
    --accent-light: #22d3ee;
    --gray-50: #1e293b;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-surface: #1e293b;
    --bg-surface-elevated: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-color-strong: #475569;
    --gradient-primary: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    --gradient-warning: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    --gradient-info: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    --gradient-success: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    --gradient-danger: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

body.dark-mode {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-mode .content,
body.dark-mode .filters-bar,
body.dark-mode .nav-bar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .conditioning-panel,
body.dark-mode .review-panel,
body.dark-mode .instructions-container {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

body.dark-mode .history-section {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

body.dark-mode .history-title {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

body.dark-mode .history-list {
    background: var(--bg-surface);
}

body.dark-mode .history-item {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .history-item:hover {
    background: var(--border-color-strong);
}

body.dark-mode textarea,
body.dark-mode input[type="text"],
body.dark-mode select {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode textarea:focus,
body.dark-mode input[type="text"]:focus,
body.dark-mode select:focus {
    border-color: var(--accent);
}

body.dark-mode .modal-content,
body.dark-mode .history-modal-content,
body.dark-mode .stats-modal-content,
body.dark-mode .settings-modal-content {
    background: var(--bg-surface);
    color: var(--text-primary);
}

body.dark-mode .settings-section {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color);
}

body.dark-mode .login-card {
    background: var(--bg-surface);
}

body.dark-mode .tool-btn {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .filter-group select {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .conditioning-gallery-panel,
body.dark-mode .result-gallery-panel {
    background: var(--bg-surface-elevated);
}

body.dark-mode .bbox-input-row {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color);
}

body.dark-mode h3, body.dark-mode h4 {
    color: var(--text-primary);
}

body.dark-mode label {
    color: var(--text-secondary);
}

body.dark-mode .instructions-actions {
    border-top-color: var(--border-color);
}

body.dark-mode .sliders-row {
    background: var(--bg-surface-elevated);
}

body.dark-mode .path-segment {
    color: var(--text-secondary);
}

body.dark-mode .header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #334155;
}

body.dark-mode .header-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .instance-list-content {
    background: var(--bg-surface);
}

body.dark-mode .instance-list-item {
    background: var(--bg-surface-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .instance-list-item:hover {
    background: var(--border-color-strong);
}

/* Dark mode: Nav counter panel */
body.dark-mode .nav-counter {
    background: var(--bg-surface-elevated);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .instance-jump {
    color: var(--text-primary);
}

body.dark-mode .nav-total {
    color: var(--text-secondary);
}

body.dark-mode .nav-sep {
    color: var(--text-muted);
}

/* Dark mode: History panel path segments */
body.dark-mode .path-segment.client {
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

body.dark-mode .path-segment.brand {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

body.dark-mode .path-segment.project {
    background: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

body.dark-mode .path-segment.sku {
    background: rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}

body.dark-mode .history-count {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
}

body.dark-mode .history-empty {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* Dark mode: History status badges */
body.dark-mode .history-status-badge.active {
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

body.dark-mode .history-status-badge.processing {
    background: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

body.dark-mode .history-status-badge.approved {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

body.dark-mode .history-status-badge.rejected {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

body.dark-mode .history-status-badge.failed {
    background: rgba(236, 72, 153, 0.3);
    color: #f9a8d4;
}

/* Dark mode: Instance list modal status badges */
body.dark-mode .status-badge,
body.dark-mode .status-active {
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

body.dark-mode .status-processing {
    background: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

body.dark-mode .status-approved {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

body.dark-mode .status-rejected,
body.dark-mode .status-failed {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

body.dark-mode .col-updated {
    color: var(--text-muted);
}

/* Dark mode: Selected row styling */
body.dark-mode .instance-table-row.active {
    background: linear-gradient(135deg, var(--accent) 0%, #0e7490 100%);
}

body.dark-mode .instance-table-row.active .status-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Dark mode: Settings tabs */
body.dark-mode .settings-tabs {
    background: var(--bg-surface-elevated);
    border-bottom-color: var(--border-color);
}

body.dark-mode .settings-tab {
    color: var(--text-secondary);
}

body.dark-mode .settings-tab:hover {
    background: rgba(8, 145, 178, 0.15);
    color: var(--accent);
}

body.dark-mode .settings-tab.active {
    background: var(--bg-surface);
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Dark mode: Settings form inputs */
body.dark-mode .form-group select,
body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group input[type="password"] {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .form-group select:focus,
body.dark-mode .form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
}

body.dark-mode .form-group select:disabled {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
}

body.dark-mode .form-group label {
    color: var(--text-secondary);
}

body.dark-mode .bulk-delete-form,
body.dark-mode .user-form {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

/* Dark mode: Danger zone colors */
body.dark-mode .danger-tab {
    color: #f87171 !important;
    border-color: #f87171 !important;
}

body.dark-mode .danger-tab.active {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    color: white !important;
}

body.dark-mode .danger-section {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(185, 28, 28, 0.15));
    border-color: #f87171;
}

body.dark-mode .danger-text {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
    border-left-color: #f87171;
}

body.dark-mode .danger-form input {
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    color: var(--text-primary);
}

body.dark-mode .danger-form input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* Dark mode: Stats cards */
body.dark-mode .stats-card.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
    border-color: #10b981;
}

body.dark-mode .stats-card.success .stats-card-value {
    color: #6ee7b7;
}

body.dark-mode .stats-card.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
    border-color: #f59e0b;
}

body.dark-mode .stats-card.warning .stats-card-value {
    color: #fcd34d;
}

body.dark-mode .stats-card.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.3));
    border-color: #ef4444;
}

body.dark-mode .stats-card.danger .stats-card-value {
    color: #fca5a5;
}

body.dark-mode .col-id {
    color: var(--text-muted);
}

/* Dark mode: Settings description text */
body.dark-mode .settings-description {
    color: var(--text-secondary);
}

body.dark-mode .settings-section h4 {
    color: var(--text-primary);
}

/* Dark mode: Metadata labels */
body.dark-mode .metadata-label {
    color: var(--text-muted);
}

body.dark-mode .metadata-value {
    color: var(--text-primary);
}

/* Dark mode: Conditioning/review panels */
body.dark-mode .conditioning-panel,
body.dark-mode .review-panel {
    background: rgba(30, 41, 59, 0.85);
}

body.dark-mode .conditioning-panel h3,
body.dark-mode .review-panel h3 {
    color: var(--text-primary);
}

/* Dark mode: Nav divider */
body.dark-mode .nav-divider {
    background: var(--border-color);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; 
    background: var(--bg-primary); 
    color: var(--text-primary); 
    line-height: 1.6; 
    min-height: 100vh; 
}
.container { margin: 0; padding: 0; }
.header { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; 
    padding: 12px 20px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    box-shadow: 0 2px 8px rgba(30, 41, 59, 0.2); 
}
.header-title { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.header-title h1 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
    font-size: 13px;
}
.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.header-btn.icon {
    padding: 8px 10px;
}
.header-btn.fetch {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}
.header-btn.fetch:hover {
    background: rgba(34, 197, 94, 0.3);
}
.header-btn.logout {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}
.header-btn.logout:hover {
    background: rgba(239, 68, 68, 0.25);
}
.header-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
}
.header-user {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.header-user::before {
    content: '👤';
    font-size: 12px;
}
#loginScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-200) 50%, var(--gray-300) 100%);
    background-attachment: fixed;
}
.login-card {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 420px;
    width: 100%;
    border: 1px solid var(--gray-200);
}
.login-card h2 {
    color: var(--gray-900);
    margin: 0 0 8px 0;
    text-align: center;
    font-weight: 700;
    font-size: 24px;
}
.login-subtitle {
    color: var(--gray-600);
    text-align: center;
    margin: 0 0 32px 0;
    font-size: 14px;
}
.login-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 2px solid var(--gray-300);
    transition: all 0.2s;
    font-size: 14px;
    font-family: inherit;
}
.login-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(51, 65, 85, 0.3);
}
.login-error {
    background: var(--gradient-danger);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--danger-light);
}
.message { 
    padding: 12px 20px; 
    margin: 12px 28px; 
    border-radius: var(--radius-md); 
    font-weight: 500; 
    font-size: 13px; 
    display: none; 
    align-items: center; 
    gap: 10px; 
    animation: slideIn 0.3s ease; 
}
.error-message { 
    background: #ffe4e6; 
    color: #881337; 
    border-left: 4px solid var(--danger); 
}
.success-message { 
    background: #d1fae5; 
    color: #064e3b; 
    border-left: 4px solid var(--success); 
}
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; }
.toast { 
    padding: 14px 20px; 
    border-radius: var(--radius-lg); 
    font-weight: 500; 
    font-size: 14px; 
    box-shadow: var(--shadow-lg); 
    animation: toastSlideIn 0.3s ease; 
    display: flex; 
    align-items: center; 
    gap: 10px;
    min-width: 280px;
}
.toast.error { 
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.toast.success { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.toast.warning { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}
.toast-content { flex: 1; line-height: 1.4; }
@keyframes toastSlideIn { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}
.image-loading { 
    position: relative; 
    background: transparent; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 150px; 
}
@keyframes pulse { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
.image-error { 
    position: relative; 
    background: #1e293b; 
    border-radius: 8px;
    min-height: 150px; 
}
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-separator {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    margin: 0 4px;
}
.nav-search {
    position: relative;
}
.nav-search input {
    width: 150px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
}
.nav-search input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.action-btn {
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.action-btn.nav {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}
.action-btn.nav:hover:not(:disabled) {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 2px 6px rgba(71, 85, 105, 0.35);
}
.action-btn.list {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    color: white;
}
.action-btn.list:hover:not(:disabled) {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}
.action-btn.approve {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}
.action-btn.approve:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}
.action-btn.reject {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}
.action-btn.reject:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}
.action-btn.refresh {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    color: white;
}
.action-btn.refresh:hover:not(:disabled) {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 2px 6px rgba(6, 182, 212, 0.35);
}
.action-btn.json {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
}
.action-btn.json:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}
.action-btn.delete {
    background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
    color: white;
}
.action-btn.delete:hover:not(:disabled) {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.35);
}
.action-btn.filters {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    color: white;
}
.action-btn.filters:hover:not(:disabled) {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.35);
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-counter {
    display: inline-flex;
    align-items: center;
    background: white;
    border-radius: 6px;
    padding: 0 8px;
    height: 32px;
    gap: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    min-width: 80px;
    justify-content: center;
}
.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(8, 145, 178, 0.1);
    border-radius: 12px;
    animation: pulseGlow 1.5s ease-in-out infinite;
}
.loading-indicator::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(8, 145, 178, 0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.2); }
    50% { opacity: 0.85; box-shadow: 0 0 8px 2px rgba(8, 145, 178, 0.15); }
}
.instance-jump {
    width: 36px;
    text-align: center;
    background: transparent;
    border: none;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    -moz-appearance: textfield;
}
.instance-jump::-webkit-outer-spin-button,
.instance-jump::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.nav-sep {
    color: #94a3b8;
    font-size: 12px;
    margin: 0 2px;
}
.nav-total {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}
.all-approved-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    margin-left: 8px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    animation: pulse-approved 2s infinite;
}
@keyframes pulse-approved {
    0%, 100% { box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35); }
    50% { box-shadow: 0 2px 12px rgba(16, 185, 129, 0.55); }
}
.nav-divider {
    width: 1px;
    height: 24px;
    background: #cbd5e1;
    margin: 0 4px;
}
.nav-spacer {
    flex: 1;
}
.nav-decisions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.filters-bar {
    background: linear-gradient(180deg, #fafbfc 0%, #f5f7fa 100%);
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-group label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.filter-group select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    min-width: 140px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.filter-group select:hover {
    border-color: #9ca3af;
}
.filter-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.filter-divider {
    width: 1px;
    height: 40px;
    background: #e5e7eb;
    margin: 0 4px;
}
.filter-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.search-box {
    display: flex;
    align-items: center;
    position: relative;
}
.search-box input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px 0 0 6px;
    font-size: 13px;
    width: 150px;
    outline: none;
    transition: all 0.15s ease;
}
.search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.search-box button {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-left: none;
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}
.search-box button:hover {
    background: #e5e7eb;
}
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 400px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}
.search-results-dropdown.hidden {
    display: none;
}
.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover,
.search-result-item.selected {
    background: #f0f9ff;
}
.search-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}
.search-thumbnail-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 16px;
    flex-shrink: 0;
}
.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-item .result-sku {
    font-weight: 600;
    color: #1e40af;
    font-size: 13px;
}
.search-result-item .result-path {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-item .result-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 8px;
}
.search-result-item .result-status.status-active { background: #dbeafe; color: #1e40af; }
.search-result-item .result-status.status-processing { background: #fef3c7; color: #92400e; }
.search-result-item .result-status.status-approved { background: #d1fae5; color: #065f46; }
.search-result-item .result-status.status-rejected { background: #fee2e2; color: #991b1b; }
.search-result-item .result-status.status-failed { background: #fee2e2; color: #991b1b; }
.search-no-results {
    padding: 12px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}
.tool-btn {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tool-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}
.tool-btn.primary {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    color: white;
    border-color: #6366f1;
}
.tool-btn.primary:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.tool-btn.download {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
    color: white;
    border-color: #14b8a6;
}
.tool-btn.download:hover {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}
.tool-btn.nav {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    border-color: #475569;
}
.tool-btn.nav:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.35);
}
.tool-btn.list {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
    color: white;
    border-color: #14b8a6;
}
.tool-btn.list:hover {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}
.tool-btn.approve {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}
.tool-btn.approve:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.tool-btn.reject {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
}
.tool-btn.reject:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}
.tool-btn.refresh {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: white;
    border-color: #0ea5e9;
}
.tool-btn.refresh:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}
.tool-btn.json {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    border-color: #f59e0b;
}
.tool-btn.json:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.tool-btn.delete {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border-color: #ea580c;
}
.tool-btn.delete:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}
.tool-btn.download {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: #7c3aed;
}
.tool-btn.download:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.tool-btn.download:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    border-color: #6b7280;
    cursor: not-allowed;
    opacity: 0.6;
}
.tool-btn.download-image {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}
.tool-btn.download-image:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.tool-btn.download-image:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    border-color: #6b7280;
    cursor: not-allowed;
    opacity: 0.6;
}
.tool-btn.sync {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    border-color: #10b981;
}
.tool-btn.sync:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.tool-btn.filters {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    border-color: #475569;
}
.tool-btn.filters:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.35);
}
.info-actions-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.instance-info-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 11px;
    min-width: 280px;
}
.actions-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 4px;
}
.search-box input {
    padding: 5px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 12px;
    width: 140px;
    outline: none;
}
.search-box input:focus {
    border-color: var(--accent);
}
.search-box button {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
}
.action-btn-small {
    padding: 5px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 28px;
}
.action-btn-small:hover {
    background: var(--gray-200);
}
.action-btn-small.warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}
.action-btn-small.warning:hover {
    background: #fde68a;
}
.action-btn-small.primary {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}
.action-btn-small.primary:hover {
    background: #bfdbfe;
}
.info-row.primary-id {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 2px;
}
.info-row.primary-id .info-label {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 10px;
    text-transform: uppercase;
    min-width: 20px;
}
.info-row.primary-id .info-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
}
.info-item {
    display: flex;
    gap: 4px;
    align-items: baseline;
}
.info-label {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 10px;
    text-transform: uppercase;
}
.info-value {
    color: var(--gray-700);
    font-size: 11px;
}
.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    color: var(--gray-400);
    transition: var(--transition);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.copy-btn:hover {
    color: var(--accent);
    background: var(--gray-100);
}
.copy-btn:active {
    transform: scale(0.95);
}
.modern-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    white-space: nowrap;
}
.modern-btn:hover:not(:disabled) {
    background: var(--gray-200);
    border-color: var(--gray-400);
    color: var(--gray-900);
}
.modern-btn:active:not(:disabled) {
    background: var(--gray-300);
    transform: translateY(1px);
}
.modern-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.modern-btn.primary {
    background: var(--accent);
    border-color: var(--accent-dark);
    color: white;
}
.modern-btn.primary:hover:not(:disabled) {
    background: var(--accent-dark);
}
.modern-btn.success {
    background: var(--success);
    border-color: #059669;
    color: white;
}
.modern-btn.success:hover:not(:disabled) {
    background: #047857;
}
.modern-btn.danger {
    background: var(--danger);
    border-color: #be123c;
    color: white;
}
.modern-btn.danger:hover:not(:disabled) {
    background: #be123c;
}
.modern-btn.warning {
    background: var(--warning);
    border-color: #b45309;
    color: white;
}
.modern-btn.warning:hover:not(:disabled) {
    background: #b45309;
}
.modern-btn.toggle-filters-btn {
    background: var(--gray-100);
    border-color: var(--gray-300);
    font-size: 12px;
    padding: 6px 10px;
    min-width: 120px;
}
.modern-btn.toggle-filters-btn:hover:not(:disabled) {
    background: var(--gray-200);
    border-color: var(--gray-400);
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}
.info-item {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.info-label {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 11px;
    text-transform: uppercase;
    min-width: 65px;
}
.info-value {
    color: var(--gray-800);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 20px;
    border-right: 1px solid var(--gray-300);
}
.search-box input {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 140px;
    outline: none;
    transition: var(--transition);
}
.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1);
}
.search-box button {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-600);
}
.search-box button:hover {
    background: var(--gray-200);
    color: var(--primary);
}
.filter-select:hover {
    border-color: var(--gray-400);
    background-color: var(--gray-50);
}
.filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1);
}
.instance-info-panel { 
    display: flex; 
    gap: 16px; 
    padding: 6px 12px; 
    background: var(--gray-50); 
    border: 1px solid var(--gray-200); 
    border-radius: var(--radius-md); 
    font-size: 13px; 
    color: var(--gray-600); 
    align-items: center;
    margin-right: auto;
}
.hierarchy-selector-group { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.95)); 
    padding: 8px 12px; 
    border-radius: var(--radius-lg); 
    border: 2px solid var(--gray-200); 
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    min-height: 54px; /* Match instance control group height */
}
.selector-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.selector-item label { 
    font-weight: 700; 
    font-size: 14px; 
    color: var(--gray-700); 
    white-space: nowrap; 
}
.selector-item select { 
    min-width: 180px; 
    max-width: 240px; 
    padding: 8px 12px; 
    font-size: 14px; 
    border: 2px solid var(--gray-300); 
    border-radius: var(--radius-md); 
    background: white; 
    cursor: pointer; 
    transition: var(--transition); 
    font-weight: 500; 
    box-shadow: var(--shadow-sm); 
    height: 38px; 
}
.selector-item select:disabled { 
    background: var(--gray-100); 
    cursor: not-allowed; 
    opacity: 0.6; 
}
.selector-item select:hover:not(:disabled) { 
    border-color: var(--accent); 
    box-shadow: var(--shadow); 
    transform: translateY(-1px); 
}
.selector-item select:focus { 
    outline: none; 
    border-color: var(--accent); 
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.12); 
}
.instance-control-group { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.95)); 
    padding: 8px 12px; 
    border-radius: var(--radius-lg); 
    border: 2px solid var(--gray-200); 
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}
.control-divider {
    width: 1px;
    height: 32px;
    background: var(--gray-300);
    margin: 0 4px;
}
.nav-btn { 
    background: white; 
    border: 2px solid var(--gray-300); 
    color: var(--gray-700); 
    padding: 8px 16px; 
    border-radius: var(--radius-md); 
    font-size: 16px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: var(--transition); 
    box-shadow: var(--shadow-sm); 
    height: 38px; 
    min-width: 38px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.nav-btn:hover:not(:disabled) { 
    background: var(--gradient-accent); 
    border-color: var(--accent); 
    color: white; 
    transform: translateY(-1px); 
    box-shadow: var(--shadow-md); 
}
.nav-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--gray-100); }
.instance-info-wrapper { display: flex; align-items: center; gap: 4px; height: 38px; }
.instance-jump { width: 70px; padding: 6px 10px; background: white; color: var(--gray-800); border: 2px solid var(--accent); border-radius: var(--radius-md); font-weight: 700; font-size: 14px; text-align: center; box-shadow: var(--shadow-sm); transition: var(--transition); height: 38px; }
.instance-jump:focus { outline: none; border-color: var(--accent-dark); box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.12); background: var(--gray-50); }
.instance-jump:disabled { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-300); cursor: not-allowed; }
.instance-total { padding: 4px 8px; color: var(--gray-700); font-weight: 700; font-size: 14px; white-space: nowrap; }
.action-btn { 
    background: var(--gradient-accent); 
    border: 2px solid var(--accent-dark); 
    color: white; 
    padding: 8px 20px; 
    border-radius: var(--radius-md); 
    font-size: 14px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: var(--transition); 
    box-shadow: var(--shadow-sm); 
    height: 38px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    white-space: nowrap; 
}
.action-btn:hover:not(:disabled) { 
    background: linear-gradient(135deg, var(--accent-dark), #0e7490); 
    border-color: #0e7490; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.35); 
}
.action-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}
.action-btn:disabled { opacity: 0.6; cursor: wait; }
.sync-btn { 
    background: linear-gradient(135deg, #f59e0b, #d97706); 
    border-color: #d97706;
}
.sync-btn:hover:not(:disabled) { 
    background: linear-gradient(135deg, #d97706, #b45309); 
    border-color: #b45309; 
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35); 
}
.content { padding: 12px 16px; background: transparent; }
.metadata-panel, .history-section { border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.6); transition: all 0.2s ease; }
.metadata-panel:hover, .history-section:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
.metadata-panel { background: linear-gradient(135deg, rgba(203, 213, 225, 0.85) 0%, rgba(226, 232, 240, 0.85) 100%); }
.history-section { background: linear-gradient(135deg, rgba(14, 116, 144, 0.12) 0%, rgba(8, 145, 178, 0.08) 100%); border: 1px solid rgba(8, 145, 178, 0.2); }
.metadata-title, .history-title { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; transition: var(--transition); }
.metadata-title:hover, .history-title:hover { color: var(--accent); }
.metadata-toggle, .history-toggle { margin-left: auto; transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); font-size: 11px; color: var(--gray-400); }
.metadata-toggle.collapsed, .history-toggle.collapsed { transform: rotate(-90deg); }
.history-path { display: flex; align-items: center; gap: 4px; flex: 1; }
.history-meta-info { display: flex; align-items: center; gap: 12px; margin-left: 12px; margin-right: 8px; }
.history-timestamp-info { font-size: 11px; color: var(--gray-600); background: rgba(255, 255, 255, 0.6); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.path-segment { font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: 4px; }
.path-segment.client { background: #dbeafe; color: #1e40af; }
.path-segment.brand { background: #dcfce7; color: #166534; }
.path-segment.project { background: #fef3c7; color: #92400e; }
.path-segment.sku { background: #f3e8ff; color: #7c3aed; font-weight: 700; }
.path-separator { color: var(--gray-400); font-size: 10px; }
.history-status-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 8px;
}
.history-status-badge.active { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e40af; }
.history-status-badge.processing { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.history-status-badge.approved { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
.history-status-badge.rejected { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #991b1b; }
.history-status-badge.failed { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); color: #9d174d; }
.history-count { font-size: 11px; color: var(--gray-500); font-weight: 500; background: var(--gray-100); padding: 2px 8px; border-radius: 10px; }
.metadata-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; transition: max-height 0.3s ease-out, opacity 0.3s; max-height: 500px; overflow: hidden; opacity: 1; margin-top: 12px; }
.metadata-grid.hidden { max-height: 0; opacity: 0; margin-top: 0; }
.metadata-item { display: flex; flex-direction: column; gap: 2px; }
.metadata-item.full-width { grid-column: 1 / -1; }
.metadata-label { font-weight: 600; color: var(--gray-600); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.metadata-value { color: var(--gray-900); font-size: 13px; font-weight: 500; }
.metadata-export-btn { width: 100%; margin-top: 8px; }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; overflow-x: hidden; transition: max-height 0.3s ease-out, opacity 0.3s ease; padding: 4px 2px 4px 0; margin-top: 10px; }
.history-list.hidden { max-height: 0; overflow: hidden; margin-top: 0; padding: 0; opacity: 0; }
.history-item { background: white; padding: 10px 14px; border-radius: var(--radius-md); font-size: 12px; color: var(--gray-700); cursor: pointer; transition: all 0.2s ease; border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); font-weight: 500; position: relative; overflow: hidden; }
.history-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: 0; transition: opacity 0.2s; }
.history-item:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); border-color: var(--primary-light); transform: translateX(2px); }
.history-item:hover::before { opacity: 1; }
.history-item.approved { background: linear-gradient(135deg, rgba(209, 250, 229, 0.9) 0%, rgba(167, 243, 208, 0.9) 100%); border-color: #6ee7b7; }
.history-item.approved::before { background: var(--success); }
.history-item.discarded { background: linear-gradient(135deg, rgba(254, 226, 226, 0.9) 0%, rgba(254, 202, 202, 0.9) 100%); border-color: #fca5a5; }
.history-item.discarded::before { background: var(--danger); }
.step-status-indicator { font-size: 11px; margin-left: 4px; }
.step-status-indicator.pending { color: var(--warning); }
.step-status-indicator.failed { color: var(--danger); }
.history-empty {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    font-style: italic;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}
.main-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; min-height: 620px; max-width: 100%; }
.conditioning-panel, .review-panel { display: flex; flex-direction: column; gap: 8px; min-height: 660px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px); border-radius: var(--radius-lg); padding: 12px; box-shadow: var(--shadow-md); max-width: 100%; overflow: hidden; }
.conditioning-panel h3, .review-panel h3 { font-size: 13px; font-weight: 700; color: var(--gray-800); margin: 0 0 8px 0; letter-spacing: 0.3px; }
.conditioning-gallery-panel { background: white; border-radius: var(--radius-lg); padding: 12px; border: none; display: flex; flex-direction: column; gap: 8px; height: 580px; min-height: 580px; transition: all 0.2s ease; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); justify-content: flex-start; align-items: center; width: 100%; max-width: 100%; }
.conditioning-gallery-panel:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
.conditioning-gallery-panel.panel-failed { background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(254, 202, 202, 0.95) 100%); box-shadow: 0 0 0 2px #fca5a5, 0 4px 20px rgba(239, 68, 68, 0.15); }
.conditioning-gallery-panel.panel-processing { background: linear-gradient(135deg, rgba(254, 243, 199, 0.95) 0%, rgba(253, 230, 138, 0.95) 100%); box-shadow: 0 0 0 2px #fcd34d, 0 4px 20px rgba(245, 158, 11, 0.15); }
.conditioning-gallery-panel.panel-warning { background: linear-gradient(135deg, rgba(254, 215, 170, 0.95) 0%, rgba(253, 186, 116, 0.95) 100%); box-shadow: 0 0 0 2px #fb923c, 0 4px 20px rgba(249, 115, 22, 0.15); }
.conditioning-gallery-panel canvas, .conditioning-gallery-panel .gallery-main-image > img { max-width: 100%; max-height: 100%; border-radius: var(--radius-lg); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); object-fit: contain; }
.conditioning-gallery-panel canvas { cursor: crosshair; }
.gallery-horizontal-layout { display: flex; flex-direction: row; gap: 12px; width: 100%; height: 100%; align-items: stretch; }
.gallery-horizontal-layout.thumbnails-left { flex-direction: row; }
.gallery-horizontal-layout.thumbnails-right { flex-direction: row; }
.gallery-main-image { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; }
.gallery-main-image canvas, .gallery-main-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.conditioning-thumbnails { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overflow-x: hidden; padding: 4px; flex-shrink: 0; width: 90px; max-height: 100%; }
.conditioning-thumbnails.thumbnails-left { border-right: 1px solid var(--gray-200); padding-right: 10px; }
.conditioning-thumbnails.thumbnails-right { border-left: 1px solid var(--gray-200); padding-left: 10px; }
.conditioning-thumbnail { position: relative; width: 74px; min-width: 74px; height: 74px; min-height: 74px; border-radius: var(--radius-md); overflow: hidden; border: 3px solid var(--gray-300); cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); background: var(--gray-100); box-shadow: var(--shadow-sm); flex-shrink: 0; }
.conditioning-thumbnail:hover { border-color: var(--accent-light); transform: translateX(3px) scale(1.03); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); }
.thumbnails-right .conditioning-thumbnail:hover { transform: translateX(-3px) scale(1.03); }
.conditioning-thumbnail.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.25), 0 4px 12px rgba(8, 145, 178, 0.3); }
.conditioning-thumbnail.active:hover { transform: scale(1.05); }
.conditioning-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.conditioning-thumbnail .thumbnail-label { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); color: white; padding: 4px 2px 2px; font-size: 9px; font-weight: 600; text-align: center; letter-spacing: 0.3px; }
.block-message { width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; text-align: center; flex: 1; min-height: 400px; }
.block-message .block-icon { font-size: 56px; }
.block-message .block-text strong { font-size: 20px; color: var(--gray-800); display: block; margin-bottom: 10px; }
.block-message .block-text p { font-size: 14px; color: var(--gray-600); }
.block-message.pending .block-icon { color: var(--warning); }
.block-message.pending .block-text strong { color: #92400e; }
.block-message.failed .block-icon { color: var(--danger); }
.block-message.failed .block-text strong { color: #991b1b; }
.instructions-container { background: white; border-radius: var(--radius-lg); padding: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); border: none; margin-top: 12px; }
.instructions-container:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.instructions-container h3 { font-size: 13px; color: var(--gray-800); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-200); font-weight: 700; }
.comments-difficulty-row { display: flex; gap: 16px; margin-bottom: 10px; align-items: flex-start; }
.comments-section { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.comments-section label { font-weight: 600; color: var(--gray-700); font-size: 11px; }
.comments-section textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--gray-300); border-radius: var(--radius-md); font-size: 12px; font-family: inherit; resize: vertical; transition: all 0.2s ease; min-height: 55px; }
.comments-section textarea:hover { border-color: var(--gray-400); }
.comments-section textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1); }
.difficulty-section { width: 360px; flex-shrink: 0; }
.difficulty-section .difficulty-slider { margin-bottom: 0; }
.difficulty-section .slider-labels { padding: 0 4px; }
.difficulty-section .slider-label { font-size: 10px; }
.instructions-section { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.instructions-section label { font-weight: 600; color: var(--gray-700); font-size: 11px; }
.instructions-section textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--gray-300); border-radius: var(--radius-md); font-size: 12px; font-family: inherit; resize: vertical; transition: all 0.2s ease; min-height: 40px; }
.instructions-section textarea:hover { border-color: var(--gray-400); }
.instructions-section textarea:focus, .bbox-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1); }
.bbox-inputs-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bbox-inputs-header { font-weight: 600; color: var(--gray-700); font-size: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--gray-200); }
.bbox-input-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; background: white; border-radius: var(--radius-md); border: 1px solid var(--gray-200); transition: var(--transition); }
.bbox-input-row:hover { border-color: var(--accent-light); background: var(--gray-50); }
.bbox-number { width: 24px; height: 24px; background: var(--gradient-primary); color: white; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.bbox-input { flex: 1; padding: 6px 8px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font-size: 12px; transition: var(--transition); }
.btn-remove-bbox { background: var(--danger); color: white; border: none; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; }
.btn-remove-bbox:hover { background: #be123c; }
.sliders-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 10px; }
.difficulty-slider label, .difficulty-slider label { display: block; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; font-size: 12px; }
.slider-wrapper { max-width: 100%; }
.slider-labels { display: flex; justify-content: space-between; margin-bottom: 6px; padding: 0 4px; }
.slider-label { font-size: 10px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; transition: all 0.2s ease; }
.slider-label.active { color: var(--accent); font-size: 11px; }
input[type='range'] { width: 100%; height: 8px; border-radius: 4px; background: var(--gray-200); outline: none; -webkit-appearance: none; appearance: none; cursor: pointer; transition: background 0.25s; }
input[type='range']:hover { background: var(--gray-300); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3); transition: all 0.2s; }
input[type='range']::-webkit-slider-thumb:hover { transform: scale(1.25); background: var(--accent-dark); box-shadow: 0 4px 12px rgba(8, 145, 178, 0.5); }
input[type='range']::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3); }

/* Designer Assignment Dropdown */
.designer-assignment { margin-top: 12px; margin-bottom: 12px; }
.designer-assignment label { display: block; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; font-size: 12px; }
.designer-assignment select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: white;
    color: var(--gray-800);
    cursor: pointer;
    transition: var(--transition);
}
.designer-assignment select:hover { border-color: var(--accent-light); }
.designer-assignment select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.designer-assignment select:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

.instructions-actions {
    margin-top: 16px;
}
.instructions-actions h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}
.instructions-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.instructions-btn {
    flex: 1;
    min-width: 120px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.instructions-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.instructions-btn .btn-icon {
    font-size: 16px;
}
.instructions-btn .btn-text {
    font-size: 13px;
    font-weight: 600;
}
.instructions-btn.external {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
    color: white;
}
.instructions-btn.external:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
    transform: translateY(-2px);
}
body.dark-mode .instructions-btn.external {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: white;
}
body.dark-mode .instructions-btn.external:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}
.instructions-btn.automatic {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
}
.instructions-btn.automatic:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-dark) 0%, #0c6478 100%);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
    transform: translateY(-2px);
}
.instructions-btn.designer {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
    color: white;
}
.instructions-btn.designer:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
    transform: translateY(-2px);
}
.instructions-btn.internal {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
    color: white;
}
.instructions-btn.internal:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
    transform: translateY(-2px);
}
body.dark-mode .instructions-btn.internal {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}
body.dark-mode .instructions-btn.internal:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.5);
}
.action-buttons-wrapper { display: flex; justify-content: center; margin-top: 24px; }
.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { padding: 12px 20px; border: none; border-radius: var(--radius-lg); font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); white-space: nowrap; letter-spacing: 0.3px; position: relative; overflow: hidden; }
.btn::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transform: translate(-50%, -50%); transition: width 0.4s, height 0.4s; }
.btn:hover:not(:disabled)::before { width: 300px; height: 300px; }
.btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
.btn:active:not(:disabled) { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-approve { background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%); color: white; }
.btn-auto { background: var(--gradient-accent); color: white; }
.btn-designer { background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%); color: white; }
.btn-internal { background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%); color: white; }
.btn-discard { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; }
.btn-primary { background: var(--gradient-accent); color: white; }
.btn-danger { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; }
.btn-warning { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-left: 8px; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-discarded { background: #fee2e2; color: #991b1b; }
.status-processing { background: #dbeafe; color: #1e40af; }
.modal, .history-modal, .stats-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(12px); animation: fadeIn 0.3s ease; }
.history-modal { z-index: 1001; }
.stats-modal { z-index: 1002; }
.modal-content, .history-modal-content, .stats-modal-content { background-color: white; margin: 5% auto; padding: 0; border-radius: var(--radius-xl); max-width: 90vw; max-height: 85vh; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35); animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); display: flex; flex-direction: column; }
.history-modal-content { margin: 3% auto; max-width: 800px; }
.stats-modal-content { margin: 3% auto; max-width: 1200px; max-height: 90vh; }
.instance-list-modal-content { margin: 3% auto; max-width: 1400px; max-height: 85vh; width: 95vw; }
.modal-content img { width: 100%; height: auto; max-height: 85vh; object-fit: contain; display: block; }
.modal-close, .history-modal-close, .stats-modal-close { font-size: 28px; font-weight: bold; color: white; cursor: pointer; transition: all 0.3s ease; line-height: 1; }
.modal-close { position: absolute; right: 20px; top: 20px; background: rgba(0, 0, 0, 0.6); width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 10; backdrop-filter: blur(10px); }
.modal-close:hover { background: rgba(239, 68, 68, 0.95); transform: rotate(90deg) scale(1.15); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }
.history-modal-close:hover, .stats-modal-close:hover { color: var(--danger-light); transform: rotate(90deg); }
.history-modal-header { background: var(--gradient-primary); color: white; padding: 22px 28px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; left: 0; right: 0; z-index: 10; box-shadow: var(--shadow-md); flex-shrink: 0; }
.history-modal-header h3 { font-size: 20px; font-weight: 700; letter-spacing: 0.3px; }
.stats-modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-md);
}
.stats-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.stats-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.stats-download-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stats-download-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}
.stats-content {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}
.stats-section {
    margin-bottom: 32px;
}
.stats-section:last-child {
    margin-bottom: 0;
}
.stats-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 700px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.stats-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}
.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stats-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.stats-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}
.stats-card-subvalue {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}
.stats-bar-chart {
    margin-top: 12px;
}
.stats-bar-item {
    margin-bottom: 12px;
}
.stats-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--gray-700);
}
.stats-bar-label-name {
    font-weight: 600;
}
.stats-bar-label-value {
    color: var(--gray-600);
}
.stats-bar-track {
    height: 24px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.stats-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 11px;
    font-weight: 700;
}
.stats-bar-fill.success {
    background: linear-gradient(90deg, var(--success) 0%, #047857 100%);
}
.stats-bar-fill.warning {
    background: linear-gradient(90deg, var(--warning) 0%, #b45309 100%);
}
.stats-bar-fill.danger {
    background: linear-gradient(90deg, var(--danger) 0%, #be123c 100%);
}
.stats-bar-fill.primary {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
}
/* Stacked bar for designer breakdown */
.stats-bar-track.stacked {
    display: flex;
    overflow: hidden;
}
.stats-bar-track.stacked .stats-bar-fill {
    border-radius: 0;
    padding: 0;
    min-width: 2px;
}
.stats-bar-track.stacked .stats-bar-fill:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.stats-bar-track.stacked .stats-bar-fill:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.stats-bar-fill.approved {
    background: #10b981;
}
.stats-bar-fill.completed {
    background: #6366f1;
}
.stats-bar-fill.processing {
    background: #f59e0b;
}
.stats-bar-fill.rejected {
    background: #ef4444;
}
.stats-bar-legend {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-600);
}
.legend-item.approved { color: #10b981; }
.legend-item.completed { color: #6366f1; }
.legend-item.processing { color: #f59e0b; }
.legend-item.rejected { color: #ef4444; }
.designer-breakdown {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}
.designer-breakdown:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
/* Earnings table */
.earnings-table .designer-name {
    font-weight: 600;
}
.earnings-table .amount {
    text-align: right;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 12px;
}
.earnings-table .amount.total {
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-bg);
}
/* Price Configuration */
.price-config-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.price-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.price-config-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}
.price-config-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.price-config-card.automatic {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.05) 0%, white 100%);
}
.price-config-card.internal {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, white 100%);
}
.price-card-icon {
    font-size: 32px;
    margin-bottom: 8px;
}
.price-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 4px;
}
.price-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    font-family: 'SF Mono', 'Monaco', monospace;
}
.price-card-note {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}
.price-config-table {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--gray-200);
}
.price-config-table h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--gray-700);
}
.price-config-table .price {
    text-align: center;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-weight: 600;
}
.price-config-table .price.easy { color: #059669; }
.price-config-table .price.medium { color: #d97706; }
.price-config-table .price.hard { color: #dc2626; }
.difficulty-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.difficulty-dot.easy { background: #10b981; }
.difficulty-dot.medium { background: #f59e0b; }
.difficulty-dot.hard { background: #ef4444; }
/* Download button bar */
.stats-download-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}
.stats-download-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}
.stats-download-btn:hover {
    background: linear-gradient(135deg, var(--accent-dark) 0%, #0c6478 100%);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 12px;
}
.stats-table th {
    background: var(--gray-100);
    padding: 10px;
    text-align: left;
    font-weight: 700;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stats-table td {
    padding: 10px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}
.stats-table tr:hover {
    background: var(--gray-50);
}
.stats-table .id-cell {
    font-family: monospace;
    font-size: 10px;
    color: var(--gray-500);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-table .sku-cell {
    font-family: monospace;
    font-size: 11px;
    color: var(--gray-600);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-table .sku-cell-highlight {
    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-900);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-table .sku-header {
    font-weight: 700;
    color: var(--gray-900);
}
.stats-table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-top: 12px;
}
.stats-table-wrapper table {
    margin-top: 0;
}
.stats-table-more {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}
.stats-empty-table {
    padding: 20px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}
.stats-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}
.stats-card.highlight .stats-card-label {
    color: rgba(255, 255, 255, 0.85);
}
.stats-card.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}
.stats-card.warning .stats-card-value {
    color: #92400e;
}
.stats-card.danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #ef4444;
}
.stats-card.danger .stats-card-value {
    color: #991b1b;
}
.stats-card.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}
.stats-card.success .stats-card-value {
    color: #065f46;
}
.stats-charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
}
.stats-chart-container {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}
.stats-chart-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-align: center;
}
.stats-chart-container canvas {
    flex: 1;
    max-height: 180px;
}
.stats-dual-view {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: start;
}
.stats-chart-small {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 12px;
    height: 180px;
}
.stats-chart-small canvas {
    width: 100% !important;
    height: 100% !important;
}
@media (max-width: 1200px) {
    .stats-charts-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-charts-row .stats-chart-container:last-child {
        grid-column: span 2;
    }
}
@media (max-width: 900px) {
    .stats-charts-row {
        grid-template-columns: 1fr;
    }
    .stats-charts-row .stats-chart-container:last-child {
        grid-column: span 1;
    }
    .stats-dual-view {
        grid-template-columns: 1fr;
    }
    .stats-chart-small {
        height: 200px;
    }
}
.stats-card.highlight .stats-card-value {
    color: white;
}
.stats-card.highlight .stats-card-subvalue {
    color: rgba(255, 255, 255, 0.7);
}
#historyDetails { padding: 28px; overflow-y: auto; flex: 1; }
.history-detail-row { margin-bottom: 20px; }
.history-detail-row:last-child { margin-bottom: 0; }
.history-detail-row-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.history-detail-inline { display: flex; flex-direction: column; }
.history-detail-label { font-size: 12px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.history-detail-value { font-size: 15px; color: var(--gray-800); padding: 14px; background: var(--gray-50); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
.history-action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.history-action-buttons .btn { flex: 1; min-width: 150px; }
.bbox-list { display: flex; flex-direction: column; gap: 12px; }
.bbox-item { background: white; border: 2px solid var(--gray-200); border-radius: var(--radius-md); padding: 12px; }
.bbox-header { font-weight: 700; color: var(--gray-800); margin-bottom: 8px; font-size: 14px; }
.bbox-desc { font-size: 14px; color: var(--gray-700); font-style: italic; padding: 8px; background: var(--gray-50); border-radius: var(--radius-sm); }
.history-images-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 12px; }
.history-image-box { background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: var(--radius-md); padding: 12px; text-align: center; transition: var(--transition); cursor: pointer; }
.history-image-box:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.image-label-header { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 10px; padding: 6px 12px; background: var(--gray-100); border-radius: var(--radius-sm); display: inline-block; }
.history-thumbnail { width: 100%; height: auto; max-height: 250px; object-fit: contain; border-radius: var(--radius-sm); }
.instance-list-content {
    max-height: 60vh;
    overflow-y: auto;
}
.instance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.instance-table thead {
    position: sticky;
    top: 0;
    background: var(--gray-100);
    z-index: 10;
}
.instance-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 700;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.instance-table-row {
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--gray-200);
}
.instance-table-row:hover {
    background: var(--gray-100);
}
.instance-table-row.active {
    background: var(--accent-light);
    color: white;
}
.instance-table-row.active:hover {
    background: var(--accent);
}
.instance-table td {
    padding: 10px 8px;
}
.col-thumb {
    width: 40px;
    padding: 4px 8px !important;
}
.list-thumbnail {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
}
.list-thumbnail-placeholder {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 14px;
    color: var(--gray-400);
}
.col-num {
    width: 40px;
    font-weight: 600;
    color: var(--gray-600);
}
.instance-table-row.active .col-num {
    color: white;
}
.col-sku {
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.col-id {
    font-family: monospace;
    font-size: 11px;
    color: var(--gray-500);
    width: 60px;
    text-align: center;
}
.col-client, .col-brand, .col-project {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.col-status {
    width: 100px;
}
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-active {
    background: var(--gradient-info);
    color: #1e40af;
}
.status-processing {
    background: var(--gradient-warning);
    color: #92400e;
}
.status-approved {
    background: var(--gradient-success);
    color: #065f46;
}
.status-rejected, .status-failed {
    background: var(--gradient-danger);
    color: #991b1b;
}
.instance-table-row.active .status-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}
.col-updated {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
}
.instance-table-row.active .col-updated {
    color: rgba(255, 255, 255, 0.9);
}
@keyframes slideIn { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.loading-state, .empty-state { padding: 40px; text-align: center; color: var(--gray-500); }
.loading-state .icon { font-size: 24px; margin-bottom: 10px; }
.loading-state-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 60px 40px;
}
.loading-state-modern .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-state-modern .loading-text {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-600);
    letter-spacing: 0.3px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.clickable-path {
    cursor: pointer;
    transition: all 0.15s ease;
}
.clickable-path:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.clickable-path:active {
    transform: scale(0.98);
}
.instance-id-badge {
    font-size: 11px;
    color: var(--gray-500);
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--gray-100);
}
.instance-id-badge:hover {
    background: var(--gray-200);
    color: var(--primary);
}
body.dark-mode .instance-id-badge {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
}
body.dark-mode .instance-id-badge:hover {
    background: var(--border-color);
    color: var(--accent);
}
.clickable { cursor: pointer; }
.text-muted { color: var(--gray-500); }
.history-timestamp { color: var(--gray-500); margin-left: 8px; }
.step-designer { color: #64748b; font-size: 0.9em; margin-left: 8px; }
.empty-conditioning { color: var(--gray-500); padding: 20px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.control-panel {
    background: linear-gradient(to bottom, var(--gray-50), white);
    padding: 24px 40px;
    border-bottom: 2px solid var(--gray-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1800px;
    margin: 0 auto;
}
.top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.filters-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}
.filter-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}
.filter-row:last-child {
    margin-bottom: 0;
}
.filter-item-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-item-inline label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    min-width: 60px;
}
.filter-item-inline select {
    flex: 1;
    min-width: 0;
    width: 160px;
    max-width: 160px;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background-color: white;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}
.filter-item-inline select:hover {
    border-color: var(--gray-400);
}
.filter-item-inline select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.filter-item-inline select:disabled {
    background-color: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}
.instance-info-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}
.controls-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 24px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.control-divider {
    width: 1px;
    height: 28px;
    background: var(--gray-300);
}
.instance-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}
.instance-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}
.instance-jump {
    width: 60px;
    height: 32px;
    padding: 6px 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    outline: none;
    transition: var(--transition);
}
.instance-jump:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.instance-total {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}
.list-btn {
    padding: 4px 10px !important;
    font-size: 16px;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-box input {
    width: 200px;
    height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}
.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.search-box button {
    height: 32px;
    width: 32px;
    padding: 0;
    background: var(--accent);
    border: 1px solid var(--accent-dark);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-box button:hover {
    background: var(--accent-dark);
}
.search-box button:active {
    transform: scale(0.95);
}
@media (max-width: 1200px) {
    .top-section {
        grid-template-columns: 1fr;
    }
    .filter-row {
        grid-template-columns: 1fr;
    }
    .controls-section {
        flex-wrap: wrap;
    }
}
.settings-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.settings-modal-content {
    background: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}
.settings-modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}
.settings-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}
.settings-modal-close {
    color: white;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0 8px;
}
.settings-modal-close:hover {
    transform: rotate(90deg);
    color: var(--danger-light);
}
.settings-content {
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}
.bulk-delete-form .form-group,
.user-form .form-group {
    display: inline-block;
    width: calc(50% - 10px);
    vertical-align: top;
    margin-right: 10px;
}
.bulk-delete-form .form-group:nth-child(odd),
.user-form .form-group:nth-child(odd) {
    margin-right: 20px;
}
.bulk-delete-form .form-actions,
.user-form .form-actions {
    margin-top: 16px;
    clear: both;
}
.settings-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
}
.settings-tab {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.settings-tab:hover {
    background: rgba(8, 145, 178, 0.05);
    color: var(--accent);
}
.settings-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: white;
}
.settings-tab-content {
    display: none;
    padding: 24px;
}
.settings-tab-content.active {
    display: block;
}
.settings-section {
    margin-bottom: 32px;
}
.settings-section h4 {
    color: var(--gray-900);
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
}
.settings-description {
    color: var(--gray-600);
    font-size: 14px;
    margin: 0 0 20px 0;
}
.bulk-delete-form, .user-form {
    background: var(--gray-50);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 14px;
}
.form-group select,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}
.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.form-group select:disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}
.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.primary-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}
.form-group select:disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}
.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}
.danger-btn {
    background: linear-gradient(135deg, var(--danger) 0%, #be123c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.3);
}
.danger-btn:active {
    transform: translateY(0);
}

/* PreOps Groups Table */
.preops-groups-table {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}
.preops-groups-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.preops-groups-table th,
.preops-groups-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
.preops-groups-table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    position: sticky;
    top: 0;
    z-index: 1;
}
.preops-groups-table tr:hover {
    background: var(--gray-50);
}
.preops-groups-table tr:last-child td {
    border-bottom: none;
}
.preops-groups-table .sync-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.preops-groups-table .sync-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}
.preops-groups-table .sync-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
}
.preops-groups-table .synced-badge {
    color: var(--success);
    font-weight: 600;
    font-size: 12px;
}
.preops-groups-table .loading-state {
    padding: 40px;
    text-align: center;
    color: var(--gray-500);
}
.manual-fetch-controls {
    margin-bottom: 16px;
}
.manual-fetch-controls .inline-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.manual-fetch-controls .inline-group label {
    margin-bottom: 0;
    white-space: nowrap;
}
.manual-fetch-controls .inline-group select {
    width: auto;
    min-width: 120px;
}
.secondary-btn {
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.secondary-btn:hover {
    background: var(--gray-300);
}
body.dark-mode .preops-groups-table {
    border-color: var(--border-color);
}
body.dark-mode .preops-groups-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}
body.dark-mode .preops-groups-table td {
    border-color: var(--border-color);
}
body.dark-mode .preops-groups-table tr:hover {
    background: var(--bg-surface-elevated);
}
body.dark-mode .secondary-btn {
    background: var(--gray-300);
    color: var(--text-primary);
}
body.dark-mode .secondary-btn:hover {
    background: var(--gray-400);
}

/* Designer Selection Modal */
.designer-selection-modal {
    max-width: 400px;
    margin: 15% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.designer-selection-modal .modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.designer-selection-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.designer-selection-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    right: 0;
    top: 0;
    transition: all 0.2s;
}
.designer-selection-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}
.designer-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.designer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
}
.designer-option:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateX(4px);
}
.designer-option .designer-icon {
    font-size: 20px;
}
.designer-option .designer-name {
    font-weight: 500;
}

/* Magnifier Lens */
.magnifier-lens {
    position: absolute;
    border: 3px solid var(--accent);
    border-radius: 50%;
    cursor: none;
    pointer-events: none;
    z-index: 3000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 
                inset 0 0 15px rgba(255, 255, 255, 0.1);
    background-repeat: no-repeat;
    display: none;
    overflow: hidden;
}
.magnifier-lens::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 50%);
    pointer-events: none;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-switch:has(input:checked) {
    background: var(--primary);
}
.toggle-switch.active {
    background: var(--primary);
}
.toggle-switch .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.active .toggle-slider,
.toggle-switch:has(input:checked) .toggle-slider {
    left: 26px;
}

/* Slider with value display */
.slider-with-value {
    display: flex;
    align-items: center;
    gap: 12px;
}
.slider-with-value input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}
.slider-with-value input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.slider-with-value .value-display {
    min-width: 40px;
    text-align: center;
    font-weight: 500;
    color: var(--gray-700);
}

/* Settings section */
.settings-section {
    margin-bottom: 24px;
}
.settings-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}
.setting-row:last-child {
    border-bottom: none;
}
.setting-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.setting-label span:first-child {
    font-weight: 500;
    color: var(--gray-800);
}
.setting-label .setting-description {
    font-size: 12px;
    color: var(--gray-500);
}

/* Dark mode overrides for settings */
body.dark-mode .toggle-switch {
    background: #475569;
}
body.dark-mode .toggle-switch.active {
    background: #6366f1;
}
body.dark-mode .slider-with-value input[type="range"] {
    background: #475569;
}
body.dark-mode .slider-with-value input[type="range"]::-webkit-slider-thumb {
    background: #6366f1;
}
body.dark-mode .slider-with-value .value-display {
    color: #e2e8f0;
}
body.dark-mode .settings-section h4 {
    color: #cbd5e1;
}
body.dark-mode .setting-row {
    border-bottom-color: #334155;
}
body.dark-mode .setting-label span:first-child {
    color: #f1f5f9;
}
body.dark-mode .setting-label .setting-description {
    color: #94a3b8;
}

/* Pricing form */
.pricing-form {
    background: var(--gray-50);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}
.pricing-inputs {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}
.difficulty-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.difficulty-easy-badge {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}
.difficulty-medium-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}
.difficulty-hard-badge {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

/* Dark mode for pricing */
body.dark-mode .pricing-form {
    background: var(--bg-primary);
    border-color: var(--border-color);
}
body.dark-mode .pricing-inputs {
    border-top-color: var(--border-color);
}
body.dark-mode .form-group input[type="number"] {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}
body.dark-mode .form-group input[type="number"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.3);
}
body.dark-mode .difficulty-easy-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.4));
    color: #6ee7b7;
}
body.dark-mode .difficulty-medium-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4));
    color: #fcd34d;
}
body.dark-mode .difficulty-hard-badge {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.4));
    color: #fca5a5;
}
