/* Stockly - Modern Theme with Design Tokens */
/* Google Fonts loaded asynchronously via <link rel="preload"> in HTML files */

/* ═══════ DESIGN TOKENS ═══════ */
:root {
    /* Brand */
    --brand-primary: #4F46E5;
    --brand-primary-hover: #4338CA;
    --brand-primary-light: rgba(79, 70, 229, 0.1);
    --brand-primary-ring: rgba(79, 70, 229, 0.15);
    --brand-secondary: #7C3AED;
    --brand-gradient: linear-gradient(135deg, #4F46E5, #7C3AED);

    /* Surfaces */
    --bg-body: #F1F5F9;
    --bg-sidebar: #0F172A;
    --bg-card: #FFFFFF;
    --bg-card-nested: #F8FAFC;
    --bg-input: #FFFFFF;
    --bg-hover: #F1F5F9;
    --bg-table-header: #F8FAFC;

    /* Borders */
    --border-primary: #E2E8F0;
    --border-secondary: #CBD5E1;
    --border-input: #CBD5E1;
    --border-sidebar: #1E293B;

    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-tertiary: #64748B;
    --text-muted: #94A3B8;
    --text-placeholder: #94A3B8;
    --text-inverse: #F8FAFC;

    /* Sidebar specific */
    --sidebar-text: #94A3B8;
    --sidebar-text-hover: #E2E8F0;
    --sidebar-text-active: #FFFFFF;
    --sidebar-item-hover: rgba(255, 255, 255, 0.06);
    --sidebar-item-active: rgba(79, 70, 229, 0.2);
    --sidebar-group-label: #64748B;
    --sidebar-header-text: #F1F5F9;

    /* Status */
    --status-success: #059669;
    --status-success-bg: rgba(5, 150, 105, 0.1);
    --status-warning: #D97706;
    --status-warning-bg: rgba(217, 119, 6, 0.1);
    --status-danger: #DC2626;
    --status-danger-bg: rgba(220, 38, 38, 0.1);
    --status-info: #4F46E5;
    --status-info-bg: rgba(79, 70, 229, 0.1);

    /* Shadows — Win11 soft, diffused layered shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.04), 0 12px 36px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.06), 0 24px 80px rgba(0, 0, 0, 0.08);

    /* Spacing & Radius — Win11 generous rounding */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    /* Transitions — Win11 smooth, springy feel */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-body: #0B1120;
    --bg-sidebar: #070D1A;
    --bg-card: #151D2E;
    --bg-card-nested: #1A2332;
    --bg-input: #1A2332;
    --bg-hover: #1E293B;
    --bg-table-header: #1A2332;

    --border-primary: #1E293B;
    --border-secondary: #2D3A4E;
    --border-input: #2D3A4E;
    --border-sidebar: #0F172A;

    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --text-muted: #64748B;
    --text-placeholder: #475569;
    --text-inverse: #0F172A;

    --sidebar-text: #64748B;
    --sidebar-text-hover: #CBD5E1;
    --sidebar-text-active: #FFFFFF;
    --sidebar-item-hover: rgba(255, 255, 255, 0.05);
    --sidebar-item-active: rgba(79, 70, 229, 0.25);
    --sidebar-group-label: #475569;
    --sidebar-header-text: #E2E8F0;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1), 0 12px 36px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.12), 0 24px 80px rgba(0, 0, 0, 0.16);
}

/* ═══════ SETUP WIZARD ═══════ */
#setup-wizard { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; padding: clamp(20px, 4vw, 36px); overflow-y: auto; }
.setup-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(7, 16, 29, 0.84) 0%, rgba(11, 22, 40, 0.72) 52%, rgba(7, 16, 29, 0.86) 100%); }
.setup-shell { position: relative; z-index: 1; align-items: stretch; width: min(100%, var(--theme-auth-shell-max-width, 1100px)); }
/* Spotlight must not clip step-rail labels (active item translates; long copy wraps). */
.theme-auth-shell--setup .theme-auth-spotlight.setup-spotlight,
.setup-spotlight {
    overflow: visible;
    min-height: 0;
}
.theme-auth-shell--setup .theme-auth-spotlight-title {
    line-height: 1.22;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.theme-auth-shell--setup .theme-auth-spotlight-copy {
    max-width: none;
    overflow-wrap: anywhere;
}
.setup-step-rail { display: grid; gap: 12px; margin-top: 26px; padding-right: 8px; }
.setup-step-rail-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); color: rgba(226, 232, 240, 0.86); transition: transform var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal); min-width: 0; }
.setup-step-rail-item > div { min-width: 0; flex: 1; }
.setup-step-rail-item strong { display: block; font-size: 13px; color: #F8FAFC; overflow-wrap: anywhere; }
.setup-step-rail-item span:last-child { display: block; margin-top: 4px; font-size: 12px; line-height: 1.55; color: rgba(203, 213, 225, 0.8); overflow-wrap: anywhere; }
.setup-step-rail-item__dot { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0; font-size: 12px; font-weight: 800; background: rgba(148, 163, 184, 0.18); color: #E2E8F0; border: 1px solid rgba(255, 255, 255, 0.12); }
.setup-step-rail-item.is-active { transform: translateX(4px); background: rgba(99, 102, 241, 0.16); border-color: rgba(129, 140, 248, 0.34); }
.setup-step-rail-item.is-active .setup-step-rail-item__dot { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #FFFFFF; border-color: transparent; box-shadow: 0 14px 28px rgba(99, 102, 241, 0.28); }
.setup-step-rail-item.is-complete { border-color: rgba(52, 211, 153, 0.22); background: rgba(16, 185, 129, 0.1); }
.setup-step-rail-item.is-complete .setup-step-rail-item__dot { background: linear-gradient(135deg, #10B981, #34D399); color: #FFFFFF; border-color: transparent; }
.setup-card { position: relative; width: 100%; max-width: 580px; overflow: hidden; animation: setupSlideUp 0.6s cubic-bezier(0.16,1,0.3,1); }
/* Opaque light card so dark page glass doesn't hide headings/labels; clip progress to radius */
.theme-auth-shell--setup .theme-login-card.setup-card {
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
@keyframes setupSlideUp { from { opacity: 0; transform: translateY(40px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

#setup-logo-input,
#setup-logo-preview,
#setup-error,
#setup-sap-fields,
#alerts-badge,
#import-file,
#import-status,
#import-preview,
#settings-modal-overlay,
#confirm-modal,
#whats-new-modal {
    display: none;
}

#setup-progress-fill { width: 25%; }
#progress-bar { width: 0%; }

.setup-progress {
    height: 5px;
    background: rgba(226, 232, 240, 0.92);
    border-radius: 0;
    overflow: hidden;
}
.setup-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5, #7C3AED, #06B6D4);
    border-radius: 0 999px 999px 0;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
}

.setup-step { display: none; }
.setup-step.active { display: block; animation: setupFadeIn 0.35s ease; }
@keyframes setupFadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.setup-header { padding: 28px 36px 16px; text-align: center; color: #0F172A; }
.setup-icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 20px; background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(124, 58, 237, 0.2)); margin-bottom: 16px; box-shadow: 0 16px 30px rgba(79, 70, 229, 0.14); }
.setup-icon-success { background: #ECFDF5; }
.setup-header h1 { font-size: 24px; font-weight: 800; color: #0F172A !important; margin: 0 0 6px; letter-spacing: -0.03em; line-height: 1.25; }
.setup-subtitle { font-size: 14px; color: #64748B !important; line-height: 1.6; margin: 0; }
.setup-success-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 7px 14px; border-radius: 999px; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.18); color: #059669; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.setup-body { padding: 8px 36px 24px; color: #0F172A; }
.setup-field { margin-bottom: 18px; }
.setup-field label { display: block; font-size: 13px; font-weight: 700; color: #334155 !important; margin-bottom: 7px; }
.setup-field .required { color: #EF4444; }
.setup-field .optional { color: #94A3B8; font-weight: 500; font-size: 12px; }
.setup-field input[type="text"], .setup-field input[type="password"], .setup-field input[type="email"], .setup-field input[type="tel"], .setup-field select { width: 100%; padding: 13px 16px; border-radius: 14px; border: 1.5px solid #D9E2EC; background: #F8FAFC; color: #0F172A; font-size: 14px; font-weight: 500; transition: all 0.3s cubic-bezier(0.16,1,0.3,1); font-family: inherit; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); }
.setup-source-options { display: grid; gap: 10px; }
.setup-source-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid #E2E8F0; background: #F8FAFC; font-size: 13px; color: #334155; cursor: pointer; line-height: 1.45; overflow-wrap: anywhere; }
.setup-source-option input { margin-top: 2px; flex-shrink: 0; }
.setup-error--global { display: none; margin: 0 36px 12px; padding: 10px 14px; border-radius: 10px; background: #FEF2F2; color: #B91C1C; font-size: 13px; }
.setup-field input:focus { outline: none; border-color: #6366F1; background: #FFFFFF; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 10px 24px rgba(99, 102, 241, 0.08); transform: translateY(-1px); }
.setup-hint { display: block; font-size: 11px; color: #94A3B8; margin-top: 5px; line-height: 1.5; }

.setup-logo-upload { border: 2px dashed #D9E2EC; border-radius: 18px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.35s cubic-bezier(0.16,1,0.3,1); position: relative; background: linear-gradient(180deg, #F8FAFC, #F1F5F9); }
.setup-logo-upload:hover { border-color: #6366F1; background: #F5F3FF; transform: translateY(-2px); }
.setup-logo-upload.dragging { border-color: #6366F1; background: #EEF2FF; }
.setup-logo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #6B7280; font-size: 13px; }
.setup-logo-preview { display: flex; align-items: center; justify-content: center; position: relative; }
.setup-logo-preview img { max-width: 120px; max-height: 120px; border-radius: 18px; object-fit: contain; background: #FFFFFF; border: 1px solid #E2E8F0; padding: 6px; }
.setup-logo-remove { position: absolute; top: -6px; right: calc(50% - 66px); width: 22px; height: 22px; border-radius: 50%; border: none; background: #EF4444; color: white; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }

.setup-footer { display: flex; justify-content: space-between; align-items: center; padding: 18px 36px 28px; border-top: 1px solid #E2E8F0; background: linear-gradient(180deg, rgba(248, 250, 252, 0.68), rgba(241, 245, 249, 0.92)); gap: 12px; }
.setup-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 24px; border-radius: 14px; border: 1px solid transparent; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.35s cubic-bezier(0.16,1,0.3,1); font-family: inherit; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05); white-space: normal; text-align: center; line-height: 1.3; }
.setup-btn-primary { background: linear-gradient(135deg, #4F46E5, #7C3AED); color: #FFFFFF; box-shadow: 0 16px 30px rgba(79,70,229,0.22); }
.setup-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 34px rgba(79,70,229,0.28); }
.setup-btn-primary:active { transform: scale(0.97); box-shadow: 0 10px 16px rgba(79,70,229,0.2); }
.setup-btn-secondary { background: rgba(241, 245, 249, 0.96); color: #334155; border-color: #D9E2EC; }
.setup-btn-secondary:hover { background: #E2E8F0; transform: translateY(-2px); }
.setup-btn-secondary:active { transform: scale(0.97); }
.setup-btn-launch { padding: 13px 32px; font-size: 15px; }
.setup-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.setup-error { background: #FEF2F2; color: #B91C1C; padding: 10px 14px; border-radius: 12px; font-size: 13px; border: 1px solid rgba(239, 68, 68, 0.18); border-left: 3px solid #EF4444; margin-top: 4px; }

.setup-summary { background: linear-gradient(180deg, #F8FAFC, #F1F5F9); border-radius: 18px; padding: 18px 20px; margin-bottom: 20px; border: 1px solid #E2E8F0; }
.setup-summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #E2E8F0; }
.setup-summary-row:last-child { border-bottom: none; }
.setup-summary-label { font-size: 13px; color: #64748B; flex-shrink: 0; }
.setup-summary-value { font-size: 13px; font-weight: 700; color: #0F172A; text-align: right; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }

.setup-next-steps { background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.12)); border-radius: 18px; padding: 18px 20px; border: 1px solid rgba(99, 102, 241, 0.16); }
.setup-next-steps h3 { font-size: 14px; font-weight: 700; color: #4338CA; margin-bottom: 10px; }
.setup-next-steps ul { list-style: none; padding: 0; }
.setup-next-steps li { font-size: 13px; color: #475569; padding: 4px 0; padding-left: 18px; position: relative; line-height: 1.6; }
.setup-next-steps li::before { content: '→'; position: absolute; left: 0; color: #7C3AED; font-weight: 600; }

/* Setup: SAP Integration step */
.setup-field-row { display: flex; gap: 14px; }
.setup-field-row .setup-field { flex: 1; }
.setup-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.setup-toggle input { opacity: 0; width: 0; height: 0; }
.setup-toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #D1D5DB; border-radius: 24px; transition: 0.25s; }
.setup-toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.25s; }
.setup-toggle input:checked + .setup-toggle-slider { background: #4F46E5; }
.setup-toggle input:checked + .setup-toggle-slider::before { transform: translateX(20px); }
.setup-sap-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; background: #FFFBEB; border-radius: 14px; border: 1px solid rgba(245, 158, 11, 0.16); border-left: 3px solid #F59E0B; margin-top: 8px; font-size: 12px; color: #92400E; line-height: 1.5; }
.setup-sap-note svg { flex-shrink: 0; margin-top: 1px; }
.setup-toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.setup-toggle-copy { font-size: 13px; color: #6B7280; }
@keyframes setupSpin { to { transform: rotate(360deg); } }
.setup-spin { display: inline-block; animation: setupSpin 1s linear infinite; }

@media (max-width: 960px) {
    #setup-wizard { padding: 18px; }
    .setup-step-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    #setup-wizard { padding: 14px; }
    .setup-header,
    .setup-body,
    .setup-footer { padding-left: 22px; padding-right: 22px; }
    .setup-footer { gap: 12px; flex-wrap: wrap; }
    .setup-footer > * { flex: 1 1 auto; }
    .setup-step-rail { grid-template-columns: 1fr; }
    .setup-field-row { flex-direction: column; gap: 0; }
    .setup-summary-row { flex-direction: column; gap: 6px; }
}

/* ═══════ END SETUP WIZARD ═══════ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    background-attachment: scroll;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Emoji & Icon normalization */
.emoji, img.emoji, svg.emoji {
    width: 1em !important;
    height: 1em !important;
    vertical-align: -0.125em;
    display: inline-block;
}

.ui-icon {
    width: 1em; height: 1em;
    vertical-align: -0.125em;
    display: inline-block;
    fill: currentColor;
}
.ui-icon--lg { width: 1.25em; height: 1.25em; }
.ui-icon--sm { width: 0.85em; height: 0.85em; vertical-align: -0.18em; }

.btn svg, .btn img, .nav-item svg, .icon {
    width: 1em; height: 1em; vertical-align: middle;
}
.btn svg { margin-right: 6px; }

/* ====== Layout ====== */
.admin-layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: none;
    padding: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08), inset -2px 0 4px rgba(0, 0, 0, 0.03), inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-sidebar);
}

.sidebar-logo { width: 36px; height: 36px; border-radius: 10px; }

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--sidebar-header-text);
}

.sidebar-nav { padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }

/* Nav Groups (collapsible sections) */
.nav-group { margin-bottom: 4px; }
.nav-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-group-label);
    font-weight: 600;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: color var(--transition-fast);
}
.nav-group-label:hover { color: var(--sidebar-text-hover); }
.nav-chevron {
    transition: transform 0.2s;
    opacity: 0.5;
}
.nav-group-items.open + .nav-group-label .nav-chevron,
.nav-group-label.collapsed .nav-chevron { transform: rotate(0deg); }
.nav-group-items.open ~ .nav-chevron { transform: rotate(90deg); }
.nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.nav-group-items.open {
    max-height: 600px;
}

#version-badge {
    font-size: 10px;
    color: var(--sidebar-text);
    margin-left: auto;
    padding: 2px 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    cursor: pointer;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--sidebar-item-hover); color: var(--sidebar-text-hover); }
.nav-item.active { border-left-color: var(--brand-primary); background: var(--sidebar-item-active); color: var(--sidebar-text-active); }

.nav-item svg { flex-shrink: 0; }

/* ====== Main Content ====== */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px 32px 60px 32px;
    min-height: 100vh;
    overflow-y: auto;
    height: 100vh;
    background: var(--bg-body);
    box-shadow: inset 3px 0 8px rgba(0, 0, 0, 0.04);
}

.page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ====== Tab Content ====== */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ====== Cards ====== */
.card {
    background: var(--bg-card);
    border: var(--pillow-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--pillow-shadow), var(--pillow-inset);
}

.card h2, .card h3 { color: var(--text-primary); margin-bottom: 16px; }

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

.card-header h2 { margin-bottom: 0; }

.card--flush { margin-bottom: 0; }

/* ====== Stats ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: var(--pillow-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-smooth);
    box-shadow: var(--pillow-shadow), var(--pillow-inset);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--pillow-hover), var(--pillow-inset);
}
.stat-card:active {
    transform: scale(0.98);
    box-shadow: var(--pillow-pressed);
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #7C3AED, #A78BFA); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #059669, #34D399); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #4F46E5, #818CF8); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #DB2777, #F472B6); }
.stat-card:nth-child(5)::before { background: linear-gradient(90deg, #D97706, #FBBF24); }
.stat-card:nth-child(6)::before { background: linear-gradient(90deg, #0891B2, #22D3EE); }

.stat-card:nth-child(1) .stat-value { color: #7C3AED; }
.stat-card:nth-child(2) .stat-value { color: #059669; }
.stat-card:nth-child(3) .stat-value { color: #4F46E5; }
.stat-card:nth-child(4) .stat-value { color: #DB2777; }
.stat-card:nth-child(5) .stat-value { color: #D97706; }
.stat-card:nth-child(6) .stat-value { color: #0891B2; }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #4F46E5;
    line-height: 1;
}

.stat-label { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; font-weight: 500; }
.stat-label--spaced { display: block; margin-bottom: 8px; }

.stat-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
}

.stats-grid--dashboard { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stats-grid--2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid--4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid--mt12 { margin-top: 12px; }

.stat-icon--purple { background: rgba(124,58,237,0.1); }
.stat-icon--green { background: rgba(5,150,105,0.1); }
.stat-icon--indigo { background: rgba(79,70,229,0.1); }
.stat-icon--pink { background: rgba(219,39,119,0.1); }
.stat-icon--amber { background: rgba(217,119,6,0.1); }
.stat-icon--cyan { background: rgba(8,145,178,0.1); }

.stat-value--danger { color: #EF4444; }
.stat-value--critical { color: #DC2626; }
.stat-value--warning { color: #F59E0B; }
.stat-value--sm { font-size: 14px; }

.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.section-heading-sm { margin-bottom: 12px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: var(--text-tertiary); }
.no-data--compact { text-align: center; padding: 20px; color: var(--text-muted); }

#recent-activity { max-height: 340px; overflow-y: auto; }
#audit-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
#warehouse-map-container { display: grid; gap: 16px; }
#adv-search-stats { font-size: 13px; color: var(--text-tertiary); margin-bottom: 12px; }
#backup-last { font-size: 14px; }
#sap-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.table-col-actions { width: 60px; }

/* ====== Animations ====== */
@keyframes adminCardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.anim-card {
    opacity: 0;
    animation: adminCardIn 0.4s ease-out forwards;
}
.anim-card:nth-child(1) { animation-delay: 0.03s; }
.anim-card:nth-child(2) { animation-delay: 0.08s; }
.anim-card:nth-child(3) { animation-delay: 0.13s; }
.anim-card:nth-child(4) { animation-delay: 0.18s; }
.anim-card:nth-child(5) { animation-delay: 0.23s; }
.anim-card:nth-child(6) { animation-delay: 0.28s; }

/* ====== Progress bar ====== */
.progress-bar-container {
    background: #E5E7EB;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    transition: width 0.8s ease;
    border-radius: 14px;
    position: relative;
    background: #059669;
}
.progress-bar-fill::after {
    content: attr(data-percent);
    position: absolute;
    right: 10px;
    top: 50%; transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.progress-bar-fill.bar-red { background: #EF4444; }
.progress-bar-fill.bar-yellow { background: #F59E0B; }
.progress-bar-fill.bar-green { background: #059669; }

/* ====== Today Banner ====== */
.today-banner {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: 8px 8px 18px rgba(0,0,0,0.18), -5px -5px 14px rgba(255,255,255,0.06), inset 0 1px 0 rgba(255,255,255,0.08), inset 0 -1px 0 rgba(0,0,0,0.2);
}
.today-banner::after {
    content: '';
    position: absolute;
    top: -40%; right: -10%;
    width: 200px; height: 200px;
    background: rgba(124,58,237,0.12);
    border-radius: 50%;
    filter: blur(40px);
}
.today-stat { text-align: center; z-index: 1; flex: 1; }
.today-stat-value { font-size: 28px; font-weight: 800; }
.today-stat-label { font-size: 11px; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.today-divider { width: 1px; height: 44px; background: rgba(255,255,255,0.12); z-index: 1; }

/* ====== Leaderboard ====== */
.leaderboard-list { list-style: none; padding: 0; }
.leaderboard-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 4px;
    transition: background 0.2s;
}
.leaderboard-item:hover { background: #F3F4F6; }
.leaderboard-rank {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.leaderboard-rank.rank-1 { background: #FEF3C7; color: #D97706; }
.leaderboard-rank.rank-2 { background: #E5E7EB; color: #6B7280; }
.leaderboard-rank.rank-3 { background: #FDE68A; color: #92400E; }
.leaderboard-rank.rank-other { background: #F3F4F6; color: #9CA3AF; }
.leaderboard-name { flex: 1; font-weight: 600; font-size: 14px; color: var(--text-primary); }
.leaderboard-count { font-weight: 700; font-size: 16px; color: var(--brand-accent-text); }
.leaderboard-units { font-size: 11px; color: var(--text-tertiary); margin-left: 4px; }

/* ====== Quick Actions ====== */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.quick-action-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-md);
    border: var(--pillow-border); background: var(--bg-card);
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all var(--transition-normal); text-decoration: none;
    box-shadow: var(--pillow-shadow-sm), var(--pillow-inset);
}
.quick-action-btn:hover { border-color: var(--brand-primary); color: var(--brand-accent-text); background: var(--brand-primary-light); box-shadow: var(--pillow-hover), var(--pillow-inset); transform: translateY(-2px); }
.quick-action-btn:active { transform: scale(0.97); box-shadow: var(--pillow-pressed); }
.quick-action-btn svg { flex-shrink: 0; }

.dash-toolbar-tag {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn--tight-gap { gap: 5px; }

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

.inline-actions--wrap { flex-wrap: wrap; }
.inline-actions--mb16 { margin-bottom: 16px; }
.inline-actions--mb20 { margin-bottom: 20px; }
.inline-actions--mt16 { margin-top: 16px; }

.import-copy {
    margin-bottom: 16px;
    color: var(--text-tertiary);
}

.import-copy__accent { color: #059669; }

.alerts-toolbar {
    margin: 16px 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.alerts-toolbar__label {
    font-weight: 600;
    font-size: 13px;
}

.grid-stack-8 {
    display: grid;
    gap: 8px;
}

.advanced-search-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.table-container--max-400 {
    max-height: 400px;
    overflow-y: auto;
}

.select--compact {
    padding: 6px 10px;
    border-radius: 6px;
}

.select--full { width: 100%; }

.input-number-compact {
    width: 80px;
    padding: 6px 10px;
    border-radius: 6px;
}

.report-card {
    cursor: pointer;
    text-align: center;
    padding: 24px;
}

.report-card svg { margin-bottom: 8px; }
.report-card h3 { margin-bottom: 4px; }
.report-card p { font-size: 12px; color: var(--text-tertiary); }

/* ====== Activity ====== */
.activity-badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 6px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.activity-badge.badge-scan { background: rgba(124,58,237,0.1); color: #7C3AED; }
.activity-badge.badge-transfer { background: rgba(219,39,119,0.1); color: #DB2777; }
.activity-badge.badge-batch { background: rgba(217,119,6,0.1); color: #D97706; }

.activity-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #F3F4F6;
    transition: background 0.15s;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: #FAFAFA; margin: 0 -12px; padding: 12px; border-radius: 8px; }

.dash-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: #9CA3AF; margin-bottom: 16px;
}

/* ====== Buttons — Win11 pillow, raised 3D edges ====== */
.btn {
    padding: 9px 18px;
    border: var(--pillow-border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', sans-serif;
    min-height: 36px;
    box-shadow: var(--pillow-shadow-sm), var(--pillow-inset);
}

.btn-primary { background: var(--brand-primary); color: white; box-shadow: 3px 3px 8px rgba(79,70,229,0.25), -2px -2px 5px rgba(0,0,0,0.03), inset 0 2px 1px rgba(255,255,255,0.12), inset 0 -2px 1px rgba(0,0,0,0.15); }
.btn-primary:hover:not(:disabled) { background: var(--brand-primary-hover); box-shadow: 4px 4px 12px rgba(79,70,229,0.3), -3px -3px 7px rgba(0,0,0,0.04), inset 0 2px 1px rgba(255,255,255,0.15); transform: translateY(-2px); }
.btn-secondary { background: var(--bg-card-nested); color: var(--text-secondary); border: var(--pillow-border); box-shadow: var(--pillow-shadow-sm), var(--pillow-inset); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); transform: translateY(-2px); box-shadow: var(--pillow-hover), var(--pillow-inset); }
.btn-danger { background: var(--status-danger-bg); color: var(--status-danger); border: 1px solid rgba(220, 38, 38, 0.15); box-shadow: 3px 3px 8px rgba(220,38,38,0.15), -2px -2px 5px rgba(0,0,0,0.03), inset 0 2px 1px rgba(255,255,255,0.12), inset 0 -2px 1px rgba(0,0,0,0.08); }
.btn-danger:hover:not(:disabled) { background: rgba(220, 38, 38, 0.15); transform: translateY(-2px); box-shadow: 4px 4px 12px rgba(220,38,38,0.2), -3px -3px 7px rgba(0,0,0,0.04), inset 0 2px 1px rgba(255,255,255,0.12); }

.btn:active { transform: scale(0.97); box-shadow: var(--pillow-pressed); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.log-controls { display: flex; gap: 8px; flex-wrap: wrap; }

/* ====== Search & Filter ====== */
.search-filter {
    margin-bottom: 16px;
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}

.search-filter input[type="text"],
input[type="text"], input[type="date"], input[type="number"], select {
    background: var(--bg-input);
    border: var(--pillow-border);
    border-radius: 10px;
    padding: 9px 14px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-smooth);
    box-shadow: var(--pillow-shadow-sm), var(--pillow-inset);
}

.search-filter input[type="text"] {
    flex: 1; min-width: 250px;
}

.search-filter input[type="text"]:focus,
input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-ring), var(--pillow-shadow-sm), var(--pillow-inset);
}

input[type="text"]::placeholder { color: var(--text-placeholder); }
select option { background: var(--bg-card); color: var(--text-primary); }

.search-filter label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: #374151; cursor: pointer;
}

input[type="checkbox"] { accent-color: var(--brand-primary); width: 16px; height: 16px; cursor: pointer; }

/* ====== Date Filter ====== */
.date-filter {
    display: flex; gap: 12px; margin-bottom: 16px;
    flex-wrap: wrap; align-items: center;
    padding: 12px 16px; background: var(--bg-card-nested);
    border-radius: var(--radius-md); border: var(--pillow-border);
    box-shadow: var(--pillow-shadow-sm), var(--pillow-inset);
}

.date-presets { display: flex; gap: 6px; }

.btn-preset {
    padding: 5px 12px;
    border: var(--pillow-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-family: inherit;
    box-shadow: var(--pillow-shadow-sm), var(--pillow-inset);
}

.btn-preset:hover, .btn-preset.active { background: var(--brand-primary-light); color: var(--brand-accent-text); border-color: var(--brand-primary); box-shadow: var(--pillow-hover), var(--pillow-inset); }

.date-inputs { display: flex; gap: 8px; align-items: center; }
.date-inputs label { color: #6B7280; font-size: 13px; display: flex; align-items: center; gap: 6px; }

/* ====== Tables ====== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: var(--pillow-border);
    background: var(--bg-card);
    box-shadow: var(--pillow-shadow), var(--pillow-inset);
}

table { width: 100%; border-collapse: collapse; }

thead th {
    background: var(--bg-table-header);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-primary);
}

tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

.no-data { text-align: center; padding: 32px !important; color: var(--text-muted); font-size: 14px; }

/* ====== Charts ====== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* ====== Status & Badges ====== */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-warning { background: rgba(251, 191, 36, 0.1); color: #D97706; }
.badge-error, .badge-danger { background: rgba(239, 68, 68, 0.1); color: #DC2626; }
.badge-info { background: rgba(99, 102, 241, 0.1); color: #4F46E5; }

.status-message {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}
.status-message.success { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-message.error { background: rgba(239, 68, 68, 0.1); color: #DC2626; border: 1px solid rgba(239, 68, 68, 0.2); }

/* ====== Notifications ====== */
.notification-host {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 13000;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 32px));
}

.notification {
    position: relative;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    width: min(360px, calc(100vw - 32px));
    font-size: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    opacity: 0;
    transform: translateX(120%);
    pointer-events: auto;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}
.notification-success, .notification.success { border-left: 4px solid #059669; }
.notification-error, .notification.error { border-left: 4px solid #EF4444; }
.notification-warning, .notification.warning { border-left: 4px solid #F59E0B; }
.notification-info, .notification.info { border-left: 4px solid #4F46E5; }

/* ====== Server Addresses / Mobile Tab ====== */
.hint { color: var(--text-muted); font-size: 13px; }
.success { color: var(--status-success); font-weight: 500; }
.error { color: var(--status-danger); font-weight: 500; }

.server-addresses { margin-top: 16px; }
.server-addresses ul { list-style: none; margin-top: 12px; }

.server-addresses li {
    background: #F3F4F6;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 13px;
    color: #4F46E5;
    border: 1px solid #E2E8F0;
}

.btn-copy {
    background: #059669;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(5,150,105,0.12);
}
.btn-copy:hover { background: #047857; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,0.15); }
.btn-copy:active { transform: scale(0.97); }

/* Product images */
.product-image { max-width: 60px; max-height: 60px; border-radius: 10px; }

/* ====== Details toggle (batch-bin) ====== */
.details-row { display: none; }
.details-row.expanded { display: table-row; }
.details-content { padding: 16px; background: #F3F4F6; }

/* ====== Settings Cards Grid ====== */
.settings-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.settings-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card-nested);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.settings-card:hover {
    background: var(--bg-hover);
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79,70,229,0.08), 0 8px 24px rgba(0,0,0,0.04);
}
.settings-card:active { transform: scale(0.98); }
.settings-card-icon {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.settings-card-icon--appearance { background: #EEF2FF; color: #4F46E5; }
.settings-card-icon--users { background: #DBEAFE; color: #1D4ED8; }
.settings-card-icon--sap { background: #FEF3C7; color: #D97706; }
.settings-card-icon--shortcuts { background: #E0E7FF; color: #4338CA; }
.settings-card-icon--data { background: #FEE2E2; color: #DC2626; }
.settings-card-icon--about { background: #D1FAE5; color: #065F46; }
.settings-card-info { flex: 1; min-width: 0; }
.settings-card-info h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.settings-card-info p { margin: 0; font-size: 12px; color: var(--text-tertiary); }
.settings-card-arrow { color: var(--text-muted); flex-shrink: 0; }

/* ====== Settings Modal ====== */
.settings-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.15s ease;
}
.settings-modal {
    background: var(--bg-card);
    border-radius: 22px;
    width: 90%; max-width: 640px;
    max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 24px 72px rgba(0,0,0,0.1);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.settings-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}
.settings-modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.settings-modal-close {
    width: 34px; height: 34px;
    border: none; background: transparent;
    font-size: 22px; color: var(--text-muted);
    cursor: pointer; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.settings-modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.settings-modal-body .sm-group { margin-bottom: 20px; }
.settings-modal-body .sm-group:last-child { margin-bottom: 0; }
.settings-modal-body .sm-label {
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    display: block; margin-bottom: 6px;
}
.settings-modal-body .sm-row {
    display: flex; gap: 12px; align-items: center; margin-bottom: 12px;
}
.settings-modal-body .sm-divider {
    height: 1px; background: var(--border-primary); margin: 20px 0;
}
.settings-modal-body .sm-section-title {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    margin: 0 0 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}
.settings-modal-body .sm-danger-zone {
    padding: 18px;
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: 14px;
}
.settings-modal-body .sm-danger-zone h4 {
    margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #DC2626;
}
.settings-modal-body .sm-danger-zone p {
    margin: 0 0 10px; font-size: 12px; color: var(--text-tertiary);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ====== Modal ====== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    margin: 5% auto;
    padding: 30px;
    border-radius: 22px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 24px 72px rgba(0,0,0,0.1);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover { color: var(--brand-accent-text); }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-input);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-smooth);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-placeholder); }
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-ring), 0 2px 8px rgba(79,70,229,0.06);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ====== Import Tab ====== */
.import-section { margin-bottom: 24px; }
.import-section h3 { color: #1F2937; margin-bottom: 8px; }

.import-preview-table {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 12px;
}

/* ====== QR Code display ====== */
.qr-container {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

.qr-item {
    text-align: center;
    background: #F3F4F6;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
}

.qr-item h4 { margin-top: 12px; color: #1F2937; }
.qr-item p { color: #6B7280; font-size: 12px; margin-top: 4px; }

/* ====== Row warning ====== */
.row-warning { background-color: rgba(251, 191, 36, 0.08) !important; }
.row-warning:hover { background-color: rgba(251, 191, 36, 0.15) !important; }

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ====== Version ====== */
.sidebar-version {
    padding: 12px 16px;
    font-size: 11px;
    color: var(--sidebar-group-label);
    border-top: 1px solid var(--border-sidebar);
    text-align: center;
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header h2, .nav-item span, .nav-group-label span, .nav-chevron { display: none; }
    .nav-group-label { padding: 4px 0; }
    .nav-group-items { max-height: 600px !important; }
    .main-content { margin-left: 60px; padding: 16px 16px 60px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .log-controls { flex-direction: column; }
    .search-filter { flex-direction: column; }
    .search-filter input[type="text"] { min-width: auto; width: 100%; }
    .today-banner { flex-direction: column; gap: 12px; }
    .today-divider { width: 60%; height: 1px; }
}

/* ====== What's New Modal ====== */
.wn-overlay {
    position: fixed; z-index: 9999;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: wnFadeIn 0.25s ease;
}
@keyframes wnFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wn-modal {
    background: #fff; border-radius: 16px;
    width: min(100%, 540px); max-height: min(calc(100dvh - 32px), 85vh);
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    display: flex; flex-direction: column;
    animation: wnSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
@keyframes wnSlideUp {
    from { transform: translateY(40px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.wn-close {
    position: absolute; top: 14px; right: 18px;
    background: none; border: none; font-size: 26px;
    color: #9CA3AF; cursor: pointer; line-height: 1;
    z-index: 1; padding: 0 4px; border-radius: 6px;
    transition: all 0.15s;
}
.wn-close:hover { color: #1F2937; background: rgba(0,0,0,0.06); }

.wn-header {
    text-align: center; padding: 28px 24px 16px;
    background: var(--theme-release-header-bg, var(--brand-gradient, linear-gradient(135deg, #112233, #38BDF8)));
    color: var(--theme-release-header-text, #fff); position: relative;
}
.wn-icon { font-size: 40px; margin-bottom: 8px; }
.wn-header h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.wn-subtitle { margin: 0; font-size: 13px; opacity: 0.85; }

.wn-body {
    padding: 20px 24px; overflow-y: auto; flex: 1;
}
.wn-section {
    margin-bottom: 18px; padding-bottom: 16px;
    border-bottom: 1px solid #F3F4F6;
}
.wn-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wn-section h3 { margin: 6px 0 8px; font-size: 15px; color: #1F2937; font-weight: 600; }
.wn-section ul { margin: 0; padding-left: 20px; }
.wn-section li { font-size: 13px; color: #4B5563; line-height: 1.6; }

.wn-badge {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.wn-badge-sap { background: #DBEAFE; color: #1D4ED8; }
.wn-badge-db  { background: #D1FAE5; color: #065F46; }
.wn-badge-sec { background: #FEE2E2; color: #991B1B; }
.wn-badge-rpt { background: #FEF3C7; color: #92400E; }

.wn-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; border-top: 1px solid #E5E7EB; background: #F9FAFB;
}
.wn-dismiss-label {
    font-size: 12px; color: #6B7280; display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.wn-dismiss-label input { cursor: pointer; accent-color: var(--theme-release-accent, var(--brand-primary, #112233)); }
.wn-btn {
    background: var(--theme-release-action-bg, var(--brand-gradient, linear-gradient(135deg, #112233, #38BDF8))); color: var(--theme-release-action-text, #fff);
    border: none; padding: 10px 28px; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.wn-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(var(--brand-primary-rgb, 17, 34, 51), 0.35); }

@media (max-width: 640px), (max-height: 760px) {
    .wn-overlay {
        padding: 14px;
    }

    .wn-modal {
        width: min(100%, 520px);
        max-height: calc(100dvh - 28px);
        border-radius: 14px;
    }

    .wn-header {
        padding: 24px 18px 14px;
    }

    .wn-icon {
        font-size: 34px;
        margin-bottom: 6px;
    }

    .wn-header h2 {
        font-size: 19px;
    }

    .wn-subtitle {
        font-size: 12px;
    }

    .wn-body {
        padding: 16px 18px;
    }

    .wn-section {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .wn-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 18px;
    }

    .wn-dismiss-label {
        font-size: 11px;
    }

    .wn-btn {
        width: 100%;
    }
}

@media (max-width: 420px), (max-height: 680px) {
    .wn-overlay {
        padding: 12px;
    }

    .wn-modal {
        width: 100%;
        max-height: calc(100dvh - 24px);
        border-radius: 12px;
    }

    .wn-close {
        top: 10px;
        right: 12px;
        font-size: 22px;
    }

    .wn-header {
        padding: 20px 16px 12px;
    }

    .wn-icon {
        font-size: 30px;
    }

    .wn-header h2 {
        font-size: 17px;
        line-height: 1.2;
        padding-right: 24px;
    }

    .wn-subtitle {
        font-size: 11px;
    }

    .wn-body {
        padding: 14px 16px;
    }

    .wn-section h3 {
        font-size: 14px;
    }

    .wn-section li {
        font-size: 12px;
        line-height: 1.5;
    }

    .wn-footer {
        padding: 10px 16px 14px;
    }
}

/* ═══════════════════════════════════════
   CONFIRM ACTION MODAL
   ═══════════════════════════════════════ */
.confirm-overlay {
    position: fixed; z-index: 10000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    animation: wnFadeIn 0.25s ease;
}
.confirm-dialog {
    background: #fff; border-radius: 16px;
    width: 90%; max-width: 420px;
    padding: 32px 28px 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    text-align: center;
    animation: wnSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-icon {
    font-size: 48px; margin-bottom: 12px; line-height: 1;
}
.confirm-title {
    margin: 0 0 8px; font-size: 20px; font-weight: 700; color: #1F2937;
}
.confirm-message {
    margin: 0 0 24px; font-size: 14px; color: #6B7280; line-height: 1.5;
}
.confirm-actions {
    display: flex; gap: 12px; justify-content: center;
}
.confirm-btn {
    padding: 10px 28px; border-radius: 10px; font-size: 14px;
    font-weight: 600; cursor: pointer; border: none;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.confirm-btn:hover { transform: translateY(-1px); }
.confirm-btn-cancel {
    background: #F3F4F6; color: #374151;
}
.confirm-btn-cancel:hover { background: #E5E7EB; }
.confirm-btn-danger {
    background: linear-gradient(135deg, #DC2626, #B91C1C); color: #fff;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}
.confirm-btn-danger:hover { box-shadow: 0 4px 16px rgba(220,38,38,0.4); }

/* ═══════════════════════════════════════
   ULTIMATE FEATURES STYLES
   ═══════════════════════════════════════ */

/* --- Nav badges --- */
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: #EF4444; color: #fff; border-radius: 9px;
    font-size: 10px; font-weight: 700; margin-left: auto;
}

/* --- Enterprise section header in sidebar --- */
.nav-section-header {
    padding: 18px 16px 6px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px; color: #9CA3AF;
}

/* --- Alert cards --- */
.alerts-list { display: flex; flex-direction: column; gap: 8px; max-height: 500px; overflow-y: auto; }
.alert-card.critical { border-left-color: #EF4444 !important; }
.alert-card.warning { border-left-color: #F59E0B !important; }
.alert-card.info { border-left-color: #3B82F6 !important; }

/* --- Warehouse map --- */
.wh-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 4px; }
.wh-bin { padding: 6px; text-align: center; border-radius: 6px; font-size: 10px;
    border: 1px solid #E5E7EB; cursor: pointer; transition: all 0.15s; -webkit-user-select: none; user-select: none; }
.wh-bin:hover { transform: scale(1.08); z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.wh-bin.occupied { background: #DCFCE7; border-color: #86EFAC; }
.wh-bin.empty { background: #F9FAFB; border-color: #E5E7EB; }
.wh-bin.critical { background: #FEE2E2; border-color: #FCA5A5; }

/* --- Settings groups --- */
.settings-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.settings-group { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: 12px; padding: 20px; }
.settings-group h4 { margin: 0 0 14px; font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.settings-group h4::before { content: ''; width: 3px; height: 18px; background: var(--brand-primary); border-radius: 2px; }

/* --- Toggle switch --- */
.toggle-switch { position: relative; width: 44px; height: 24px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border-secondary); border-radius: 24px; transition: 0.25s; }
.toggle-slider:before { position: absolute; content: ''; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--brand-primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* --- Report cards --- */
.reports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.report-card { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: 12px; padding: 20px; text-align: center;
    cursor: pointer; transition: all var(--transition-normal); }
.report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-primary); }
.report-card .report-icon { font-size: 28px; margin-bottom: 8px; }
.report-card h4 { margin: 0 0 4px; font-size: 14px; color: var(--text-primary); }
.report-card p { margin: 0; font-size: 12px; color: var(--text-tertiary); }

/* --- Advanced search --- */
.search-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.search-form-grid label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 4px; }

/* --- Keyboard shortcut list --- */
.shortcuts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.shortcut-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #4B5563; }
.shortcut-key { display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 8px; background: #F3F4F6; border: 1px solid #D1D5DB; border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', monospace; font-size: 11px; color: #1F2937; min-width: 24px; }

/* --- Notification toast --- */
.notification-toast {
    position: fixed; top: 20px; right: 20px; z-index: 10000;
    padding: 12px 20px; border-radius: 10px; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); min-width: 240px;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Cycle count progress --- */
.cycle-count-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.cc-stat-card { background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 10px; padding: 14px; text-align: center; }
.cc-stat-card .cc-value { font-size: 24px; font-weight: 700; color: #1F2937; }
.cc-stat-card .cc-label { font-size: 11px; color: #6B7280; margin-top: 2px; }

/* --- Backup list --- */
.backup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.backup-stat { background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 10px; padding: 14px; text-align: center; }

/* --- Filter tags --- */
.filter-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    background: #EEF2FF; color: #4338CA; border-radius: 6px; font-size: 11px; font-weight: 600; }
.filter-tag .remove-tag { cursor: pointer; color: #6366F1; font-weight: 400; }

/* ═══════ DASHBOARD WIDGET GRID (Android Homescreen) ═══════ */
.dash-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dash-toolbar-right { display: flex; gap: 8px; align-items: center; }
.btn-sm { font-size: 12px !important; padding: 6px 14px !important; }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 200px;
}
.dash-widget {
    position: relative;
    border-radius: var(--radius-lg, 12px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
    min-width: 0;
}
.dash-widget[data-col-span="1"] { grid-column: span 1; }
.dash-widget[data-col-span="2"] { grid-column: span 2; }
.dash-widget[data-col-span="3"] { grid-column: span 3; }
.dash-widget[data-col-span="4"] { grid-column: span 4; }

/* Widget edit-mode chrome */
.dash-widget-chrome {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--brand-primary-light, rgba(79,70,229,0.08));
    border: 2px solid var(--brand-primary, #4F46E5);
    border-bottom: 1px dashed var(--brand-primary, #4F46E5);
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
    font-size: 12px; font-weight: 600;
    color: var(--brand-accent-text, #4F46E5);
    cursor: grab; -webkit-user-select: none; user-select: none;
}
.dash-widget-drag-handle { display: flex; align-items: center; opacity: 0.5; cursor: grab; }
.dash-widget-drag-handle:hover { opacity: 1; }
.dash-widget-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-widget-actions { display: flex; gap: 2px; }
.dash-widget-actions button {
    width: 26px; height: 26px; border: none; background: transparent;
    color: var(--brand-accent-text, #4F46E5); cursor: pointer; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.6; transition: all 0.15s; font-size: 16px;
}
.dash-widget-actions button:hover { opacity: 1; background: rgba(255,255,255,0.5); }
.dash-widget-actions .dash-widget-remove:hover { color: #EF4444; background: #FEE2E2; }

/* Edit Mode */
.dash-grid.edit-mode { padding: 8px; background: var(--bg-body); border: 2px dashed var(--border-primary, #E5E7EB); border-radius: 16px; }
.dash-grid.edit-mode .dash-widget {
    border: 2px dashed var(--border-primary, #E5E7EB);
    border-radius: var(--radius-lg, 12px);
}
.dash-grid.edit-mode .dash-widget-chrome {
    display: flex;
    border-radius: calc(var(--radius-lg, 12px) - 2px) calc(var(--radius-lg, 12px) - 2px) 0 0;
}

/* Drag States */
.dash-widget.dragging { opacity: 0.3; transform: scale(0.96); z-index: 100; }
.dash-widget.drag-over {
    border-color: var(--brand-primary, #4F46E5) !important;
    border-style: solid !important;
    box-shadow: 0 0 0 4px var(--brand-primary-ring, rgba(79,70,229,0.15));
}

/* Dynamic widget card (for new JS-rendered widgets) */
.dash-wcard {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-primary, #E5E7EB);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
    height: 100%; overflow: hidden;
}
.dash-wcard h4 {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted, #9CA3AF); margin: 0 0 12px 0;
}
.dash-wcard-value { font-size: 32px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.dash-wcard-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.dash-wcard-list { list-style: none; padding: 0; margin: 0; }
.dash-wcard-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border-primary, #F3F4F6);
    font-size: 13px; color: var(--text-secondary);
}
.dash-wcard-list li:last-child { border-bottom: none; }
.dash-wcard-row { display: flex; align-items: center; gap: 10px; }

/* Responsive grid */
@media (max-width: 1200px) {
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-widget[data-col-span="3"],
    .dash-widget[data-col-span="4"] { grid-column: span 2; }
}
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-widget[data-col-span="1"],
    .dash-widget[data-col-span="2"],
    .dash-widget[data-col-span="3"],
    .dash-widget[data-col-span="4"] { grid-column: span 1; }
    .dash-toolbar { flex-direction: column; gap: 8px; }
}
