/* ═══════════════════════════════════════════════════════════════════
   WhatsMsg Console — premium command-center skin (.wm-console scope).
   Mirrors the reference ERP console language: slate canvas, gradient icon
   tiles, KPI sparklines, hub search + tabs, live activity feed.
   All colour resolves to tokens below — blades must never inline hex.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --wm-accent: #00a884;
    --wm-accent-deep: #008069;
    --wm-accent-ink: #075e54;
    --wm-accent-bg: rgba(0, 168, 132, 0.09);
    --wm-accent-soft: rgba(0, 168, 132, 0.05);
    --wm-accent-glow: rgba(0, 168, 132, 0.16);
    --wm-bg: #f8fafc;
    --wm-card: #ffffff;
    --wm-border: #e2e8f0;
    --wm-border-soft: #eef2f7;
    --wm-text: #0f172a;
    --wm-text-2: #475569;
    --wm-text-3: #94a3b8;
    --wm-muted: #cbd5e1;
    --wm-success: #16a34a;
    --wm-success-bg: rgba(22, 163, 74, 0.08);
    --wm-warning: #d97706;
    --wm-warning-bg: rgba(217, 119, 6, 0.09);
    --wm-danger: #dc2626;
    --wm-danger-bg: rgba(220, 38, 38, 0.07);
    --wm-info: #0284c7;
    --wm-info-bg: rgba(2, 132, 199, 0.08);
    --wm-grad-sky: linear-gradient(135deg, #0284c7, #38bdf8);
    --wm-grad-emerald: linear-gradient(135deg, #00a884, #34d399);
    --wm-grad-teal: linear-gradient(135deg, #0d9488, #2dd4bf);
    --wm-grad-violet: linear-gradient(135deg, #7c3aed, #a78bfa);
    --wm-grad-rose: linear-gradient(135deg, #e11d48, #fb7185);
    --wm-grad-amber: linear-gradient(135deg, #d97706, #f59e0b);
    --wm-grad-slate: linear-gradient(135deg, #475569, #94a3b8);
    --wm-radius-sm: 8px;
    --wm-radius-md: 12px;
    --wm-radius-lg: 16px;
    --wm-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --wm-shadow-hover: 0 10px 30px -8px rgba(15, 23, 42, 0.12), 0 4px 10px -3px rgba(15, 23, 42, 0.06);
    --wm-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --wm-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Semantic Bright Tokens for Badges and Statuses */
    --accent-bright: #047857;
    --danger-bright: #b91c1c;
    --warning-bright: #b45309;
    --info-bright: #0369a1;
    --purple-bright: #6d28d9;
    --neutral-bright: #334155;
}

/* Global Icon Spacing Fixes (Prevents icon-text jamming) */
.content-header h1 i,
.content_header h1 i,
h1 > i,
h2 > i,
h3 > i,
h4 > i,
h5 > i,
h6 > i {
    margin-right: 10px !important;
    display: inline-block;
    vertical-align: middle;
}
.badge i,
.btn i,
.tpl-btn-primary i,
.tpl-card-title i,
.card-title i {
    margin-right: 6px !important;
    display: inline-block;
    vertical-align: middle;
}
.mr-1 { margin-right: 0.35rem !important; }
.mr-2 { margin-right: 0.6rem !important; }
.mr-3 { margin-right: 1rem !important; }
.ml-1 { margin-left: 0.35rem !important; }
.ml-2 { margin-left: 0.6rem !important; }
.ml-3 { margin-left: 1rem !important; }

/* Accessible, High-Contrast Badge Styling */
.badge {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.02em !important;
    padding: 4px 10px !important;
    border-radius: 9999px !important;
    white-space: nowrap !important;
}
.badge-success,
.badge.badge-success {
    background-color: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
}
.badge-danger,
.badge.badge-danger {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}
.badge-warning,
.badge.badge-warning {
    background-color: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}
.badge-info,
.badge.badge-info {
    background-color: #f0f9ff !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
}
.badge-primary,
.badge.badge-primary {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}
.badge-light,
.badge.badge-light,
.badge-secondary,
.badge.badge-secondary,
.badge-standard,
.badge-neutral {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Polished Inline Code Styling */
code {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: var(--wm-mono, monospace) !important;
    font-size: 0.88em !important;
    border: 1px solid #e2e8f0 !important;
}

/* Page chrome: faint brand-tinted canvas for the console only. */
.content-wrapper {
    background: #f8fafc;
    background: color-mix(in srgb, var(--wm-accent) 4%, #f8fafc);
}
.content-wrapper > .content { padding: 0; }

/* ═══ Console sidebar (dark) — reference ERP-style grouped nav ═══ */
body .main-sidebar {
    --wm-ic-1: #60a5fa;  /* Sky Blue */
    --wm-ic-2: #34d399;  /* Emerald */
    --wm-ic-3: #fbbf24;  /* Amber */
    --wm-ic-4: #f87171;  /* Coral Red */
    --wm-ic-5: #a78bfa;  /* Purple */
    --wm-ic-6: #22d3ee;  /* Cyan */
    --wm-ic-7: #fb923c;  /* Orange */
    --wm-ic-8: #f472b6;  /* Pink */
    --wm-ic-9: #4ade80;  /* Light Green */
    --wm-ic-10: #c084fc; /* Violet */
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.main-sidebar .brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 1rem;
}
.main-sidebar .brand-link .brand-image { opacity: 1; }
.main-sidebar .brand-text {
    font-family: var(--wm-font, sans-serif);
    font-weight: 700;
    letter-spacing: -0.2px;
    font-size: 15px;
    color: #ffffff;
}

/* Live menu filter ("Search Menu…") */
.main-sidebar .sidebar-search {
    padding: 10px 12px 6px 12px;
}
.main-sidebar .sidebar-search .form-control,
.main-sidebar .sidebar-search .form-control-sidebar {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    color: #e2e8f0 !important;
    font-family: var(--wm-font, sans-serif) !important;
    font-size: 12.5px !important;
    height: 36px !important;
    box-shadow: none !important;
}
.main-sidebar .sidebar-search .form-control::placeholder,
.main-sidebar .sidebar-search .form-control-sidebar::placeholder {
    color: #94a3b8 !important;
}
.main-sidebar .sidebar-search .form-control:focus,
.main-sidebar .sidebar-search .form-control-sidebar:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #00bcd4 !important;
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.25) !important;
    color: #ffffff !important;
}
.main-sidebar .sidebar-search .btn-sidebar {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    color: #94a3b8 !important;
    height: 36px !important;
    padding: 0 10px !important;
}
.main-sidebar .sidebar-search .btn-sidebar:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

/* Section labels: small caps micro-headers like the reference */
.main-sidebar .nav-header {
    font-family: var(--wm-font, sans-serif);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8aa4af;
    padding: 16px 14px 6px 14px;
}
.main-sidebar .nav-header:first-child { padding-top: 8px; }

/* Top-Level Menu Links */
.nav-sidebar .nav-link {
    border-radius: 8px;
    margin-bottom: 3px;
    font-family: var(--wm-font, sans-serif);
    font-size: 13.5px;
    font-weight: 500;
    color: #cbd5e1;
    border-left: 3px solid transparent !important;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: center;
    padding: 8px 12px;
}

/* Fixed-width icon grid: guarantees text labels never drift or misalign */
.main-sidebar .nav-sidebar .nav-link .nav-icon {
    width: 1.6rem !important;
    min-width: 1.6rem !important;
    text-align: center !important;
    margin-right: 0.65rem !important;
    font-size: 14.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.nav-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}
.nav-sidebar .nav-link:focus-visible {
    outline: 2px solid #00bcd4;
    outline-offset: 1px;
}

/* Reference 10-Color Harmonic Icon Sequence for Top-Level Navigation */
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+1) > .nav-link > .nav-icon { color: var(--wm-ic-1) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+2) > .nav-link > .nav-icon { color: var(--wm-ic-2) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+3) > .nav-link > .nav-icon { color: var(--wm-ic-3) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+4) > .nav-link > .nav-icon { color: var(--wm-ic-4) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+5) > .nav-link > .nav-icon { color: var(--wm-ic-5) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+6) > .nav-link > .nav-icon { color: var(--wm-ic-6) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+7) > .nav-link > .nav-icon { color: var(--wm-ic-7) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+8) > .nav-link > .nav-icon { color: var(--wm-ic-8) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n+9) > .nav-link > .nav-icon { color: var(--wm-ic-9) !important; }
.main-sidebar .nav-sidebar > .nav-item:nth-child(10n)   > .nav-link > .nav-icon { color: var(--wm-ic-10) !important; }

/* Active & Open Parent: subtle background pill + brand cyan/blue left accent bar */
body .main-sidebar .nav-sidebar > .nav-item.menu-open > .nav-link,
body .main-sidebar .nav-sidebar > .nav-item > .nav-link.active {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-left: 3px solid #00bcd4 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 0 8px 8px 0 !important;
}
.nav-sidebar .nav-link.active .nav-arrow,
.nav-sidebar .nav-item.menu-open > .nav-link .nav-arrow {
    color: #ffffff !important;
}

/* Submenu Treeview: Hide default dots, inject custom "»" chevrons, strict indent */
.nav-sidebar .nav-treeview {
    padding-left: 0.5rem !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
}
.nav-sidebar .nav-treeview .nav-link {
    font-size: 13px !important;
    padding: 7px 12px 7px 22px !important;
    border-radius: 6px !important;
    color: #94a3b8 !important;
    border-left: none !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.15s ease-in-out !important;
}
.nav-sidebar .nav-treeview .nav-link .nav-icon {
    display: none !important;
}
.nav-sidebar .nav-treeview .nav-link::before {
    content: '\00bb' !important;
    margin-right: 0.75rem !important;
    color: #8aa4af !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}
.nav-sidebar .nav-treeview .nav-link:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}
.nav-sidebar .nav-treeview .nav-link.active {
    background: rgba(0, 188, 212, 0.12) !important;
    color: #22d3ee !important;
    font-weight: 700 !important;
}
.nav-sidebar .nav-treeview .nav-link.active::before {
    color: #22d3ee !important;
}

/* Specific Utility Classes */
.wm-sidebar-logout-btn .nav-icon {
    color: #ef4444 !important;
}
.text-cyan { color: #22d3ee !important; }

/* Sidebar scrollbar */
.main-sidebar .sidebar-wrapper::-webkit-scrollbar { width: 5px; }
.main-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }

/* ═══ Console topbar — clean blurred bar + initial avatar ═══ */
.app-header.navbar {
    font-family: var(--wm-font);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--wm-border);
    min-height: 57px;
}
.app-header .nav-link { color: var(--wm-text-2); border-radius: 8px; }
.app-header .nav-link:hover { color: var(--wm-text); background: rgba(15, 23, 42, 0.05); }
.wm-user-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.wm-user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #e11d48, #fb7185);
    color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.3px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px -2px rgba(225, 29, 72, 0.5);
    flex-shrink: 0;
}
.app-header .dropdown-menu {
    border: 1px solid var(--wm-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    font-family: var(--wm-font);
}
.app-header .user-header { border-radius: 0; }
.app-header .user-header p { font-weight: 700; }
.app-header .user-header small { opacity: 0.85; font-weight: 500; }

/* Legacy helpers still used by other console pages. */
.btn-console-primary {
    background: linear-gradient(135deg, var(--wm-accent) 0%, var(--wm-accent-deep) 100%);
    border: none;
    color: #ffffff;
    font-weight: 700;
}
.btn-console-primary:hover,
.btn-console-primary:focus { color: #ffffff; filter: brightness(0.95); }
.console-stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.console-empty { text-align: center; padding: 48px 16px; color: var(--wm-text-2); }
.console-empty .empty-icon { font-size: 30px; margin-bottom: 10px; opacity: 0.6; }
.console-code, .wm-code {
    font-family: var(--wm-mono);
    font-size: 12.5px;
    word-break: break-all;
}

/* ═══ Console root ═══ */
.wm-console {
    font-family: var(--wm-font);
    color: var(--wm-text);
    background: transparent;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    -webkit-font-smoothing: antialiased;
    min-height: calc(100vh - 57px);
}
.wm-console *, .wm-console *::before, .wm-console *::after { box-sizing: border-box; }
.wm-console a { text-decoration: none; color: inherit; }

/* ── Header ── */
.wm-page-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.wm-head-left h1 {
    font-size: 22px; font-weight: 800; letter-spacing: -0.5px;
    margin: 0; line-height: 1.2; color: var(--wm-text);
}
.wm-head-left p { font-size: 13px; color: var(--wm-text-2); margin: 3px 0 0; }
.wm-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--wm-accent-deep);
    background: var(--wm-accent-bg);
    border: 1px solid var(--wm-accent-glow);
    border-radius: 100px; padding: 3px 10px; margin-bottom: 7px;
}
.wm-ticker {
    display: flex; align-items: center; height: 40px;
    flex: 1; min-width: 260px; max-width: 640px;
    background: var(--wm-card); border: 1px solid var(--wm-border);
    border-radius: 100px; box-shadow: var(--wm-shadow); overflow: hidden;
}
.wm-ticker-label {
    display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 100%;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px;
    color: var(--wm-accent-deep); border-right: 1px solid var(--wm-border);
    white-space: nowrap;
}
.wm-ticker-track { flex: 1; min-width: 0; overflow: hidden; padding: 0 14px; font-size: 12px; font-weight: 600; }
.wm-ticker-track marquee { display: block; }
.wm-ticker-item { margin-right: 30px; white-space: nowrap; color: var(--wm-text-2); }
.wm-ticker-item .fa-circle { font-size: 7px; color: var(--wm-accent); margin-right: 6px; vertical-align: middle; }
.wm-ticker-time { color: var(--wm-text-3); font-weight: 500; }
.wm-online-pill {
    display: inline-flex; align-items: center; gap: 6px; margin-right: 6px;
    font-size: 11.5px; font-weight: 700; color: var(--wm-accent-deep);
    background: var(--wm-accent-bg); border-radius: 100px; padding: 6px 12px;
    white-space: nowrap;
}
.wm-live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--wm-success); animation: wmPulse 2s ease-in-out infinite;
}
@keyframes wmPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── KPI cards: single row that compresses, never ragged ── */
.wm-stats-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 0.8vw, 14px); }
.wm-stat-card {
    background: var(--wm-card); border: 1px solid var(--wm-border);
    border-radius: var(--wm-radius-md); padding: clamp(10px, 1vw, 16px) clamp(11px, 1vw, 18px);
    position: relative; overflow: hidden; transition: transform 0.25s, box-shadow 0.25s;
    display: flex; flex-direction: column; min-width: 0;
}
.wm-stat-card:hover { box-shadow: var(--wm-shadow-hover); transform: translateY(-2px); }
.wm-stat-card:focus-visible { outline: 2px solid var(--wm-accent); outline-offset: 2px; }
.wm-stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; position: relative; z-index: 1; }
.wm-stat-icon {
    width: clamp(28px, 2.3vw, 38px); height: clamp(28px, 2.3vw, 38px);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: clamp(12px, 1.05vw, 16px); color: #fff; position: relative; flex-shrink: 0;
}
.wm-stat-icon::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 50%);
}
.grad-sky { background: var(--wm-grad-sky); }
.grad-emerald { background: var(--wm-grad-emerald); }
.grad-teal { background: var(--wm-grad-teal); }
.grad-violet { background: var(--wm-grad-violet); }
.grad-rose { background: var(--wm-grad-rose); }
.grad-amber { background: var(--wm-grad-amber); }
.grad-slate { background: var(--wm-grad-slate); }
.wm-stat-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 100px; white-space: nowrap;
}
.wm-stat-badge.is-live { background: var(--wm-success-bg); color: var(--wm-success); }
.wm-stat-badge.is-warn { background: var(--wm-warning-bg); color: var(--wm-warning); }
.wm-stat-badge.is-ok { background: var(--wm-success-bg); color: var(--wm-success); }
.wm-stat-value {
    font-size: clamp(16px, 1.45vw, 24px); font-weight: 800; letter-spacing: -0.5px;
    line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap;
    position: relative; z-index: 1; color: var(--wm-text);
}
.wm-stat-label {
    font-size: clamp(9.5px, 0.72vw, 12px); color: var(--wm-text-3); font-weight: 500;
    margin-top: 2px; line-height: 1.35; position: relative; z-index: 1;
}
.wm-stat-spark {
    position: absolute; top: 50%; right: -5%; transform: translateY(-40%);
    width: 55%; height: 50px; opacity: 0.9; z-index: 0; pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05)); overflow: visible;
}
.wm-stroke-sky-line { stroke: #0284c7; }
.wm-stroke-emerald-line { stroke: #00a884; }
.wm-stroke-teal-line { stroke: #0d9488; }
.wm-stroke-violet-line { stroke: #7c3aed; }
.wm-stroke-rose-line { stroke: #e11d48; }
.wm-stroke-sky-stop { stop-color: #0284c7; stop-opacity: 0.35; }
.wm-stroke-emerald-stop { stop-color: #00a884; stop-opacity: 0.35; }
.wm-stroke-teal-stop { stop-color: #0d9488; stop-opacity: 0.35; }
.wm-stroke-violet-stop { stop-color: #7c3aed; stop-opacity: 0.35; }
.wm-stroke-rose-stop { stop-color: #e11d48; stop-opacity: 0.35; }
.grad-amber-line { stroke: #d97706; }
.grad-slate-line { stroke: #64748b; }
.grad-amber-stop { stop-color: #d97706; stop-opacity: 0.35; }
.grad-slate-stop { stop-color: #64748b; stop-opacity: 0.35; }
.wm-fade-stop { stop-color: #ffffff; stop-opacity: 0; }
.wm-stat-cta {
    margin-top: 8px; font-size: 11.5px; font-weight: 700; color: var(--wm-accent-deep);
    display: inline-flex; align-items: center; gap: 5px; position: relative; z-index: 1;
}
.wm-stat-cta .fa-arrow-right { font-size: 10px; transition: transform 0.2s; }
.wm-stat-card:hover .wm-stat-cta .fa-arrow-right { transform: translateX(3px); }

/* ── Cards ── */
.wm-card {
    background: var(--wm-card); border: 1px solid var(--wm-border);
    border-radius: var(--wm-radius-md); overflow: hidden; transition: box-shadow 0.25s;
    min-width: 0;
}
.wm-card:hover { box-shadow: var(--wm-shadow-hover); }
.wm-card-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid var(--wm-border); gap: 12px;
}
.wm-card-title { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; margin: 0; color: var(--wm-text); }
.wm-card-title .fas, .wm-card-title .fa-solid { margin-right: 6px; color: var(--wm-accent-deep); font-size: 13px; }
.wm-card-sub { font-size: 11.5px; color: var(--wm-text-3); margin: 1px 0 0; }
.wm-card-sub strong { color: var(--wm-accent-deep); }
.wm-card-bd { padding: 18px; }
.wm-card-actions { display: flex; gap: 3px; }
.wm-grid-2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.wm-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

/* ── Hub controls ── */
.wm-hub-hd { align-items: flex-start; flex-wrap: wrap; }
.wm-hub-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wm-search { position: relative; display: flex; align-items: center; }
.wm-search > i { position: absolute; left: 10px; font-size: 11px; color: var(--wm-muted); pointer-events: none; }
.wm-search input {
    width: 180px; height: 32px; padding: 0 26px 0 28px;
    border: 1px solid var(--wm-border); border-radius: var(--wm-radius-sm);
    background: var(--wm-bg); font-size: 12px; font-family: var(--wm-font);
    color: var(--wm-text); outline: none; transition: border-color 0.15s, box-shadow 0.15s, width 0.15s;
}
.wm-search input:focus { border-color: var(--wm-accent); box-shadow: 0 0 0 3px var(--wm-accent-bg); background: #fff; width: 210px; }
.wm-search input::placeholder { color: var(--wm-muted); }
.wm-kbd {
    position: absolute; right: 7px; font-size: 9px; font-weight: 700; color: var(--wm-muted);
    border: 1px solid var(--wm-border); border-radius: 4px; padding: 1px 4px; background: #fff;
}
.wm-hubtabs { display: flex; gap: 2px; background: var(--wm-bg); padding: 3px; border-radius: 8px; flex-wrap: wrap; }
.wm-tab {
    padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 500;
    color: var(--wm-text-3); cursor: pointer; transition: color 0.15s, background 0.15s;
    border: none; background: none; font-family: var(--wm-font); text-decoration: none;
    display: inline-flex; align-items: center;
}
.wm-tab:hover { color: var(--wm-text); background: rgba(15, 23, 42, 0.04); }
.wm-tab.active { color: var(--wm-accent-deep); background: var(--wm-accent-bg); font-weight: 600; }
a.wm-tab.active { background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }
.wm-tab:focus-visible, .wm-expand-btn:focus-visible, .wm-tile:focus-visible, .wm-stat-card:focus-visible {
    outline: 2px solid var(--wm-accent); outline-offset: 2px;
}

/* ── Hub tiles ── */
.wm-hub-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.wm-tile {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 12px 6px; border-radius: var(--wm-radius-sm);
    border: 1px solid var(--wm-border); transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    text-align: center;
}
.wm-tile:hover { border-color: var(--wm-accent); background: var(--wm-accent-soft); transform: translateY(-2px); box-shadow: 0 4px 12px -4px var(--wm-accent-glow); }
.wm-tile-icon {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #fff;
}
.wm-tile-name { font-size: 10px; font-weight: 600; color: var(--wm-text-2); line-height: 1.2; }
.wm-tile:hover .wm-tile-name { color: var(--wm-text); }
.wm-hub-noresults { grid-column: 1 / -1; text-align: center; padding: 20px; color: var(--wm-text-3); font-size: 12px; margin: 0; }

/* ── Activity feed ── */
.wm-feed { display: flex; flex-direction: column; max-height: 520px; }
.wm-scroll { overflow-y: auto; }
.wm-scroll::-webkit-scrollbar { width: 5px; }
.wm-scroll::-webkit-scrollbar-track { background: transparent; }
.wm-scroll::-webkit-scrollbar-thumb { background: var(--wm-muted); border-radius: 3px; }
.wm-scroll::-webkit-scrollbar-thumb:hover { background: var(--wm-text-3); }
.wm-act-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 18px; border-bottom: 1px solid var(--wm-border-soft); transition: background 0.12s;
}
.wm-act-item:last-child { border-bottom: none; }
.wm-act-item:hover { background: var(--wm-accent-soft); }
.wm-act-icon {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #fff; flex-shrink: 0; margin-top: 1px;
}
.wm-act-body { flex: 1; min-width: 0; }
.wm-act-text { font-size: 12.5px; font-weight: 500; color: var(--wm-text); line-height: 1.4; }
.wm-act-text strong { font-weight: 700; }
.wm-act-meta { font-size: 10.5px; color: var(--wm-text-3); margin-top: 2px; }
.wm-act-time {
    flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end;
    line-height: 1.25; white-space: nowrap; margin-top: 1px;
}
.wm-act-d { font-size: 10.5px; font-weight: 700; color: var(--wm-text-2); }
.wm-act-t { font-size: 10px; font-weight: 500; color: var(--wm-text-3); font-variant-numeric: tabular-nums; }

/* ── Tables ── */
.wm-table-wrap { overflow-x: auto; }
.wm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wm-table th {
    font-size: 10px; font-weight: 600; color: var(--wm-text-3); text-transform: uppercase;
    letter-spacing: 0.5px; text-align: left; padding: 10px 18px 8px; border-bottom: 1px solid var(--wm-border);
    white-space: nowrap;
}
.wm-table td { padding: 9px 18px; border-bottom: 1px solid rgba(15, 23, 42, 0.04); color: var(--wm-text); vertical-align: middle; }
.wm-table tr:last-child td { border-bottom: none; }
.wm-table tbody tr { transition: background 0.12s; }
.wm-table tbody tr:hover { background: var(--wm-accent-soft); }
.wm-cell-main { font-weight: 600; }
.wm-cell-muted { color: var(--wm-text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wm-chip { padding: 2px 9px; border-radius: 100px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.wm-chip.is-warn { background: var(--wm-warning-bg); color: var(--wm-warning); }
.wm-chip.is-ok { background: var(--wm-success-bg); color: var(--wm-success); }

/* ── Empty states ── */
.wm-empty { text-align: center; padding: 28px 16px; }
.wm-empty-icon {
    width: 48px; height: 48px; border-radius: 50%; background: var(--wm-success-bg);
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.wm-empty-icon i { font-size: 22px; color: var(--wm-success); }
.wm-empty-title { font-size: 13px; font-weight: 700; color: var(--wm-text); margin: 0; }
.wm-empty-sub { font-size: 11px; color: var(--wm-text-3); margin: 3px 0 0; }

/* ── Expand button + modal ── */
.wm-expand-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: 1px solid var(--wm-border); background: var(--wm-card);
    border-radius: 7px; color: var(--wm-text-3); font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.wm-expand-btn:hover { border-color: var(--wm-accent); color: var(--wm-accent-deep); background: var(--wm-accent-bg); }
.wm-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(3px);
    align-items: center; justify-content: center; padding: 24px;
}
.wm-modal-overlay.show { display: flex; }
.wm-modal-card {
    background: #fff; width: 95%; max-width: 720px; max-height: calc(100vh - 48px);
    border-radius: 16px; padding: 22px; position: relative; overflow: hidden auto;
    border: 1px solid var(--wm-border); box-shadow: 0 10px 40px rgba(15, 23, 42, 0.2);
    animation: wmPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes wmPopIn { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.wm-modal-close {
    position: absolute; top: 20px; right: 20px; width: 32px; height: 32px;
    border-radius: 8px; border: 1px solid var(--wm-border); background: var(--wm-bg);
    color: var(--wm-text-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wm-modal-close:hover { background: var(--wm-danger-bg); color: var(--wm-danger); border-color: var(--wm-danger); }
.wm-modal-title { font-size: 18px; font-weight: 800; color: var(--wm-text); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.wm-modal-title i { color: var(--wm-accent-deep); font-size: 15px; }
.wm-modal-body { overflow-y: auto; max-height: calc(100vh - 200px); }
.wm-modal-body .wm-feed, .wm-modal-body .wm-scroll { max-height: none; overflow: visible; }

/* ── Entrance animation ── */
@keyframes wmFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.wm-console .anim { animation: wmFadeUp 0.45s ease-out both; }
.wm-console .d1 { animation-delay: 0.03s; }
.wm-console .d2 { animation-delay: 0.06s; }
.wm-console .d3 { animation-delay: 0.09s; }
.wm-console .d4 { animation-delay: 0.12s; }
.wm-console .d5 { animation-delay: 0.15s; }
.wm-console .d6 { animation-delay: 0.18s; }
.wm-console .d7 { animation-delay: 0.21s; }
.wm-console .d8 { animation-delay: 0.24s; }

/* ── Responsive: KPIs hold one row until phones (reference behaviour) ── */
@media (max-width: 1400px) {
    .wm-hub-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1200px) {
    .wm-stat-spark { display: none; }
}
@media (max-width: 1100px) {
    .wm-grid-2 { grid-template-columns: 1fr; }
    .wm-hub-grid { grid-template-columns: repeat(4, 1fr); }
    .wm-feed { max-height: 380px; }
}
@media (max-width: 900px) {
    .wm-hub-grid { grid-template-columns: repeat(3, 1fr); }
    .wm-ticker { max-width: none; }
}
@media (max-width: 768px) {
    .wm-console { padding: 16px; }
    .wm-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wm-stat-value { font-size: 20px; }
    .wm-stat-label { font-size: 11px; }
    .wm-hub-controls { width: 100%; }
    .wm-search { flex: 1; }
    .wm-search input { width: 100%; }
    .wm-search input:focus { width: 100%; }
}
@media (max-width: 520px) {
    .wm-stats-row { grid-template-columns: 1fr; }
    .wm-hub-grid { grid-template-columns: repeat(2, 1fr); }
    .wm-page-head h1, .wm-head-left h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .wm-console .anim, .wm-modal-card { animation: none; }
    .wm-stat-card, .wm-tile, .wm-tab { transition: none; }
    .wm-live-dot { animation: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   Server & Health Component Styles (Matching Reference ERP Aesthetic)
   ══════════════════════════════════════════════════════════════════════ */
.shc-vital {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--wm-border);
    border-radius: var(--wm-radius-md);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: var(--wm-shadow);
    height: calc(100% - 16px);
}
.shc-vital-ico {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
    flex-shrink: 0;
}
.shc-vital-body { flex: 1; min-width: 0; }
.shc-vital-label { font-size: 12px; color: var(--wm-text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.shc-vital-value { font-size: 22px; font-weight: 700; color: var(--wm-text); line-height: 1.2; margin-top: 2px; }
.shc-vital-bar { height: 6px; margin: 6px 0 3px; border-radius: 4px; background: var(--wm-border-soft); }
.shc-vital-sub { font-size: 11.5px; color: var(--wm-text-3); }

/* Storage Center Vitals & Composition */
.sc-vital {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--wm-border);
    border-radius: var(--wm-radius-md);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: var(--wm-shadow);
    height: calc(100% - 16px);
}
.sc-vital-ico {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
    flex-shrink: 0;
}
.sc-vital-body { flex: 1; min-width: 0; }
.sc-vital-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wm-text-3); font-weight: 600; }
.sc-vital-value { font-size: 24px; font-weight: 700; color: var(--wm-text); line-height: 1.15; margin-top: 2px; }
.sc-vital-sub { font-size: 11.5px; color: var(--wm-text-3); }
.sc-vital-bar { height: 6px; margin: 6px 0 3px; border-radius: 4px; background: var(--wm-border-soft); }

.sc-stack {
    display: flex;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--wm-border-soft);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.sc-stack-seg { height: 100%; transition: filter 0.2s ease; }
.sc-stack-seg:hover { filter: brightness(1.1); }
.sc-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
    margin-top: 16px;
}
.sc-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.sc-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sc-legend-label { color: var(--wm-text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-legend-val { color: var(--wm-text-3); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sc-donut-wrap { display: flex; align-items: center; gap: 20px; }
.sc-donut { width: 136px; height: 136px; border-radius: 50%; flex-shrink: 0; position: relative; }
.sc-donut-hole {
    position: absolute;
    inset: 26px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px var(--wm-border);
}
.sc-donut-total { font-size: 15px; font-weight: 700; color: var(--wm-text); }
.sc-donut-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--wm-text-3); }
.sc-donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.sc-bar { height: 8px; border-radius: 5px; background: var(--wm-border-soft); overflow: hidden; flex: 1; }
.sc-bar-fill { height: 100%; border-radius: 5px; transition: width 0.3s ease; }
.sc-share { display: flex; align-items: center; gap: 8px; }
.sc-share-pct { font-size: 12px; color: var(--wm-text-3); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.tpl-btn-primary {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: var(--wm-radius-sm);
    padding: 7px 16px;
    font-weight: 600;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}
.tpl-btn-primary:hover {
    background: #0369a1;
    color: #ffffff;
    transform: translateY(-1px);
    text-decoration: none;
}

.diag-item { border-left: 4px solid var(--wm-border); padding-left: 15px; margin-bottom: 20px; }
.diag-item.pass { border-left-color: var(--wm-success); }
.diag-item.fail { border-left-color: var(--wm-danger); }
.diag-item.warn { border-left-color: var(--wm-warning); }

.log-entry {
    border-left: 3px solid var(--wm-border);
    padding: 0.5rem 0.85rem;
    margin-bottom: 0.4rem;
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
}
.log-entry.level-error { border-left-color: var(--wm-danger); }
.log-entry.level-warning { border-left-color: var(--wm-warning); }
.log-entry.level-info { border-left-color: var(--wm-info); }
.log-entry .log-message { font-family: var(--wm-mono); font-size: 0.85rem; word-break: break-word; }
.log-entry .log-detail {
    display: none;
    font-family: var(--wm-mono);
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow-y: auto;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.6rem;
    border-radius: 6px;
    margin-top: 0.4rem;
}
.log-entry.open .log-detail { display: block; }
.log-entry .log-toggle { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════════
   Server Health & Storage Center Components (Matching Images 3 & 4)
   ═══════════════════════════════════════════════════════════════════ */
.shc-vital {
    display: flex; align-items: center; gap: 14px;
    background: #ffffff; border: 1px solid var(--wm-border, #e2e8f0); border-radius: 12px;
    padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    height: calc(100% - 16px);
}
.shc-vital-ico {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #ffffff; flex-shrink: 0;
}
.shc-vital-body { flex: 1; min-width: 0; }
.shc-vital-label { font-size: 11.5px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.shc-vital-value { font-size: 24px; font-weight: 700; color: #1e293b; line-height: 1.15; margin-top: 2px; }
.shc-vital-bar { height: 6px; margin: 6px 0 3px; border-radius: 4px; background: #e2e8f0; }
.shc-vital-sub { font-size: 11.5px; color: #64748b; }

.sc-vital {
    display: flex; align-items: center; gap: 14px;
    background: #ffffff; border: 1px solid var(--wm-border, #e2e8f0); border-radius: 12px;
    padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    height: calc(100% - 16px);
}
.sc-vital-ico {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #ffffff; font-size: 20px; flex-shrink: 0;
}
.sc-vital-body { min-width: 0; flex: 1; }
.sc-vital-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; font-weight: 600; }
.sc-vital-value { font-size: 24px; font-weight: 700; color: #1e293b; line-height: 1.15; margin-top: 2px; }
.sc-vital-sub { font-size: 11.5px; color: #64748b; }
.sc-vital-bar { height: 6px; margin: 6px 0 3px; border-radius: 4px; background: #e2e8f0; }

.sc-bar { height: 8px; border-radius: 5px; background: #e2e8f0; overflow: hidden; flex: 1; }
.sc-bar-fill { height: 100%; border-radius: 5px; transition: width 0.3s ease; }
.sc-share { display: flex; align-items: center; gap: 8px; }
.sc-share-pct { font-size: 11.5px; color: #64748b; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.sc-stack { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: #e2e8f0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }
.sc-stack-seg { height: 100%; transition: filter 0.2s ease; }
.sc-stack-seg:hover { filter: brightness(1.1); }
.sc-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; margin-top: 14px; }
.sc-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.sc-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sc-legend-label { color: #334155; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-legend-val { color: #64748b; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sc-donut-wrap { display: flex; align-items: center; gap: 18px; }
.sc-donut { width: 132px; height: 132px; border-radius: 50%; flex-shrink: 0; position: relative; }
.sc-donut-hole {
    position: absolute; inset: 26px; background: #ffffff; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}
.sc-donut-total { font-size: 15px; font-weight: 700; color: #1e293b; }
.sc-donut-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.sc-donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.sc-empty-row { display: none; }
#sc-module-card.show-empty .sc-empty-row { display: table-row; }
#sc-module-card.show-empty .sc-empty-row td { opacity: 0.6; }
.sc-toggle { font-size: 12px; color: #64748b; font-weight: 500; cursor: pointer; user-select: none; }
.sc-toggle input { vertical-align: middle; margin-right: 4px; }

.sc-clean-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; width: 100%; min-height: 88px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
    color: #334155; font-weight: 600; font-size: 13px; text-align: center;
    padding: 12px; transition: all 0.15s ease; cursor: pointer; text-decoration: none;
}
.sc-clean-btn i { font-size: 20px; color: #0284c7; }
.sc-clean-btn:hover { border-color: #0284c7; background: rgba(2, 132, 199, 0.06); color: #0284c7; text-decoration: none; }
.sc-clean-btn--review i { color: #d97706; }
.sc-clean-btn--review:hover { border-color: #d97706; background: rgba(217, 119, 6, 0.06); color: #d97706; }

/* ═══ Horizontal Tabs (Matching Image 3) ═══ */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0 !important;
    gap: 2px;
}
.nav-tabs .nav-link {
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: #475569 !important;
    font-size: 13.5px;
    font-weight: 600;
    padding: 12px 18px;
    background: transparent !important;
    transition: all 0.15s ease;
    border-radius: 0 !important;
}
.nav-tabs .nav-link i {
    color: #f97316 !important;
    margin-right: 6px;
    transition: color 0.15s ease;
}
.nav-tabs .nav-link:hover {
    color: #0f172a !important;
    border-bottom-color: #cbd5e1 !important;
}
.nav-tabs .nav-link.active {
    color: #0f172a !important;
    font-weight: 700;
    border-bottom: 2px solid #0f172a !important;
    background: transparent !important;
}
.nav-tabs .nav-link.active i {
    color: #0f172a !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMINLTE V4 SIDEBAR THEME (Matching Reference ERP 1:1)
   ═══════════════════════════════════════════════════════════════════ */
.app-sidebar,
.main-sidebar,
aside.app-sidebar {
    background-color: #1f242b !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Brand Link */
.app-sidebar .brand-link,
.main-sidebar .brand-link {
    background-color: #1a1e24 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    min-height: 57px !important;
    padding: 0.8rem 1rem !important;
    text-decoration: none !important;
}
.app-sidebar .brand-link .brand-image,
.main-sidebar .brand-link .brand-image {
    max-height: 32px !important;
    width: auto !important;
    margin-right: 0.75rem !important;
}
.app-sidebar .brand-link .brand-text,
.main-sidebar .brand-link .brand-text {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    letter-spacing: -0.01em !important;
}

/* Sidebar Search Box */
.app-sidebar .sidebar .form-inline,
.main-sidebar .sidebar .form-inline {
    margin: 0.75rem 0.6rem !important;
}
.app-sidebar .form-control-sidebar,
.main-sidebar .form-control-sidebar {
    background-color: #2b3038 !important;
    border: 1px solid #3d444e !important;
    color: #ffffff !important;
    font-size: 0.85rem !important;
    border-radius: 6px 0 0 6px !important;
}
.app-sidebar .form-control-sidebar::placeholder,
.main-sidebar .form-control-sidebar::placeholder {
    color: #8c9ba5 !important;
    font-size: 0.82rem !important;
}
.app-sidebar .btn-sidebar,
.main-sidebar .btn-sidebar {
    background-color: #2b3038 !important;
    border: 1px solid #3d444e !important;
    border-left: none !important;
    color: #8c9ba5 !important;
    border-radius: 0 6px 6px 0 !important;
}
.app-sidebar .form-control-sidebar:focus,
.main-sidebar .form-control-sidebar:focus {
    border-color: var(--pw-sidebar-accent, #00a884) !important;
    box-shadow: none !important;
}

/* Section / Category Headers */
.app-sidebar .nav-header,
.main-sidebar .nav-header {
    background: transparent !important;
    color: #8c9ba5 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 0.85rem 0.85rem 0.35rem !important;
}

/* Nav Item Links */
.app-sidebar .nav-sidebar .nav-link,
.main-sidebar .nav-sidebar .nav-link {
    border-radius: 6px !important;
    margin: 2px 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    color: #c2c7d0 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.15s ease-in-out !important;
    border-left: 3px solid transparent !important;
}
.app-sidebar .nav-sidebar .nav-link:hover,
.main-sidebar .nav-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}
.app-sidebar .nav-sidebar .nav-icon,
.main-sidebar .nav-sidebar .nav-icon {
    font-size: 0.95rem !important;
    width: 1.25rem !important;
    margin-right: 0.5rem !important;
    text-align: center !important;
}

/* Active Nav Links */
.app-sidebar .nav-sidebar .nav-item.menu-open > .nav-link,
.app-sidebar .nav-sidebar .nav-item > .nav-link.active,
.main-sidebar .nav-sidebar .nav-item.menu-open > .nav-link,
.main-sidebar .nav-sidebar .nav-item > .nav-link.active {
    background-color: rgba(var(--pw-sidebar-accent-rgb, 0, 168, 132), 0.18) !important;
    color: #ffffff !important;
    border-left: 3px solid var(--pw-sidebar-accent, #00a884) !important;
    font-weight: 600 !important;
}

/* Submenu Items & » symbol */
.app-sidebar .nav-treeview .nav-link,
.main-sidebar .nav-treeview .nav-link {
    padding-left: 1.5rem !important;
    font-size: 0.84rem !important;
}
.app-sidebar .nav-treeview .nav-icon,
.main-sidebar .nav-treeview .nav-icon {
    display: none !important;
}
.app-sidebar .nav-treeview .nav-link::before,
.main-sidebar .nav-treeview .nav-link::before {
    content: '»';
    margin-right: 0.65rem;
    color: #8aa4af;
    font-size: 1.05rem;
    font-weight: bold;
    line-height: 1;
}
.app-sidebar .nav-treeview > .nav-item > .nav-link.active,
.main-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--pw-sidebar-accent, #00a884) !important;
    font-weight: 600 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMINLTE V4 TOP NAVBAR THEME (Matching Reference ERP 1:1)
   ═══════════════════════════════════════════════════════════════════ */
.app-header.navbar,
.main-header.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    min-height: 56px !important;
    padding: 0 1rem !important;
}
.app-header .nav-link,
.main-header .nav-link {
    color: #475569 !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s ease;
}
.app-header .nav-link:hover,
.main-header .nav-link:hover {
    color: #0f172a !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMINLTE V4 FOOTER THEME (Matching Reference ERP 1:1)
   ═══════════════════════════════════════════════════════════════════ */
.app-footer,
.main-footer {
    background-color: #ffffff !important;
    border-top: 1px solid #e5e7eb !important;
    color: #64748b !important;
    padding: 0.85rem 1.25rem !important;
    font-size: 0.875rem !important;
}
.app-footer a,
.main-footer a {
    color: var(--pw-sidebar-accent, #00a884) !important;
    font-weight: 600;
    text-decoration: none;
}
.app-footer a:hover,
.main-footer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   USER PROFILE DROPDOWN (Matching Reference ERP 1:1)
   ═══════════════════════════════════════════════════════════════════ */
.pw-user-menu .pw-user-trigger {
    padding: 0.35rem 0.6rem !important;
    border-radius: 6px;
    cursor: pointer;
}
.pw-user-menu .pw-user-trigger:hover {
    background-color: #f1f5f9;
}
.pw-user-menu .pw-avatar-sm {
    border: 2px solid rgba(0, 0, 0, 0.08);
}
.pw-user-dropdown {
    width: 280px !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}
.pw-user-item {
    color: #334155 !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
    text-decoration: none !important;
}
.pw-user-item:hover {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    padding-left: 1.25rem !important;
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOM SWITCH & THEME PRESET CONTROLS
   ═══════════════════════════════════════════════════════════════════ */
.custom-switch {
    padding-left: 2.75rem;
    position: relative;
    display: block;
    min-height: 1.5rem;
}
.custom-switch .custom-control-input {
    position: absolute;
    left: 0;
    z-index: 1;
    width: 2.25rem;
    height: 1.35rem;
    opacity: 0;
    cursor: pointer;
}
.custom-switch .custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: middle;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    user-select: none;
    padding-top: 1px;
}
.custom-switch .custom-control-label::before {
    position: absolute;
    top: 0.15rem;
    left: -2.75rem;
    display: block;
    width: 2.15rem;
    height: 1.25rem;
    pointer-events: none;
    content: "";
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 1rem;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.custom-switch .custom-control-label::after {
    position: absolute;
    top: calc(0.15rem + 2px);
    left: calc(-2.75rem + 2px);
    display: block;
    width: calc(1.25rem - 4px);
    height: calc(1.25rem - 4px);
    background-color: #adb5bd;
    border-radius: 50%;
    content: "";
    transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    background-color: #fff;
    transform: translateX(0.9rem);
}
.custom-switch.custom-switch-on-success .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}
.custom-switch.custom-switch-on-primary .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #007bff !important;
    border-color: #007bff !important;
}
.custom-switch.custom-switch-on-dark .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #343a40 !important;
    border-color: #343a40 !important;
}

.preset-box {
    transition: all 0.2s ease;
    border-width: 2px !important;
    border-color: #dee2e6 !important;
    position: relative;
}
.preset-box:hover {
    border-color: #007bff !important;
    background: #fff !important;
    transform: translateY(-2px);
}
.preset-box.selected {
    border-color: #007bff !important;
    border-width: 3px !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
}
.preset-box.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -8px;
    right: -8px;
    background: #007bff;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.form-control-color {
    padding: .2rem !important;
}

/* Bootstrap 4 to Bootstrap 5 Compatibility Fixes for Close Buttons */
.close,
button.close,
.alert-dismissible .close,
.modal-header .close {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;
    opacity: 0.6;
    padding: 0 0.5rem;
    cursor: pointer;
    transition: opacity 0.15s ease-in-out;
}

.close:hover,
button.close:hover,
.alert-dismissible .close:hover,
.modal-header .close:hover {
    opacity: 1;
    background: transparent !important;
}

.alert-dismissible {
    position: relative;
    padding-right: 3.5rem !important;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    box-shadow: none !important;
    background-size: 0.75rem;
    opacity: 0.6;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
}

.alert-dismissible .close,
.alert-dismissible button.close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
}

/* ═══════════════════════════════════════════════════════════════════
   Sidebar Menu Icons: Flat Uniform Tint (when Colorful is OFF)
   ═══════════════════════════════════════════════════════════════════ */
body:not(.pw-colorful-icons) .app-sidebar .nav-sidebar .nav-link > .nav-icon,
body:not(.pw-colorful-icons) .main-sidebar .nav-sidebar .nav-link > .nav-icon {
    color: rgba(255, 255, 255, 0.65) !important;
}

body:not(.pw-colorful-icons) .app-sidebar[class*="sidebar-light-"] .nav-sidebar .nav-link > .nav-icon,
body:not(.pw-colorful-icons) .main-sidebar[class*="sidebar-light-"] .nav-sidebar .nav-link > .nav-icon {
    color: #6c757d !important;
}

body:not(.pw-colorful-icons) .app-sidebar .nav-sidebar .nav-link:hover > .nav-icon,
body:not(.pw-colorful-icons) .main-sidebar .nav-sidebar .nav-link:hover > .nav-icon {
    color: #ffffff !important;
}

body:not(.pw-colorful-icons) .app-sidebar[class*="sidebar-light-"] .nav-sidebar .nav-link:hover > .nav-icon,
body:not(.pw-colorful-icons) .main-sidebar[class*="sidebar-light-"] .nav-sidebar .nav-link:hover > .nav-icon {
    color: #212529 !important;
}

body:not(.pw-colorful-icons) .app-sidebar .nav-sidebar .nav-link.active > .nav-icon,
body:not(.pw-colorful-icons) .main-sidebar .nav-sidebar .nav-link.active > .nav-icon {
    color: #ffffff !important;
}

body:not(.pw-colorful-icons) .app-sidebar[class*="sidebar-light-"] .nav-sidebar .nav-link.active > .nav-icon,
body:not(.pw-colorful-icons) .main-sidebar[class*="sidebar-light-"] .nav-sidebar .nav-link.active > .nav-icon {
    color: #ffffff !important;
}


