/* PlexiFlow - Base Styles */
/* Auto-extracted from base.html */

:root {
    --primary: #0A2463;
    --primary-light: #1E3A8A;
    --secondary: #3E92CC;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --bg-primary: #F8FAFC;
    --bg-card: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border: #E2E8F0;
    --sidebar-width: 220px;
    --sidebar-collapsed: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: 'Segoe UI', -apple-system, sans-serif; font-size: 14px; }

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, #0d2d5a 100%);
    color: white;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.2s;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-header { padding: 1rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { width: 28px; height: 28px; background: white; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.sidebar-brand { font-weight: 700; font-size: 1.1rem; }
.sidebar.collapsed .sidebar-brand { display: none; }
.sidebar-toggle { margin-left: auto; background: rgba(255,255,255,0.1); border: none; color: white; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sidebar.collapsed .sidebar-toggle { margin: 0 auto; }
.sidebar-toggle:hover { background: rgba(255,255,255,0.2); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem; }
.nav-section { margin-bottom: 0.5rem; }
.nav-section-title { font-size: 0.65rem; text-transform: uppercase; color: rgba(255,255,255,0.4); padding: 0.75rem 0.75rem 0.35rem; }
.sidebar.collapsed .nav-section-title { font-size: 0; height: 8px; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; color: rgba(255,255,255,0.8); text-decoration: none; border-radius: 6px; margin-bottom: 2px; transition: all 0.15s; }
.nav-link:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-link.active { background: rgba(255,255,255,0.15); color: white; }
.nav-link i { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-badge {
    background: #EF4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
}
.sidebar.collapsed .sidebar-badge { display: none; }
.sidebar.collapsed .nav-link span { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 0.7rem; }
.nav-link.highlight { background: linear-gradient(135deg, #10B981, #059669); }
.sidebar-user { padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 0.75rem; }
.user-avatar-sm { width: 32px; height: 32px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.75rem; flex-shrink: 0; }
.user-info-sm { flex: 1; min-width: 0; }
.user-name-sm { font-weight: 600; font-size: 0.85rem; }
.user-role-sm { font-size: 0.7rem; color: rgba(255,255,255,0.6); text-transform: capitalize; }
.sidebar.collapsed .user-info-sm { display: none; }
.logout-btn { background: rgba(239,68,68,0.2); border: none; color: white; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.logout-btn:hover { background: rgba(239,68,68,0.4); }

.main-wrapper { margin-left: var(--sidebar-width); transition: margin-left 0.2s; min-height: 100vh; display: flex; flex-direction: column; }
.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-collapsed); }
.topbar { height: 52px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; position: sticky; top: 0; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.mobile-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; cursor: pointer; }
.topbar-search { display: flex; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; padding: 0 0.75rem; width: 280px; }
.topbar-search input { border: none; background: transparent; padding: 0.5rem; font-size: 0.85rem; width: 100%; outline: none; }
.topbar-search button { background: none; border: none; color: var(--text-secondary); cursor: pointer; }
.topbar-btn { position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); text-decoration: none; }
.topbar-btn:hover { background: var(--border); }
.notif-badge { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; background: var(--danger); color: white; border-radius: 50%; font-size: 0.6rem; display: flex; align-items: center; justify-content: center; }
.main-content { flex: 1; padding: 1.25rem; max-width: 1600px; }
.footer { text-align: center; padding: 1rem; color: var(--text-secondary); font-size: 0.75rem; border-top: 1px solid var(--border); }

.card { background: white; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.card-body { padding: 1.25rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: white; border-radius: 10px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid var(--border); display: flex; align-items: center; gap: 0.875rem; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-icon.primary { background: rgba(10,36,99,0.1); color: var(--primary); }
.stat-icon.success { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.stat-icon.info { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; font-weight: 500; text-decoration: none; cursor: pointer; border: none; transition: all 0.15s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.75rem 1rem; font-size: 0.75rem; font-weight: 600; color: #334155; text-transform: uppercase; border-bottom: 2px solid var(--border); background: var(--bg-primary); }
td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); }
tr:hover { background: var(--bg-primary); }
.status-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.6rem; border-radius: 50px; font-size: 0.7rem; font-weight: 500; }
.status-new { background: rgba(59,130,246,0.1); color: #3B82F6; }
.status-confirmed { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.status-in_production { background: rgba(245,158,11,0.1); color: #F59E0B; }
.status-completed { background: rgba(5,150,105,0.1); color: #059669; }
.status-to_ship,.status-shipped { background: rgba(6,182,212,0.1); color: #06B6D4; }
.status-invoiced { background: rgba(99,102,241,0.1); color: #6366F1; }
.status-closed { background: rgba(55,65,81,0.1); color: #374151; }
.status-cancelled { background: rgba(239,68,68,0.1); color: #EF4444; }
.task-pending { background: rgba(148,163,184,0.1); color: #94A3B8; }
.task-in_progress { background: rgba(245,158,11,0.1); color: #F59E0B; }
.task-done { background: rgba(16,185,129,0.1); color: #10B981; }
.progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 50px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 50px; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.85rem; }
.form-input,.form-select,.form-textarea { width: 100%; padding: 0.6rem 0.875rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; background: white; }
.form-input:focus,.form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(10,36,99,0.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.875rem; }
.alert { padding: 0.875rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: rgba(16,185,129,0.1); color: #065F46; border: 1px solid rgba(16,185,129,0.2); }
.alert-error { background: rgba(239,68,68,0.1); color: #991B1B; border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: rgba(245,158,11,0.1); color: #92400E; border: 1px solid rgba(245,158,11,0.2); }
.alert-info { background: rgba(59,130,246,0.1); color: #1E40AF; border: 1px solid rgba(59,130,246,0.2); }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.875rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-subtitle { font-size: 0.85rem; color: var(--text-secondary); }
.empty-state { text-align: center; padding: 2.5rem; color: var(--text-secondary); }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.875rem; padding: 0.875rem; background: var(--bg-primary); border-radius: 8px; }
.deadline-ok { color: var(--success); }
.deadline-soon { color: var(--warning); }
.deadline-today { color: #F97316; font-weight: 600; }
.deadline-overdue { color: var(--danger); font-weight: 600; background: rgba(239,68,68,0.1); padding: 0.2rem 0.4rem; border-radius: 4px; }
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-wrapper { margin-left: 0 !important; }
    .mobile-toggle { display: flex; }
    .topbar-search { width: 180px; }
}
@media (max-width: 600px) { .topbar-search { display: none; } .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; }
.mobile-overlay.active { display: block; }
.login-page .main-wrapper { margin-left: 0; }
.login-page .main-content { max-width: 400px; margin: 2rem auto; }
    
/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: #1E293B;
    color: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    min-width: 280px;
    max-width: 420px;
    font-size: 0.9rem;
    pointer-events: auto;
    cursor: pointer;
}

.toast:hover { opacity: 0.9; }

.toast.success { background: linear-gradient(135deg, #059669, #047857); }
.toast.error { background: linear-gradient(135deg, #DC2626, #B91C1C); }
.toast.warning { background: linear-gradient(135deg, #D97706, #B45309); }
.toast.info { background: linear-gradient(135deg, #2563EB, #1D4ED8); }

.toast i { font-size: 1.1rem; flex-shrink: 0; }
.toast span { flex: 1; }

.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem;
    flex-shrink: 0;
}

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

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

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

/* KEYBOARD SHORTCUTS MODAL */
.shortcuts-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.shortcuts-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #E2E8F0;
}

.shortcuts-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shortcuts-header h3 i { color: #2563EB; }

.shortcuts-header button {
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem;
}

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

.sc-group h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748B;
    margin: 0 0 0.6rem;
    letter-spacing: 0.5px;
}

.sc-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.2rem 0.5rem;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 1px 0 #CBD5E1;
}

/* DARK MODE */
[data-theme="dark"] {
    --primary: #3B82F6;
    --primary-light: #60A5FA;
    --secondary: #5BA8D8;
    --bg-primary: #0F172A;
    --bg-card: #1E293B;
    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;
    --border: #334155;
}

[data-theme="dark"] body { background: var(--bg-primary); color: var(--text-primary); }

[data-theme="dark"] .topbar { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .topbar-search { background: var(--bg-primary); border-color: var(--border); }
[data-theme="dark"] .topbar-search input { color: var(--text-primary); }
[data-theme="dark"] .topbar-btn { background: var(--bg-primary); border-color: var(--border); color: var(--text-secondary); }

[data-theme="dark"] .card, [data-theme="dark"] .stat-card { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .card-header { border-color: var(--border); }

[data-theme="dark"] th { background: var(--bg-primary); color: var(--text-secondary); border-color: var(--border); }
[data-theme="dark"] td { border-color: var(--border); }
[data-theme="dark"] tr:hover { background: rgba(255,255,255,0.03); }

[data-theme="dark"] .form-input, [data-theme="dark"] .form-select, [data-theme="dark"] .form-textarea {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .filters { background: var(--bg-card); }
[data-theme="dark"] .footer { border-color: var(--border); color: var(--text-secondary); }

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
}

[data-theme="dark"] .shortcuts-content { background: var(--bg-card); color: var(--text-primary); }
[data-theme="dark"] .shortcuts-header { border-color: var(--border); }
[data-theme="dark"] kbd { background: var(--bg-primary); border-color: var(--border); color: var(--text-primary); box-shadow: 0 1px 0 var(--border); }

[data-theme="dark"] .btn-outline { border-color: var(--border); color: var(--text-primary); }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,0.15); color: #34D399; border-color: rgba(16,185,129,0.3); }
[data-theme="dark"] .alert-error { background: rgba(239,68,68,0.15); color: #FCA5A5; border-color: rgba(239,68,68,0.3); }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,0.15); color: #FCD34D; border-color: rgba(245,158,11,0.3); }
[data-theme="dark"] .alert-info { background: rgba(59,130,246,0.15); color: #93C5FD; border-color: rgba(59,130,246,0.3); }

[data-theme="dark"] .mobile-overlay.active { background: rgba(0,0,0,0.7); }

/* Dark mode toggle */
.theme-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.7);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); color: white; }

/* MOBILE BOTTOM NAVIGATION */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 1001;
    padding: 0.25rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.6rem;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    font-family: inherit;
}

.bottom-nav .bnav-item i { font-size: 1.1rem; }
.bottom-nav .bnav-item.active { color: var(--primary); }
.bottom-nav .bnav-item.active i { color: var(--primary); }

.bnav-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(calc(50% + 10px));
    background: var(--danger);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    line-height: 1.3;
}

@media (max-width: 900px) {
    .bottom-nav { display: flex; }
    .main-content { padding-bottom: 70px; }
}

[data-theme="dark"] .bottom-nav {
    background: var(--bg-card);
    border-color: var(--border);
}

/* AUTO-REFRESH INDICATOR */
.auto-refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--success);
    background: rgba(16,185,129,0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}
.auto-refresh-indicator i {
    font-size: 0.6rem;
    animation: spin 3s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* SEARCH AUTOCOMPLETE */
.topbar-search { position: relative; }

.search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--bg-primary); }
.suggestion-item i { width: 16px; color: var(--text-secondary); flex-shrink: 0; }

.sg-title { font-size: 0.85rem; font-weight: 500; }
.sg-sub { font-size: 0.75rem; color: var(--text-secondary); }

[data-theme="dark"] .search-suggestions {
    background: var(--bg-card);
    border-color: var(--border);
}

/* PRINT STYLES */
@media print {
    .sidebar, .topbar, .bottom-nav, .mobile-overlay,
    .toast-container, .shortcuts-modal, .status-modal,
    .auto-refresh-indicator, .theme-toggle { display: none !important; }

    .main-wrapper { margin-left: 0 !important; }
    .main-content { padding: 0 !important; max-width: 100% !important; }

    body { background: white !important; color: black !important; font-size: 12px; }

    .card, .stat-card, .compact-card, .chart-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .btn, .btn-primary, .btn-danger, .btn-success, .btn-outline,
    .action-btn, .logout-btn, .note-toggle-btn,
    .quick-task-add, .bulk-select, .filters,
    .page-actions, .topbar-search { display: none !important; }

    a { color: black !important; text-decoration: none !important; }

    table { font-size: 11px; }
    th { background: #f0f0f0 !important; }

    .footer { display: none !important; }

    .page-header { margin-bottom: 0.5rem; }
    .page-title { font-size: 1.2rem; }

    .stats-grid { grid-template-columns: repeat(4, 1fr); }

    /* Order detail - clean print */
    .status-select-modern { border: none; background: none; font-weight: bold; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }

    /* Chart canvas won't print well - hide or show fallback */
    canvas { max-height: 200px; }
}

/* BREADCRUMBS */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }

.breadcrumbs .bc-sep {
    font-size: 0.6rem;
    color: var(--border);
}

.breadcrumbs .bc-current {
    color: var(--text-primary);
    font-weight: 500;
}

@media print { .breadcrumbs { display: none !important; } }

/* COLLAPSIBLE SIDEBAR SECTIONS */
.nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.section-chevron {
    font-size: 0.5rem;
    transition: transform 0.2s;
    opacity: 0.5;
}

.collapsed-section .section-chevron {
    transform: rotate(-90deg);
}

.collapsed-section .nav-link {
    display: none !important;
}

.sidebar.collapsed .section-chevron { display: none; }

/* LOADING SKELETON */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.4) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    color: transparent !important;
}

.skeleton * { visibility: hidden; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Page loading indicator */
.page-loader {
    position: fixed;
    top: 52px;
    left: var(--sidebar-width);
    right: 0;
    height: 3px;
    z-index: 9999;
    overflow: hidden;
}

.page-loader-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: pageLoad 1s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes pageLoad {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.page-loader.loaded { display: none; }

@media (max-width: 900px) {
    .page-loader { left: 0; }
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.08) 50%, var(--border) 75%);
    background-size: 200% 100%;
}

/* RELATIVE TIME */
.time-ago {
    font-size: 0.75em;
    color: var(--text-secondary);
    font-weight: 400;
}

/* CONFIRMATION DIALOG */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s;
}
.confirm-overlay.confirm-visible {
    opacity: 1;
}
.confirm-dialog {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.2s;
}
.confirm-visible .confirm-dialog {
    transform: scale(1);
}
.confirm-icon {
    font-size: 2.5rem;
    color: #EF4444;
    margin-bottom: 12px;
}
.confirm-message {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-actions .btn {
    min-width: 100px;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}
.confirm-actions .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.confirm-actions .btn-danger {
    background: #EF4444;
    color: white;
}
.confirm-actions .btn:hover {
    opacity: 0.85;
}

/* SKELETON LOADING VARIANTS */
.skeleton-text {
    display: inline-block;
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.4) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    min-height: 1em;
    min-width: 60px;
}
.skeleton-text.sk-lg { min-width: 80px; min-height: 2em; }
.skeleton-text.sk-sm { min-width: 40px; min-height: 0.8em; }

.skeleton-chart {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.15) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    height: 200px;
}

[data-theme="dark"] .skeleton-text,
[data-theme="dark"] .skeleton-chart {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.06) 50%, var(--border) 75%);
    background-size: 200% 100%;
}

/* FADE IN after load */
.fade-in-content {
    animation: fadeInContent 0.3s ease-out;
}
@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* INLINE EDIT */
.inline-edit-trigger {
    cursor: pointer;
    border-bottom: 1px dashed var(--border);
    transition: border-color 0.15s;
}
.inline-edit-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.inline-edit-form {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.inline-edit-form input {
    font-size: 0.85rem;
    padding: 2px 6px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    width: 110px;
}
.inline-edit-form button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.85rem;
}
.inline-edit-form .ie-save { color: var(--success); }
.inline-edit-form .ie-cancel { color: var(--text-secondary); }

/* ACTIVITY FEED */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.activity-item:hover {
    background: var(--bg-secondary);
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: white;
}
.activity-icon.ai-new { background: var(--primary); }
.activity-icon.ai-status { background: var(--warning); }
.activity-icon.ai-done { background: var(--success); }
.activity-icon.ai-task { background: #8B5CF6; }
.activity-icon.ai-note { background: #6366F1; }
.activity-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}
.activity-text strong {
    color: var(--primary);
}
.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-top: 2px;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state-icon {
    font-size: 4rem;
    color: var(--border);
    margin-bottom: 16px;
}
.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.empty-state-text {
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto 20px;
    line-height: 1.5;
}
.empty-state-action {
    margin-top: 16px;
}

/* MOBILE FAB */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 1000;
}
.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.2s, background 0.2s;
}
.fab-main:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}
.fab-main.open {
    transform: rotate(45deg);
    background: var(--danger);
}
.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 10px;
}
.fab-menu.show {
    display: flex;
}
.fab-item {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.15s;
}
.fab-item:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.fab-label {
    position: absolute;
    right: 54px;
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.15s;
}
.fab-item:hover .fab-label {
    opacity: 1;
}

@media (max-width: 900px) {
    .mobile-fab {
        display: block;
    }
}

/* COMMAND PALETTE */
.cmd-palette {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.cmd-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}
.cmd-modal {
    position: relative;
    background: var(--bg-card);
    border-radius: 12px;
    width: 90%;
    max-width: 580px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.cmd-input-wrap {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.cmd-input-wrap i {
    color: var(--text-secondary);
    font-size: 1.1rem;
}
.cmd-input-wrap input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
}
.cmd-input-wrap kbd {
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.cmd-results {
    max-height: calc(70vh - 70px);
    overflow-y: auto;
    padding: 8px;
}
.cmd-section {
    margin-bottom: 8px;
}
.cmd-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 8px 12px;
    font-weight: 600;
}
.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.1s;
}
.cmd-item:hover, .cmd-item:focus {
    background: var(--bg-secondary);
}
.cmd-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}
.cmd-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* MOBILE SIDEBAR FIXES */
.sidebar.mobile-open {
    z-index: 1100;
}
.sidebar-user {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0.75rem));
}
@media (max-width: 900px) {
    .sidebar {
        padding-bottom: 60px;
    }
    .sidebar-user {
        padding-bottom: max(calc(0.75rem + env(safe-area-inset-bottom, 0px)), 0.75rem);
    }
    /* Tables responsive */
    .table-container, .orders-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 500px;
    }
    /* Cards full width on mobile */
    .card {
        border-radius: 8px;
    }
    .main-content {
        padding: 0.75rem;
        padding-bottom: 80px;
    }
}
@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .page-title {
        font-size: 1.2rem;
    }
    .page-subtitle {
        font-size: 0.75rem;
    }
    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
