/* ================================================================
   Asal Flow AI — Premium SaaS Design System v3
   Inspired by WhatsApp Web, Slack, Intercom, HubSpot, Linear, Notion
   ================================================================ */

/* ── 1. Design Tokens ──────────────────────────────────────────── */
:root {
    /* Brand */
    --wa-green:         #00a884;
    --wa-green-dark:    #008069;
    --wa-green-light:   #d9fdd3;
    --wa-green-subtle:  rgba(0,168,132,.08);
    --wa-green-rgb:     0,168,132;

    /* Surfaces */
    --bg-body:          #f6f8fc;
    --bg-card:          #ffffff;
    --bg-sidebar:       #ffffff;
    --bg-topbar:        rgba(255,255,255,.88);
    --bg-chat:          #efeae2;
    --bg-hover:         #f0f4f9;
    --bg-active:        #f0f9f6;

    /* Text */
    --text-primary:     #111827;
    --text-secondary:   #475569;
    --text-muted:       #94a3b8;
    --text-inverse:     #ffffff;

    /* Borders */
    --border:           #e5e7eb;
    --border-light:     #f1f5f9;

    /* Shadows */
    --shadow-xs:        0 1px 2px rgba(0,0,0,.04);
    --shadow-sm:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:           0 4px 16px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
    --shadow-lg:        0 10px 40px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.05);
    --shadow-xl:        0 20px 60px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
    --shadow-green:     0 4px 14px rgba(var(--wa-green-rgb),.25);

    /* Radii */
    --radius-xs:        6px;
    --radius-sm:        8px;
    --radius:           12px;
    --radius-lg:        16px;
    --radius-xl:        20px;
    --radius-full:      9999px;

    /* Sizing */
    --sb-width:         260px;
    --sb-mini:          64px;
    --topbar-h:         64px;

    /* Transitions */
    --ease:             cubic-bezier(.4,0,.2,1);
    --ease-spring:      cubic-bezier(.34,1.56,.64,1);
    --duration:         .18s;
    --duration-slow:    .3s;

    /* Z-indices */
    --z-sidebar:        1030;
    --z-topbar:         1040;
    --z-overlay:        1049;
    --z-modal:          1070;
    --z-dropdown:       9999;
    --z-tooltip:        9999;

    /* Font */
    --font-sans:        'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', monospace;
}

/* ── 2. Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a { color: var(--wa-green); transition: color var(--duration) var(--ease); }
a:hover { color: var(--wa-green-dark); text-decoration: none; }
img { max-width: 100%; height: auto; }

::selection {
    background: var(--wa-green);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── 3. Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -.02em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--wa-green) !important; }
small, .small { font-size: .8125rem; }
strong, .font-weight-bold { font-weight: 600 !important; }
code {
    background: #f1f5f9;
    color: #7c3aed;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: .8125rem;
    font-family: var(--font-mono);
}

/* ── 4. Animations & Keyframes ──────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Skeleton loading */
.lw-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-xs);
}

/* Utility animation classes */
.lw-anim-fade-in    { animation: fadeIn var(--duration-slow) var(--ease); }
.lw-anim-fade-in-up { animation: fadeInUp var(--duration-slow) var(--ease); }
.lw-anim-scale-in   { animation: scaleIn var(--duration) var(--ease); }
.lw-anim-slide-in-right { animation: slideInRight var(--duration) var(--ease); }
.lw-anim-slide-in-down  { animation: slideInDown var(--duration) var(--ease); }

/* ── 5. Layout ──────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sb-mini);
    min-height: 100vh;
    padding-top: var(--topbar-h);
    transition: margin-left var(--duration-slow) var(--ease);
}
.main-content .container-fluid {
    padding: 24px 24px;
}

@media (max-width: 767px) {
    .main-content {
        margin-left: 0 !important;
        padding-top: var(--topbar-h);
    }
    .main-content .container-fluid {
        padding: 16px;
    }
}

/* Glassmorphism utility */
.lw-glass {
    background: rgba(255,255,255,.75);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.2);
}

/* ── 6. Cards ────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm) !important;
    background: var(--bg-card) !important;
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.card:hover {
    box-shadow: var(--shadow) !important;
}

.card-header {
    border-bottom: 1px solid var(--border) !important;
    background: var(--bg-card) !important;
    padding: 16px 20px !important;
    font-weight: 600;
    font-size: .9375rem;
    color: var(--text-primary) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-body { padding: 20px !important; }
.card-footer {
    border-top: 1px solid var(--border) !important;
    background: #fafbfc !important;
    border-radius: 0 0 var(--radius) var(--radius) !important;
    padding: 12px 20px !important;
}

/* Premium stat card */
.card-stat {
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    position: relative;
}
.card-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--wa-green);
    border-radius: 0 4px 4px 0;
}
.card-stat .card-body { padding: 20px !important; }
.card-stat .stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem;
    background: var(--wa-green);
    box-shadow: var(--shadow-green);
}
.card-stat .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.card-stat .stat-label { font-size: .8125rem; color: var(--text-muted); font-weight: 500; }

/* ── 7. Buttons ─────────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 500 !important;
    font-size: .875rem !important;
    padding: 8px 18px !important;
    letter-spacing: .01em;
    transition: all var(--duration) var(--ease) !important;
    box-shadow: none !important;
    cursor: pointer;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--wa-green) !important;
    border-color: var(--wa-green) !important;
    color: var(--text-inverse) !important;
}
.btn-primary:hover {
    background: var(--wa-green-dark) !important;
    border-color: var(--wa-green-dark) !important;
    box-shadow: var(--shadow-green) !important;
}

.btn-outline-primary {
    color: var(--wa-green) !important;
    border-color: var(--wa-green) !important;
}
.btn-outline-primary:hover {
    background: var(--wa-green) !important;
    color: #fff !important;
    box-shadow: var(--shadow-green) !important;
}

.btn-success {
    background: #10b981 !important;
    border-color: #10b981 !important;
}
.btn-danger {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
}
.btn-warning {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #fff !important;
}
.btn-info {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.btn-sm {
    padding: 5px 12px !important;
    font-size: .8125rem !important;
    border-radius: var(--radius-xs) !important;
}
.btn-lg {
    padding: 12px 24px !important;
    font-size: 1rem !important;
    border-radius: var(--radius) !important;
}
.btn-xs {
    padding: 3px 8px !important;
    font-size: .75rem !important;
    border-radius: 5px !important;
}

.btn-link {
    color: var(--wa-green) !important;
    text-decoration: none !important;
}
.btn-link:hover { color: var(--wa-green-dark) !important; }

/* Icon button */
.lw-btn-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .875rem;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
}
.lw-btn-icon:hover {
    background: rgba(var(--wa-green-rgb),.06);
    color: var(--wa-green);
    border-color: var(--wa-green);
}

/* ── 8. Forms ────────────────────────────────────────────────────── */
.form-control {
    border: 1.5px solid #dde2e8 !important;
    border-radius: var(--radius-sm) !important;
    padding: 9px 13px !important;
    font-size: .875rem !important;
    color: var(--text-primary) !important;
    background: var(--bg-card) !important;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease) !important;
    line-height: 1.5;
}
.form-control:focus {
    border-color: var(--wa-green) !important;
    box-shadow: 0 0 0 3px rgba(var(--wa-green-rgb),.12) !important;
    outline: none !important;
}
.form-control::placeholder { color: #aab4be !important; }

.form-control-label, label {
    font-size: .875rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 5px !important;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px !important;
    appearance: none;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.input-group-append .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

.input-group-text {
    border: 1.5px solid #dde2e8 !important;
    background: #f8fafc !important;
    color: var(--text-muted) !important;
    border-radius: var(--radius-sm) !important;
}

/* Custom switch */
.custom-switch .custom-control-label::before {
    border-radius: 12px !important;
    width: 38px !important; height: 22px !important; top: 2px !important;
    border: none !important; background: #d1d5db !important;
    transition: background var(--duration) var(--ease) !important;
}
.custom-switch .custom-control-label::after {
    border-radius: 50% !important;
    width: 18px !important; height: 18px !important; top: 4px !important;
    left: -24px !important; background: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.2) !important;
    transition: transform var(--duration) var(--ease) !important;
}
.custom-control-input:checked ~ .custom-control-label::before { background: var(--wa-green) !important; }
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { transform: translateX(16px) !important; }

/* ── 9. Tables ───────────────────────────────────────────────────── */
.table { font-size: .875rem !important; color: var(--text-primary) !important; }
.table th {
    font-size: .75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    color: var(--text-muted) !important;
    border-bottom: 2px solid var(--border) !important;
    padding: 10px 16px !important;
}
.table td {
    padding: 10px 16px !important;
    border-color: var(--border-light) !important;
    vertical-align: middle !important;
}
.table-hover tbody tr:hover { background: rgba(var(--wa-green-rgb),.03) !important; }

/* ── 10. Modals ──────────────────────────────────────────────────── */
.modal-content {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    overflow: hidden;
    animation: scaleIn var(--duration) var(--ease);
}
.modal-header {
    border-bottom: 1px solid var(--border) !important;
    padding: 18px 24px !important;
    background: var(--bg-card) !important;
}
.modal-title { font-weight: 700 !important; font-size: 1.125rem !important; color: var(--text-primary) !important; }
.modal-body { padding: 20px 24px !important; }
.modal-footer {
    border-top: 1px solid var(--border) !important;
    padding: 14px 24px !important;
    background: #fafbfc !important;
}
.modal-backdrop { z-index: var(--z-modal); }
.modal { z-index: calc(var(--z-modal) + 10); }

/* ── 11. Badges ──────────────────────────────────────────────────── */
.badge {
    font-size: .75rem !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: var(--radius-full) !important;
    letter-spacing: .02em;
    line-height: 1.3;
}
.badge-primary   { background: var(--wa-green) !important; color: #fff !important; }
.badge-success   { background: #10b981 !important; color: #fff !important; }
.badge-danger    { background: #ef4444 !important; color: #fff !important; }
.badge-warning   { background: #f59e0b !important; color: #fff !important; }
.badge-info      { background: #3b82f6 !important; color: #fff !important; }
.badge-secondary { background: #e2e8f0 !important; color: #64748b !important; }
.badge-light     { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #e2e8f0 !important; }
.badge-dark      { background: #1a2332 !important; color: #fff !important; }

/* ── 12. Alerts ──────────────────────────────────────────────────── */
.alert {
    border: none !important;
    border-radius: var(--radius-sm) !important;
    font-size: .875rem !important;
    padding: 12px 16px !important;
}
.alert-success  { background: #f0fdf4 !important; color: #166534 !important; border-left: 4px solid #10b981 !important; }
.alert-danger   { background: #fef2f2 !important; color: #991b1b !important; border-left: 4px solid #ef4444 !important; }
.alert-warning  { background: #fffbeb !important; color: #92400e !important; border-left: 4px solid #f59e0b !important; }
.alert-info     { background: #eff6ff !important; color: #1e40af !important; border-left: 4px solid #3b82f6 !important; }

/* ── 13. Dropdowns ───────────────────────────────────────────────── */
.dropdown-menu {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 6px !important;
    font-size: .875rem !important;
    animation: fadeInUp .12s var(--ease);
}
.dropdown-item {
    border-radius: var(--radius-xs) !important;
    padding: 8px 12px !important;
    font-size: .875rem !important;
    color: var(--text-primary) !important;
    transition: background var(--duration) var(--ease) !important;
    display: flex; align-items: center; gap: 8px;
}
.dropdown-item:hover { background: rgba(var(--wa-green-rgb),.06) !important; color: var(--wa-green) !important; }
.dropdown-item.active { background: var(--wa-green) !important; color: #fff !important; }
.dropdown-item.text-danger { color: #ef4444 !important; }
.dropdown-item.text-danger:hover { background: #fef2f2 !important; color: #dc2626 !important; }
.dropdown-divider { border-color: var(--border) !important; margin: 4px 0 !important; }
.dropdown-header { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── 14. Nav Tabs ────────────────────────────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--border) !important;
    gap: .25rem;
}
.nav-tabs .nav-link {
    border: none !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    font-size: .875rem !important;
    font-weight: 500 !important;
    color: var(--text-muted) !important;
    padding: 9px 16px !important;
    transition: all var(--duration) var(--ease) !important;
}
.nav-tabs .nav-link:hover { color: var(--wa-green) !important; background: rgba(var(--wa-green-rgb),.06) !important; }
.nav-tabs .nav-link.active {
    color: var(--wa-green) !important;
    background: var(--bg-card) !important;
    border-bottom: 2px solid var(--wa-green) !important;
    font-weight: 600 !important;
}

/* ── 15. Pagination ──────────────────────────────────────────────── */
.page-item .page-link {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    margin: 0 2px !important;
    color: var(--text-primary) !important;
    font-size: .875rem !important;
    padding: 6px 12px !important;
    transition: all var(--duration) var(--ease) !important;
}
.page-item.active .page-link {
    background: var(--wa-green) !important;
    border-color: var(--wa-green) !important;
    color: #fff !important;
}
.page-item .page-link:hover {
    background: rgba(var(--wa-green-rgb),.06) !important;
    color: var(--wa-green) !important;
}
.page-item.disabled .page-link { opacity: .4 !important; }

/* ── 16. Progress ────────────────────────────────────────────────── */
.progress { border-radius: var(--radius-full) !important; background: #e9ecef !important; height: 8px !important; }
.progress-bar { border-radius: var(--radius-full) !important; background: var(--wa-green) !important; }

/* ── 17. Fieldset ────────────────────────────────────────────────── */
fieldset {
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 18px 20px !important;
    background: var(--bg-card) !important;
}
fieldset legend {
    font-size: .75rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border) !important;
    background: #f8fafc !important;
    padding: 3px 10px !important;
    border-radius: var(--radius-xs) !important;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── 18. List Group ──────────────────────────────────────────────── */
.list-group-item { border-color: var(--border) !important; padding: 10px 16px !important; font-size: .875rem !important; }
.list-group-item:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important; }
.list-group-item:last-child  { border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important; }

/* ── 19. Selectize ───────────────────────────────────────────────── */
.selectize-input {
    border: 1.5px solid #dde2e8 !important;
    border-radius: var(--radius-sm) !important;
    padding: 8px 12px !important;
    font-size: .875rem !important;
    box-shadow: none !important;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease) !important;
}
.selectize-input.focus {
    border-color: var(--wa-green) !important;
    box-shadow: 0 0 0 3px rgba(var(--wa-green-rgb),.12) !important;
}
.selectize-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    font-size: .875rem !important;
}
.selectize-dropdown .option { padding: 8px 12px !important; transition: background var(--duration) var(--ease) !important; }
.selectize-dropdown .option:hover,
.selectize-dropdown .option.active { background: rgba(var(--wa-green-rgb),.06) !important; color: var(--wa-green-dark) !important; }

/* ── 20. Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb { background: transparent !important; padding: 0 !important; font-size: .875rem !important; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted) !important; }
.breadcrumb-item.active { color: var(--text-muted) !important; }

/* ── 21. Page Header ─────────────────────────────────────────────── */
.lw-page-header {
    background: linear-gradient(135deg, var(--wa-green-dark) 0%, var(--wa-green) 60%, #00c4a0 100%) !important;
    border-bottom: none !important;
    padding: 2.5rem 0 4rem !important;
    position: relative;
    overflow: hidden;
}
.lw-page-header::before {
    content: '';
    position: absolute; top: -60px; right: -60px;
    width: 300px; height: 300px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
    pointer-events: none;
}
.lw-page-header::after {
    content: '';
    position: absolute; bottom: -80px; left: -80px;
    width: 250px; height: 250px;
    background: rgba(255,255,255,.04);
    border-radius: 50%;
    pointer-events: none;
}
.lw-page-title {
    color: #fff !important;
    font-size: clamp(1.4rem, 2.5vw, 2rem) !important;
    font-weight: 800 !important;
    letter-spacing: -.3px !important;
    position: relative;
    z-index: 1;
}
.lw-page-header p { color: rgba(255,255,255,.75) !important; position: relative; z-index: 1; }

/* ── 22. Skeleton Loading ────────────────────────────────────────── */
.lw-skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-xs);
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.lw-skeleton-text:last-child { width: 60%; }
.lw-skeleton-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.lw-skeleton-card {
    height: 120px;
    border-radius: var(--radius);
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ── 23. Utilities ───────────────────────────────────────────────── */
/* Responsive */
@media (max-width: 576px) {
    .main-content .container-fluid { padding: 16px !important; }
    .card-body { padding: 16px !important; }
}

/* Flex helpers */
.lw-flex-center { display: flex; align-items: center; justify-content: center; }
.lw-flex-between { display: flex; align-items: center; justify-content: space-between; }
.lw-gap-1 { gap: 4px; }
.lw-gap-2 { gap: 8px; }
.lw-gap-3 { gap: 12px; }
.lw-gap-4 { gap: 16px; }

/* Text helpers */
.lw-text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-text-green { color: var(--wa-green) !important; }

/* hr */
hr { border-color: var(--border) !important; }

/* ── 24. Dark Mode ───────────────────────────────────────────────── */
[lw-theme-mode="dark"] {
    --bg-body:          #0f1117;
    --bg-card:          #1a1f2e;
    --bg-sidebar:       #1a1f2e;
    --bg-topbar:        rgba(26,31,46,.88);
    --bg-hover:         #1f2937;
    --bg-active:        rgba(0,168,132,.08);
    --text-primary:     #e2e8f0;
    --text-secondary:   #94a3b8;
    --text-muted:       #64748b;
    --border:           #2d3748;
    --border-light:     #1f2937;
    --shadow-xs:        0 1px 2px rgba(0,0,0,.2);
    --shadow-sm:        0 1px 3px rgba(0,0,0,.2);
    --shadow:           0 4px 16px rgba(0,0,0,.3);
    --shadow-lg:        0 10px 40px rgba(0,0,0,.35);
    --shadow-xl:        0 20px 60px rgba(0,0,0,.4);
}

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

[lw-theme-mode="dark"] .card,
[lw-theme-mode="dark"] .card-header,
[lw-theme-mode="dark"] .card-footer {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

[lw-theme-mode="dark"] .form-control {
    background: #111827 !important;
    border-color: #374151 !important;
    color: var(--text-primary) !important;
}
[lw-theme-mode="dark"] .form-control:focus {
    border-color: var(--wa-green) !important;
    box-shadow: 0 0 0 3px rgba(var(--wa-green-rgb),.12) !important;
}

[lw-theme-mode="dark"] .table { color: var(--text-primary) !important; }
[lw-theme-mode="dark"] .table td { border-color: var(--border-light) !important; }
[lw-theme-mode="dark"] .table th { color: var(--text-muted) !important; border-color: var(--border) !important; }
[lw-theme-mode="dark"] .table-hover tbody tr:hover { background: rgba(var(--wa-green-rgb),.05) !important; }

[lw-theme-mode="dark"] .dropdown-menu,
[lw-theme-mode="dark"] .lw-dropdown-menu {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}
[lw-theme-mode="dark"] .dropdown-item { color: var(--text-primary) !important; }
[lw-theme-mode="dark"] .dropdown-item:hover { background: var(--bg-hover) !important; color: var(--wa-green) !important; }

[lw-theme-mode="dark"] .modal-content,
[lw-theme-mode="dark"] .modal-header,
[lw-theme-mode="dark"] .modal-footer {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}
[lw-theme-mode="dark"] .modal-title { color: var(--text-primary) !important; }

[lw-theme-mode="dark"] .lw-glass {
    background: rgba(26,31,46,.85);
    border-color: rgba(45,55,72,.5);
}

[lw-theme-mode="dark"] ::-webkit-scrollbar-thumb { background: #374151; }
[lw-theme-mode="dark"] ::-webkit-scrollbar-thumb:hover { background: #4b5563; }

[lw-theme-mode="dark"] .lw-skeleton,
[lw-theme-mode="dark"] .lw-skeleton-text,
[lw-theme-mode="dark"] .lw-skeleton-avatar,
[lw-theme-mode="dark"] .lw-skeleton-card {
    background: linear-gradient(90deg, #1f2937 25%, #2d3748 50%, #1f2937 75%);
    background-size: 200% 100%;
}

[lw-theme-mode="dark"] .lw-page-header {
    background: linear-gradient(135deg, #0d5444 0%, var(--wa-green-dark) 60%, #00806a 100%) !important;
}

[lw-theme-mode="dark"] fieldset { background: var(--bg-card) !important; border-color: var(--border) !important; }
[lw-theme-mode="dark"] fieldset legend {
    background: var(--bg-hover) !important;
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
}

/* ── Mobile sidebar overlay ───────────────────────────────────── */
.lw-sb-overlay {
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(0,0,0,.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-slow) var(--ease);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.lw-sb-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Sidebar slide animation (mobile) ─────────────────────────── */
@media (max-width: 767px) {
    .lw-sidebar {
        transform: translateX(-100%);
        transition: transform var(--duration-slow) var(--ease-spring);
    }
    .lw-sidebar.lw-sb-open {
        transform: translateX(0);
    }
}

/* ── 26. Legacy Compatibility ──────────────────────────────────── */
.navbar-top { display: none !important; }
.lw-whatsapp-chat-window .main-content { padding-top: 0; }

/* ── 27. Top Header — Standalone (scoped under .lw-topbar-header) ─ */
.lw-topbar-header {
    position: fixed;
    top: 0;
    left: var(--sb-mini, 64px);
    right: 0;
    height: var(--topbar-h, 64px);
    display: flex;
    align-items: center;
    padding: 0 20px 0 16px;
    z-index: var(--z-topbar, 1040);
    gap: 6px;
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 4px 20px rgba(0,0,0,.04);
    transition: background .25s ease, box-shadow .25s ease;
}

.lw-topbar-header .lw-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.lw-topbar-header .lw-topbar-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.lw-topbar-header .lw-topbar-mobile-btn {
    display: none;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}
.lw-topbar-header .lw-topbar-mobile-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}
@media (max-width: 767px) {
    .lw-topbar-header .lw-topbar-mobile-btn { display: flex; }
}

.lw-topbar-header .lw-topbar-branding {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lw-topbar-header .lw-topbar-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.3px;
}

.lw-topbar-header .lw-topbar-brand-role {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .4px;
    line-height: 1.4;
}

.lw-topbar-header .lw-tb-action {
    border-radius: 8px;
    transition: background .15s ease;
}
.lw-topbar-header .lw-tb-action:hover {
    background: #f1f5f9;
}

.lw-topbar-header .lw-tb-icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: .95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
    text-decoration: none;
    position: relative;
}
.lw-topbar-header .lw-tb-icon-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.lw-topbar-header .lw-tb-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(239,68,68,.35);
    pointer-events: none;
}

.lw-topbar-header .lw-tb-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    flex-shrink: 0;
    margin: 0 6px;
}

.lw-topbar-header .lw-topbar-user {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 3px;
    border-radius: 100px;
    text-decoration: none !important;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    transition: background .15s ease;
}
.lw-topbar-header .lw-topbar-user:hover {
    background: #f1f5f9;
}

.lw-topbar-header .lw-topbar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.lw-topbar-header .lw-topbar-user-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
}

.lw-topbar-header .lw-topbar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
    flex-shrink: 1;
}

.lw-topbar-header .lw-topbar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.lw-topbar-header .lw-topbar-user-role {
    font-size: 9.5px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.lw-topbar-header .lw-topbar-user-caret {
    font-size: 9px;
    color: #94a3b8;
    transition: transform .18s ease;
}

.lw-topbar-header .lw-dropdown.show .lw-topbar-user-caret {
    transform: rotate(180deg);
}

.lw-topbar-header .lw-dropdown,
.lw-topbar-header .lw-tb-action.lw-dropdown {
    position: relative !important;
}

.lw-topbar-header .lw-dropdown-menu,
.lw-topbar-header .lw-user-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.04);
    min-width: 230px;
    z-index: 9999 !important;
    display: none;
    padding: 6px;
    animation: fadeInUp .12s ease;
}

.lw-topbar-header .lw-dropdown.show .lw-dropdown-menu {
    display: block !important;
}

.lw-topbar-header .lw-th-profile-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 8px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.lw-topbar-header .lw-th-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.lw-topbar-header .lw-th-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-topbar-header .lw-th-profile-email {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-topbar-header .lw-dropdown-menu-items {
    padding: 2px 0;
}

.lw-topbar-header .lw-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    transition: background .12s ease;
    cursor: pointer;
}
.lw-topbar-header .lw-dropdown-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.lw-topbar-header .lw-ddi {
    width: 18px;
    text-align: center;
    font-size: .82rem;
    color: #64748b;
    flex-shrink: 0;
}

.lw-topbar-header .lw-dd-warn .lw-ddi-warn {
    color: #f59e0b;
}
.lw-topbar-header .lw-dd-danger .lw-ddi-danger {
    color: #ef4444;
}

.lw-topbar-header .lw-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 8px;
}

.lw-topbar-header .lw-dropdown-footer {
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
    padding-top: 2px;
}

.lw-topbar-header .lw-notif-dropdown .lw-notif-menu {
    min-width: 280px;
    padding: 0;
}

.lw-topbar-header .lw-notif-header {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.lw-topbar-header .lw-notif-body {
    padding: 20px 14px;
    text-align: center;
}

.lw-topbar-header .lw-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 12.5px;
}

.lw-topbar-header .lw-notif-empty-icon {
    font-size: 1.4rem;
    color: #cbd5e1;
}

@media (max-width: 767px) {
    .lw-topbar-header {
        left: 0 !important;
        padding: 0 10px !important;
        gap: 4px !important;
    }
    .lw-topbar-header .lw-topbar-user-info {
        display: none;
    }
    .lw-topbar-header .lw-topbar-user {
        padding: 3px;
    }
    .lw-topbar-header .lw-topbar-user-caret {
        display: none;
    }
}

[lw-theme-mode="dark"] .lw-topbar-header {
    background: #141824;
    border-bottom-color: #1e293b;
    box-shadow: 0 1px 0 rgba(0,0,0,.1), 0 4px 20px rgba(0,0,0,.25);
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-brand-text {
    color: #e2e8f0;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-mobile-btn {
    color: #94a3b8;
}
[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-mobile-btn:hover {
    background: #1e293b;
    color: #e2e8f0;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-tb-action:hover {
    background: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-tb-icon-btn {
    color: #94a3b8;
}
[lw-theme-mode="dark"] .lw-topbar-header .lw-tb-icon-btn:hover {
    color: #e2e8f0;
    background: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-tb-divider {
    background: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-user:hover {
    background: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-user-name {
    color: #e2e8f0;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-user-role {
    color: #64748b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-user-caret {
    color: #64748b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-dropdown-menu,
[lw-theme-mode="dark"] .lw-topbar-header .lw-user-dropdown-menu {
    background: #141824;
    border-color: #1e293b;
    box-shadow: 0 10px 40px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.2);
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-th-profile-head {
    border-bottom-color: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-th-profile-name {
    color: #e2e8f0;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-th-profile-email {
    color: #64748b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-dropdown-item {
    color: #cbd5e1;
}
[lw-theme-mode="dark"] .lw-topbar-header .lw-dropdown-item:hover {
    background: #1a1f2e;
    color: #e2e8f0;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-ddi {
    color: #64748b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-dropdown-divider {
    background: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-dropdown-footer {
    border-top-color: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-notif-header {
    color: #e2e8f0;
    border-bottom-color: #1e293b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-notif-empty {
    color: #64748b;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-notif-empty-icon {
    color: #475569;
}

[lw-theme-mode="dark"] .lw-topbar-header .lw-topbar-user-status {
    border-color: #141824;
}

/* ── 28. Minimal Header (lw-header-minimal) ───────────────────── */
.lw-header-minimal {
    position: fixed;
    top: 0;
    left: var(--sb-mini, 64px);
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 16px;
    z-index: var(--z-topbar, 1040);
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 4px 20px rgba(0,0,0,.04);
    transition: background .25s ease, box-shadow .25s ease;
}

.lw-header-minimal .lw-hm-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.lw-header-minimal .lw-hm-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.lw-header-minimal .lw-hm-mobile-btn {
    display: none;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}
.lw-header-minimal .lw-hm-mobile-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}
@media (max-width: 767px) {
    .lw-header-minimal .lw-hm-mobile-btn { display: flex; }
}

.lw-header-minimal .lw-hm-branding {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lw-header-minimal .lw-hm-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.3px;
}

.lw-header-minimal .lw-hm-icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.05rem;
    cursor: pointer;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.lw-header-minimal .lw-hm-icon-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.lw-header-minimal .lw-hm-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 20px;
    background: #ef4444;
    color: #fff;
    pointer-events: none;
}

.lw-header-minimal .lw-hm-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 6px;
    flex-shrink: 0;
}

.lw-header-minimal .lw-hm-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease;
}
.lw-header-minimal .lw-hm-user:hover {
    background: #f1f5f9;
}

.lw-header-minimal .lw-hm-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.lw-header-minimal .lw-hm-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
@media (max-width: 767px) {
    .lw-header-minimal .lw-hm-user-info { display: none; }
    .lw-header-minimal .lw-hm-user { padding: 4px; }
}

.lw-header-minimal .lw-hm-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.lw-header-minimal .lw-hm-user-role {
    font-size: 11px;
    color: #64748b;
}

.lw-header-minimal .lw-hm-user-caret {
    font-size: 10px;
    color: #94a3b8;
    margin-left: 4px;
    transition: transform .2s ease;
}
.lw-header-minimal .lw-dropdown.show .lw-hm-user-caret {
    transform: rotate(180deg);
}

.lw-header-minimal .lw-dropdown { position: relative; }
.lw-header-minimal .lw-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    padding: 8px;
    z-index: 1050;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
}
.lw-header-minimal .lw-dropdown.show .lw-dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.lw-header-minimal .lw-hm-profile-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.lw-header-minimal .lw-hm-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.lw-header-minimal .lw-hm-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.lw-header-minimal .lw-hm-profile-email {
    font-size: 12px;
    color: #64748b;
    word-break: break-all;
}

.lw-header-minimal .lw-hm-dropdown-items {
    padding: 0;
}

.lw-header-minimal .lw-hm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease;
}
.lw-header-minimal .lw-hm-dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.lw-header-minimal .lw-hm-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.lw-header-minimal .lw-hm-dd-warn i { color: #f59e0b; }
.lw-header-minimal .lw-hm-dd-danger { color: #ef4444; }
.lw-header-minimal .lw-hm-dd-danger i { color: #ef4444; }
.lw-header-minimal .lw-hm-dd-danger:hover { background: #fef2f2; color: #dc2626; }

.lw-header-minimal .lw-hm-dropdown-footer {
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
    padding-top: 4px;
}

.lw-header-minimal .lw-hm-notif-menu {
    min-width: 300px;
}
.lw-header-minimal .lw-hm-notif-header {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    padding: 12px 12px 8px;
    border-bottom: 1px solid #f1f5f9;
}
.lw-header-minimal .lw-hm-notif-body {
    max-height: 320px;
    overflow-y: auto;
}
.lw-header-minimal .lw-hm-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 32px 16px;
    color: #94a3b8;
    font-size: 13px;
}
.lw-header-minimal .lw-hm-notif-empty i {
    font-size: 28px;
    color: #cbd5e1;
}

/* ── Dark Mode ─────────────────────────────────────────── */
[lw-theme-mode="dark"] .lw-header-minimal {
    background: #141824;
    border-bottom-color: #2d3748;
    box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 4px 20px rgba(0,0,0,.3);
}
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-brand-text { color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-mobile-btn { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-mobile-btn:hover { background: #1e293b; color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-icon-btn { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-icon-btn:hover { background: #1e293b; color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-divider { background: #2d3748; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-user:hover { background: #1e293b; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-user-name { color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-user-role { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-user-caret { color: #64748b; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-dropdown-menu { background: #1a1f2e; border-color: #2d3748; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-profile-head { border-bottom-color: #2d3748; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-profile-name { color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-profile-email { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-dropdown-item { color: #cbd5e1; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-dropdown-item:hover { background: #1e293b; color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-dropdown-item i { color: #64748b; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-dd-danger { color: #f87171; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-dd-danger i { color: #f87171; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-dd-danger:hover { background: #2d1b1b; color: #fca5a5; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-dropdown-footer { border-top-color: #2d3748; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-notif-header { color: #f1f5f9; border-bottom-color: #2d3748; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-notif-empty { color: #64748b; }
[lw-theme-mode="dark"] .lw-header-minimal .lw-hm-notif-empty i { color: #475569; }

/* ── 29. New Header (lw-hdr-new) ───────────────────────────────── */
.lw-hdr-new {
    position: fixed;
    top: 0;
    left: var(--sb-mini, 64px);
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 16px;
    z-index: var(--z-topbar, 1040);
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #eef2f6;
    transition: left .25s ease, background .25s ease;
}
.lw-sb-expanded .lw-hdr-new {
    left: var(--sb-width, 260px);
}
.lw-hdr-new .lw-hdr-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.lw-hdr-new .lw-hdr-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.15rem;
    cursor: pointer;
    border-radius: 10px;
    transition: background .15s ease, color .15s ease;
}
.lw-hdr-new .lw-hdr-menu-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}
@media (max-width: 767px) {
    .lw-hdr-new .lw-hdr-menu-btn { display: flex; }
    .lw-hdr-new { left: 0 !important; }
}
.lw-hdr-new .lw-hdr-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lw-hdr-new .lw-hdr-brand-text {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.4px;
    white-space: nowrap;
}

.lw-hdr-new .lw-hdr-center {
    flex: 1;
    max-width: 420px;
    margin: 0 24px;
}
.lw-hdr-new .lw-hdr-search-wrap {
    position: relative;
    width: 100%;
}
.lw-hdr-new .lw-hdr-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #94a3b8;
    pointer-events: none;
}
.lw-hdr-new .lw-hdr-search-input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 34px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 13px;
    color: #0f172a;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.lw-hdr-new .lw-hdr-search-input:focus {
    border-color: #00a884;
    box-shadow: 0 0 0 3px rgba(0,168,132,.12);
    background: #fff;
}
.lw-hdr-new .lw-hdr-search-input::placeholder {
    color: #94a3b8;
}

.lw-hdr-new .lw-hdr-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.lw-hdr-new .lw-hdr-action {
    position: relative;
}
.lw-hdr-new .lw-hdr-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 10px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.lw-hdr-new .lw-hdr-icon-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.lw-hdr-new .lw-hdr-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 20px;
    background: #ef4444;
    color: #fff;
    pointer-events: none;
}
.lw-hdr-new .lw-hdr-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 6px;
    flex-shrink: 0;
}

.lw-hdr-new .lw-hdr-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease;
}
.lw-hdr-new .lw-hdr-user:hover {
    background: #f1f5f9;
}
.lw-hdr-new .lw-hdr-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.lw-hdr-new .lw-hdr-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
@media (max-width: 767px) {
    .lw-hdr-new .lw-hdr-user-info { display: none; }
    .lw-hdr-new .lw-hdr-user { padding: 4px; }
}
.lw-hdr-new .lw-hdr-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}
.lw-hdr-new .lw-hdr-user-role {
    font-size: 11px;
    color: #64748b;
}
.lw-hdr-new .lw-hdr-user-caret {
    font-size: 10px;
    color: #94a3b8;
    margin-left: 2px;
    transition: transform .2s ease;
}
.lw-hdr-new .lw-dropdown.show .lw-hdr-user-caret {
    transform: rotate(180deg);
}

.lw-hdr-new .lw-dropdown { position: relative; }
.lw-hdr-new .lw-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 250px;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    padding: 8px;
    z-index: 1050;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
}
.lw-hdr-new .lw-dropdown.show .lw-dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.lw-hdr-new .lw-hdr-profile-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}
.lw-hdr-new .lw-hdr-profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.lw-hdr-new .lw-hdr-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}
.lw-hdr-new .lw-hdr-profile-email {
    font-size: 12px;
    color: #64748b;
    word-break: break-all;
}

.lw-hdr-new .lw-hdr-dropdown-items {
    padding: 0;
}
.lw-hdr-new .lw-hdr-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease;
}
.lw-hdr-new .lw-hdr-dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.lw-hdr-new .lw-hdr-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}
.lw-hdr-new .lw-hdr-dd-warn i { color: #f59e0b; }
.lw-hdr-new .lw-hdr-dd-danger { color: #ef4444; }
.lw-hdr-new .lw-hdr-dd-danger i { color: #ef4444; }
.lw-hdr-new .lw-hdr-dd-danger:hover { background: #fef2f2; color: #dc2626; }
.lw-hdr-new .lw-hdr-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}
.lw-hdr-new .lw-hdr-dropdown-footer {
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
    padding-top: 4px;
}

.lw-hdr-new .lw-hdr-notif-menu {
    min-width: 300px;
}
.lw-hdr-new .lw-hdr-notif-header {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    padding: 12px 12px 8px;
    border-bottom: 1px solid #f1f5f9;
}
.lw-hdr-new .lw-hdr-notif-body {
    max-height: 320px;
    overflow-y: auto;
}
.lw-hdr-new .lw-hdr-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 32px 16px;
    color: #94a3b8;
    font-size: 13px;
}
.lw-hdr-new .lw-hdr-notif-empty i {
    font-size: 28px;
    color: #cbd5e1;
}

.lw-sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1020;
}
@media (max-width: 767px) {
    .lw-sb-overlay.show { display: block; }
}

/* Dark mode for new header */
[lw-theme-mode="dark"] .lw-hdr-new {
    background: rgba(20,24,36,.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom-color: #2d3748;
}
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-brand-text { color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-menu-btn { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-menu-btn:hover { background: #1e293b; color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-icon-btn { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-icon-btn:hover { background: #1e293b; color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-search-input {
    background: #1e293b;
    border-color: #2d3748;
    color: #f1f5f9;
}
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-search-input:focus {
    border-color: #00a884;
    background: #141824;
}
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-search-input::placeholder { color: #64748b; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-divider { background: #2d3748; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-user:hover { background: #1e293b; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-user-name { color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-user-role { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-user-caret { color: #64748b; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-dropdown-menu { background: #1a1f2e; border-color: #2d3748; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-profile-head { border-bottom-color: #2d3748; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-profile-name { color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-profile-email { color: #94a3b8; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dropdown-item { color: #cbd5e1; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dropdown-item:hover { background: #1e293b; color: #f1f5f9; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dropdown-item i { color: #64748b; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dd-danger { color: #f87171; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dd-danger i { color: #f87171; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dd-danger:hover { background: #2d1b1b; color: #fca5a5; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dropdown-footer { border-top-color: #2d3748; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-dropdown-divider { background: #2d3748; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-notif-header { color: #f1f5f9; border-bottom-color: #2d3748; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-notif-empty { color: #64748b; }
[lw-theme-mode="dark"] .lw-hdr-new .lw-hdr-notif-empty i { color: #475569; }

/* ── 26. WhatsApp Chat Dark Mode overrides ─────────────────────── */
[lw-theme-mode="dark"] .lw-chat-page-wrapper { background: #1a1f2e; border-color: #2d3748; }
[lw-theme-mode="dark"] .lw-contacts-panel { background: #1a1f2e; border-color: #2d3748; }
[lw-theme-mode="dark"] .lw-contacts-panel-header { background: #1a1f2e; border-color: #2d3748; }
[lw-theme-mode="dark"] .lw-chat-panel { background: #111827; }
