/* =============================================================================
   ZeriOnix Payroll — Design System Premium v3.0
   Visual Identity: ERP/SaaS Enterprise · Andorra
   Stack: Bootstrap 5.3 + Alpine.js + Inter Font
   ============================================================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* =============================================================================
   CSS DESIGN TOKENS — Fundação Visual
   ============================================================================= */
:root {
    /* ── Layout ── */
    --sidebar-width:            260px;
    --sidebar-collapsed-width:  70px;
    --topbar-height:            60px;

    /* ── Brand Palette ── */
    --blue-50:   #eff6ff;
    --blue-100:  #dbeafe;
    --blue-200:  #bfdbfe;
    --blue-300:  #93c5fd;
    --blue-400:  #60a5fa;
    --blue-500:  #3b82f6;
    --blue-600:  #2563eb;
    --blue-700:  #1d4ed8;
    --blue-800:  #1e40af;
    --blue-900:  #1e3a8a;

    --primary:        var(--blue-600);
    --primary-dark:   var(--blue-700);
    --primary-darker: var(--blue-800);
    --primary-light:  var(--blue-50);
    --primary-muted:  var(--blue-200);

    /* ── Status Colors ── */
    --success:        #059669;
    --success-light:  #ecfdf5;
    --success-border: #a7f3d0;

    --warning:        #d97706;
    --warning-light:  #fffbeb;
    --warning-border: #fde68a;

    --danger:         #dc2626;
    --danger-light:   #fef2f2;
    --danger-border:  #fecaca;

    --info:           #0284c7;
    --info-light:     #f0f9ff;
    --info-border:    #bae6fd;

    --purple:         #7c3aed;
    --purple-light:   #f5f3ff;
    --purple-border:  #ddd6fe;

    --orange:         #ea580c;
    --orange-light:   #fff7ed;

    /* ── Neutrals (Slate) ── */
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-150: #edf1f6;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-850: #172032;
    --slate-900: #0f172a;
    --slate-950: #080e1d;

    /* ── Sidebar ── */
    --sidebar-bg:            #0b1220;
    --sidebar-bg-hover:      rgba(255,255,255,.05);
    --sidebar-bg-active:     rgba(59,130,246,.15);
    --sidebar-text:          #64748b;
    --sidebar-text-hover:    #cbd5e1;
    --sidebar-text-active:   #93c5fd;
    --sidebar-border:        rgba(255,255,255,.05);
    --sidebar-section-label: #334155;
    --sidebar-active-border: #3b82f6;

    /* ── UI Surface ── */
    --bg-app:    #f0f4f8;
    --bg-card:   #ffffff;
    --border:    #e2e8f0;
    --border-md: #cbd5e1;

    /* ── Elevation Shadows ── */
    --shadow-xs:  0 1px 2px rgba(15,23,42,.04);
    --shadow-sm:  0 1px 4px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md:  0 4px 8px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
    --shadow-lg:  0 12px 24px rgba(15,23,42,.10), 0 4px 8px rgba(15,23,42,.06);
    --shadow-xl:  0 24px 48px rgba(15,23,42,.12), 0 8px 16px rgba(15,23,42,.06);
    --shadow-glow-primary: 0 0 0 3px rgba(37,99,235,.15);
    --shadow-glow-success: 0 0 0 3px rgba(5,150,105,.15);
    --shadow-glow-danger:  0 0 0 3px rgba(220,38,38,.15);

    /* ── Border Radius ── */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius:    10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl:28px;

    /* ── Typography ── */
    --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-xs:   0.6875rem;  /* 11px */
    --text-sm:   0.8125rem;  /* 13px */
    --text-base: 0.875rem;   /* 14px */
    --text-md:   0.9375rem;  /* 15px */
    --text-lg:   1rem;       /* 16px */
    --text-xl:   1.125rem;   /* 18px */
    --text-2xl:  1.375rem;   /* 22px */
    --text-3xl:  1.625rem;   /* 26px */

    /* ── Motion ── */
    --ease:      cubic-bezier(.4,0,.2,1);
    --ease-out:  cubic-bezier(0,0,.2,1);
    --ease-in:   cubic-bezier(.4,0,1,1);
    --duration:  150ms;
    --duration-md: 200ms;
}

/* =============================================================================
   BASE — Reset & Body
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.zerionix-body {
    font-family: var(--font);
    font-size: var(--text-base);
    background: var(--bg-app);
    color: var(--slate-800);
    margin: 0; padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { transition: color var(--duration) var(--ease); }

/* =============================================================================
   SIDEBAR — Premium Navigation
   ============================================================================= */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--duration-md) var(--ease);
    overflow: hidden;
    box-shadow: 1px 0 0 var(--sidebar-border);
}

/* Subtle inner gradient to give depth */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255,255,255,.03) 30%,
        rgba(255,255,255,.03) 70%,
        transparent
    );
    pointer-events: none;
}

.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    display: none;
    backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}
.sidebar-overlay.sidebar-overlay--visible {
    pointer-events: auto;
}

@media (max-width: 991px) {
    .sidebar {
        width: var(--sidebar-width);
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: visible;
        will-change: transform;
    }
    .sidebar.sidebar-mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    .sidebar.sidebar-mobile-open .logo-text {
        display: block !important;
    }
    .sidebar.sidebar-mobile-open .sidebar-section-label,
    .sidebar.sidebar-mobile-open .sidebar-item span,
    .sidebar.sidebar-mobile-open .sidebar-user {
        display: block !important;
    }
    .sidebar-overlay {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .sidebar-overlay.sidebar-overlay--visible {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (min-width: 992px) {
    .sidebar-overlay.sidebar-overlay--visible {
        display: none !important;
    }
}

@media (max-width: 991px) {
    body.body-sidebar-mobile-open {
        overflow: hidden;
        touch-action: none;
        position: fixed;
        width: 100%;
    }
    body.body-sidebar-mobile-open .topbar {
        z-index: 1050;
    }
}

/* ── Brand Area ── */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .875rem;
    height: var(--topbar-height);
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex; align-items: center; gap: .75rem;
    text-decoration: none; color: white;
    flex: 1; overflow: hidden; min-width: 0;
}
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37,99,235,.45), 0 0 0 1px rgba(255,255,255,.08);
}
.logo-text { overflow: hidden; min-width: 0; }
.logo-title {
    display: block;
    font-size: .9375rem; font-weight: 800;
    line-height: 1.15; color: #f1f5f9;
    letter-spacing: -.025em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logo-subtitle {
    display: block;
    font-size: .6rem; font-weight: 600;
    color: var(--slate-600); text-transform: uppercase; letter-spacing: .12em;
}
.sidebar-toggle {
    background: none; border: none;
    color: var(--slate-600);
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
    font-size: .85rem;
}
.sidebar-toggle:hover { color: var(--slate-400); background: rgba(255,255,255,.06); }

.sidebar-close-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.08);
    color: var(--slate-400);
    cursor: pointer;
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
    flex-shrink: 0;
}
.sidebar-close-mobile:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,.12);
}
@media (max-width: 991px) {
    .sidebar-close-mobile {
        display: inline-flex;
    }
}
@media (min-width: 992px) {
    .sidebar-close-mobile {
        display: none !important;
    }
}

/* ── User Block ── */
.sidebar-user {
    display: flex; align-items: center; gap: .75rem;
    padding: .875rem;
    border-bottom: 1px solid var(--sidebar-border);
    overflow: hidden; flex-shrink: 0;
    background: rgba(255,255,255,.015);
}
.sidebar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.1);
    box-shadow: 0 0 0 1px rgba(0,0,0,.3);
}
.sidebar-user-info { overflow: hidden; min-width: 0; }
.sidebar-user-name {
    display: block; font-size: var(--text-sm); font-weight: 600;
    color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
    display: block; font-size: .68rem; color: var(--slate-500);
    text-transform: capitalize; font-weight: 500; margin-top: 1px;
}

/* ── Nav Container ── */
.sidebar-nav {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: .5rem 0 .75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.06) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 3px; }

/* ── Section Label (EMPRESA, NÒMINA, etc.) ── */
.sidebar-section-label {
    padding: 1.125rem .875rem .325rem;
    font-size: .6rem; font-weight: 700;
    color: var(--sidebar-section-label);
    text-transform: uppercase; letter-spacing: .12em;
    white-space: nowrap;
}

/* ── Nav Item (direct item without submenu) ── */
.sidebar-item {
    display: flex; align-items: center; gap: .6875rem;
    padding: .5625rem .875rem;
    margin: 1px .5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: var(--text-sm); font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
    white-space: nowrap;
    width: calc(100% - 1rem);
    line-height: 1.4;
}
.sidebar-item i {
    font-size: 1rem; flex-shrink: 0;
    width: 18px; text-align: center;
    transition: color var(--duration) var(--ease);
}
.sidebar-item:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-bg-hover);
}
.sidebar-item.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-bg-active);
    font-weight: 600;
    position: relative;
}
/* Left accent bar for active item */
.sidebar-item.active::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--sidebar-active-border);
    border-radius: 0 3px 3px 0;
}
.sidebar-item.active i { color: var(--sidebar-text-active); }

/* ── Group Toggle Button ── */
.sidebar-group-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5625rem .875rem;
    margin: 1px .5rem;
    color: var(--sidebar-text);
    font-size: var(--text-sm); font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
    white-space: nowrap;
    width: calc(100% - 1rem);
    background: none; border: none;
    text-align: left;
}
.sidebar-group-toggle:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-bg-hover);
}
.sidebar-group-toggle .gtoggle-inner {
    display: flex; align-items: center; gap: .6875rem;
}
.sidebar-group-toggle i:first-child {
    font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0;
}
.sidebar-chevron {
    font-size: .6rem !important;
    width: auto !important;
    color: var(--slate-700) !important;
    transition: transform var(--duration-md) var(--ease);
    flex-shrink: 0;
}
.sidebar-chevron.rotated { transform: rotate(180deg); }

/* ── Submenu Items ── */
.sidebar-group-items { padding: 2px 0; }
.sidebar-subitem {
    display: flex; align-items: center; gap: .625rem;
    padding: .4875rem .875rem .4875rem 2.625rem;
    margin: 1px .5rem;
    width: calc(100% - 1rem);
    color: var(--slate-500);
    font-size: .8rem; font-weight: 500;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
    white-space: nowrap; line-height: 1.4;
    position: relative;
}
.sidebar-subitem i {
    font-size: .875rem; flex-shrink: 0;
    width: 16px; text-align: center;
}
.sidebar-subitem:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-bg-hover);
}
.sidebar-subitem.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-bg-active);
    font-weight: 600;
}
.sidebar-subitem.active::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--sidebar-active-border);
    border-radius: 0 3px 3px 0;
}
.sidebar-subitem.active i { color: var(--sidebar-text-active); }

/* ── Footer ── */
.sidebar-footer {
    padding: .5rem .5rem .625rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    background: rgba(0,0,0,.15);
}

/* =============================================================================
   MAIN WRAPPER
   ============================================================================= */
.main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left var(--duration-md) var(--ease);
}
.main-wrapper.sidebar-open { margin-left: var(--sidebar-width); }
@media (max-width: 991px) {
    .main-wrapper, .main-wrapper.sidebar-open { margin-left: 0; }
}

/* =============================================================================
   TOPBAR — Clean & Professional
   ============================================================================= */
.topbar {
    position: sticky; top: 0;
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem 0 1.25rem;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.topbar-left {
    display: flex; align-items: center; gap: .875rem;
    min-width: 0; flex: 1;
}
.topbar-title {
    font-size: var(--text-md); font-weight: 700;
    color: var(--slate-900); letter-spacing: -.015em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: .375rem; flex-shrink: 0; }

.topbar-btn {
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--slate-500);
    padding: 0 .75rem; font-size: var(--text-sm);
    cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    transition: all var(--duration) var(--ease);
    height: 34px; font-weight: 500; white-space: nowrap;
}
.topbar-btn:hover { background: var(--slate-50); color: var(--slate-800); border-color: var(--slate-300); }

.topbar-icon-btn {
    background: none; border: none;
    color: var(--slate-400);
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-size: .975rem;
    position: relative;
}
.topbar-icon-btn:hover { background: var(--slate-100); color: var(--slate-700); }

.topbar-mobile-toggle {
    background: none; border: none; font-size: 1.2rem;
    color: var(--slate-500); cursor: pointer; padding: 4px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--duration) var(--ease);
}
.topbar-mobile-toggle:hover { background: var(--slate-100); color: var(--slate-800); }

.topbar-user-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 .625rem 0 .5rem;
    font-size: var(--text-sm); font-weight: 500; color: var(--slate-700);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    height: 34px;
}
.topbar-user-btn:hover { background: var(--slate-50); border-color: var(--slate-300); }
.topbar-avatar {
    width: 24px; height: 24px;
    border-radius: 50%; object-fit: cover;
    border: 1.5px solid var(--border);
}
/* Avatar com iniciais (mesma lógica visual que sidebar) */
.user-avatar-initials.topbar-avatar {
    width: 24px; height: 24px; min-width: 24px;
    font-size: .65rem; border: 1.5px solid var(--border);
}
.user-avatar-initials.sidebar-user-avatar {
    width: 36px; height: 36px; min-width: 36px;
    font-size: .8rem; border: 2px solid rgba(255,255,255,.1);
}
.user-avatar-initials.avatar-dropdown,
img.avatar-dropdown {
    width: 32px; height: 32px; min-width: 32px;
}
.user-avatar-initials.avatar-dropdown {
    font-size: .75rem; border: 1.5px solid var(--border);
}
img.avatar-dropdown { object-fit: cover; }
.topbar-divider {
    width: 1px; height: 24px;
    background: var(--border);
    margin: 0 .125rem;
}

/* Badge notificação */
.badge-notif {
    position: absolute; top: -2px; right: -2px;
    background: var(--danger); color: white;
    font-size: .575rem; font-weight: 700;
    border-radius: 99px; padding: 1px 3.5px;
    min-width: 15px; text-align: center; line-height: 1.4;
    border: 1.5px solid white;
}

/* Notif dropdown */
.notif-dropdown { min-width: 340px; padding: 0; overflow: hidden; }
.notif-header {
    padding: .625rem 1rem;
    background: var(--slate-50);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.notif-item { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; transition: background var(--duration) var(--ease); }
.notif-item:hover { background: var(--slate-50); }
.notif-icon { flex-shrink: 0; font-size: 1.05rem; margin-top: 2px; }
.notif-content { flex: 1; min-width: 0; }
.x-small { font-size: .7rem; }

/* =============================================================================
   BREADCRUMB
   ============================================================================= */
.breadcrumb-wrapper {
    background: white; border-bottom: 1px solid var(--border);
    padding: .4375rem 1.5rem;
}
.breadcrumb { font-size: .75rem; margin: 0; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; font-weight: 500; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--slate-500); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--slate-300); }

/* =============================================================================
   MAIN CONTENT
   ============================================================================= */
.main-content { flex: 1; }
.content-wrapper { padding: 1.375rem 1.5rem 2.5rem; }

@media (max-width: 575px) {
    .content-wrapper { padding: 1rem 1rem 2rem; }
}

/* =============================================================================
   PAGE HEADER
   ============================================================================= */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: .875rem;
}
.page-header-left { min-width: 0; }
.page-title {
    font-size: 1.375rem; font-weight: 800; color: var(--slate-900);
    margin: 0; line-height: 1.2; letter-spacing: -.025em;
}
.page-subtitle { font-size: var(--text-sm); color: var(--slate-500); margin: .2rem 0 0; }
.page-title-section {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: .875rem;
}

/* =============================================================================
   FLASH ALERTS
   ============================================================================= */
.alert {
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    border-width: 1px;
    padding: .75rem 1rem;
    display: flex; align-items: flex-start; gap: .625rem;
}
.alert-success { background: var(--success-light); border-color: var(--success-border); color: #065f46; }
.alert-danger   { background: var(--danger-light);  border-color: var(--danger-border);  color: #991b1b; }
.alert-warning  { background: var(--warning-light); border-color: var(--warning-border); color: #92400e; }
.alert-info     { background: var(--info-light);    border-color: var(--info-border);    color: #075985; }
.alert-dismissible .btn-close { padding: .75rem; }

/* =============================================================================
   CARDS — Elevated Surface System
   ============================================================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-md) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .9375rem 1.25rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.card-title {
    font-size: var(--text-md); font-weight: 700; color: var(--slate-900);
    margin: 0; letter-spacing: -.015em;
}
.card-body { padding: 1.25rem; }
.card-footer {
    background: var(--slate-50); border-top: 1px solid var(--border);
    padding: .875rem 1.25rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Card with top accent line */
.card-accent-primary   { border-top: 3px solid var(--primary); }
.card-accent-success   { border-top: 3px solid var(--success); }
.card-accent-warning   { border-top: 3px solid var(--warning); }
.card-accent-danger    { border-top: 3px solid var(--danger); }
.card-accent-purple    { border-top: 3px solid var(--purple); }

/* =============================================================================
   STAT CARDS (KPI) — Premium Dashboard Widgets
   ============================================================================= */
.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.25rem 1.125rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-md) var(--ease), transform var(--duration-md) var(--ease);
    position: relative; overflow: hidden;
    display: block; text-decoration: none; color: inherit;
}
.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    text-decoration: none; color: inherit;
}
/* Top accent bar */
.stat-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px; background: var(--primary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before  { background: var(--danger); }
.stat-card.info::before    { background: var(--info); }
.stat-card.purple::before  { background: var(--purple); }
.stat-card.orange::before  { background: var(--orange); }

.stat-card-inner { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card-body  { min-width: 0; }

.stat-value {
    font-size: 2rem; font-weight: 800;
    color: var(--slate-900);
    line-height: 1; letter-spacing: -.03em;
    margin-bottom: 4px;
}
.stat-label {
    font-size: .75rem; font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase; letter-spacing: .04em;
}
.stat-change { font-size: .75rem; font-weight: 600; margin-top: .375rem; display: flex; align-items: center; gap: 3px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-change.neutral { color: var(--slate-400); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon.primary { background: var(--blue-50);    color: var(--blue-600); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger  { background: var(--danger-light);  color: var(--danger); }
.stat-icon.info    { background: var(--info-light);    color: var(--info); }
.stat-icon.purple  { background: var(--purple-light);  color: var(--purple); }
.stat-icon.orange  { background: var(--orange-light);  color: var(--orange); }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    font-family: var(--font);
    font-weight: 500;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    transition: all var(--duration) var(--ease);
    display: inline-flex; align-items: center; gap: 5px;
    letter-spacing: -.005em;
    line-height: 1.4;
}
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.btn-primary:active { background: var(--primary-darker); }

.btn-secondary {
    background: var(--slate-700);
    border-color: var(--slate-700);
    color: white;
}
.btn-secondary:hover { background: var(--slate-800); border-color: var(--slate-800); color: white; }

.btn-outline-primary { color: var(--primary); border-color: var(--primary-muted); }
.btn-outline-primary:hover { background: var(--blue-50); color: var(--primary-dark); border-color: var(--blue-300); }

.btn-outline-secondary { color: var(--slate-600); border-color: var(--slate-300); }
.btn-outline-secondary:hover { background: var(--slate-100); color: var(--slate-800); }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #047857; border-color: #047857; box-shadow: 0 4px 12px rgba(5,150,105,.35); }

.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,.3); }

.btn-sm     { padding: .3125rem .75rem; font-size: .775rem; gap: 4px; }
.btn-lg     { padding: .625rem 1.25rem; font-size: var(--text-md); }
.btn-xl     { padding: .75rem 1.5rem; font-size: var(--text-lg); font-weight: 600; }

.btn-icon   { width: 34px; height: 34px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 28px; height: 28px; font-size: .8rem; }

/* =============================================================================
   FORMS — Premium Input System
   ============================================================================= */
.form-control, .form-select {
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm); font-family: var(--font);
    color: var(--slate-800);
    padding: .5rem .75rem;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    height: auto;
    background-color: white;
    line-height: 1.5;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow-primary);
    outline: none;
}
.form-control::placeholder { color: var(--slate-300); }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: var(--shadow-glow-danger); }
.form-control.is-valid { border-color: var(--success); }
.form-control.is-valid:focus { box-shadow: var(--shadow-glow-success); }

.form-label {
    font-size: .75rem; font-weight: 600;
    color: var(--slate-600);
    margin-bottom: .3125rem; display: block;
    text-transform: uppercase; letter-spacing: .04em;
}
.form-hint { font-size: .7rem; color: var(--slate-400); margin-top: .25rem; line-height: 1.4; }
.required::after { content: ' *'; color: var(--danger); font-weight: 700; }

/* Postal code → parish + city auto-fill feedback */
.postal-parish-feedback {
    margin-top: .3rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    animation: fadeInDown .18s ease;
}
.badge-postal-ok {
    display: inline-flex;
    align-items: center;
    background: var(--success);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 999px;
    letter-spacing: .02em;
    white-space: nowrap;
}
.badge-postal-cities {
    font-size: .68rem;
    color: var(--slate-500);
    line-height: 1.4;
    font-style: italic;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.input-group-text {
    font-size: var(--text-sm); background: var(--slate-50);
    border: 1.5px solid var(--slate-200); color: var(--slate-500);
}
.input-group .form-control { border: 1.5px solid var(--slate-200); }
.input-group .form-control:focus { z-index: 3; }

.invalid-feedback { font-size: .7375rem; color: var(--danger); margin-top: .25rem; }
.valid-feedback   { font-size: .7375rem; color: var(--success); margin-top: .25rem; }

/* Form Sections */
.form-section { margin-bottom: 2rem; }
.form-section-header {
    display: flex; align-items: center; gap: .625rem;
    margin-bottom: 1.25rem; padding-bottom: .625rem;
    border-bottom: 2px solid var(--slate-100);
}
.form-section-title {
    font-size: .8125rem; font-weight: 700; color: var(--slate-700);
    text-transform: uppercase; letter-spacing: .06em; margin: 0;
}
.form-section-icon { font-size: .9rem; color: var(--primary); }

textarea.form-control { min-height: 90px; resize: vertical; }

/* File Upload */
.file-upload-zone {
    border: 2px dashed var(--slate-200);
    border-radius: var(--radius-md); padding: 2rem;
    text-align: center; cursor: pointer;
    transition: all var(--duration-md) var(--ease);
    background: var(--slate-50);
}
.file-upload-zone:hover, .file-upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--blue-50);
}
.file-upload-icon { font-size: 2rem; color: var(--slate-300); margin-bottom: .75rem; }

/* =============================================================================
   NAV TABS
   ============================================================================= */
.nav-tabs-zerionix {
    border-bottom: 2px solid var(--slate-100);
    gap: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
}
.nav-tabs-zerionix::-webkit-scrollbar { display: none; }
.nav-tabs-zerionix .nav-link {
    border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
    color: var(--slate-500);
    font-size: var(--text-sm); font-weight: 500;
    padding: .75rem 1.125rem; border-radius: 0;
    transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.nav-tabs-zerionix .nav-link:hover { color: var(--primary); }
.nav-tabs-zerionix .nav-link.active {
    color: var(--primary); border-bottom-color: var(--primary);
    font-weight: 600; background: none;
}
.nav-tabs-zerionix .nav-link .tab-badge {
    background: var(--danger); color: white;
    font-size: .6rem; font-weight: 700;
    border-radius: 99px; padding: 1px 5px; min-width: 16px;
}
.nav-tabs-zerionix .nav-link.tab-error { color: var(--danger) !important; border-bottom-color: var(--danger) !important; }

/* =============================================================================
   TABLES — Premium DataTable Style
   ============================================================================= */
.table {
    font-size: var(--text-sm);
    --bs-table-hover-bg: #fafbfd;
    margin-bottom: 0;
}
.table th {
    font-size: .6875rem; font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase; letter-spacing: .07em;
    background: var(--slate-50);
    border-bottom: 1px solid var(--border) !important;
    padding: .6875rem 1rem; white-space: nowrap; vertical-align: middle;
}
.table td {
    padding: .75rem 1rem; vertical-align: middle;
    color: var(--slate-700); border-color: var(--slate-100) !important;
}
.table td:first-child, .table th:first-child { padding-left: 1.25rem; }
.table td:last-child,  .table th:last-child  { padding-right: 1.25rem; }
.table tbody tr { transition: background var(--duration) var(--ease); }
.table tbody tr:last-child td { border-bottom: 0 !important; }

.table-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }

/* DataTables overrides */
.dataTables_wrapper { font-family: var(--font); font-size: var(--text-sm); }
.dataTables_filter input {
    border: 1.5px solid var(--slate-200); border-radius: var(--radius-sm);
    padding: .375rem .75rem; font-size: var(--text-sm); font-family: var(--font);
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    height: 34px;
}
.dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow-primary);
    outline: none;
}
.dataTables_length select {
    border: 1.5px solid var(--slate-200); border-radius: var(--radius-sm);
    padding: .25rem .5rem; font-size: var(--text-sm); height: 34px;
}
.paginate_button.current, .paginate_button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.paginate_button:hover {
    background: var(--slate-100) !important;
    border-color: var(--border) !important;
    color: var(--slate-800) !important;
    border-radius: var(--radius-sm);
}

/* =============================================================================
   BADGES & STATUS
   ============================================================================= */
.badge {
    font-size: .6875rem; font-weight: 600;
    border-radius: 99px; padding: 3px 8px; letter-spacing: .01em;
}
.badge-dot {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .75rem; font-weight: 500;
}
.badge-dot::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}

/* Status variants */
.badge-status-active      { background: #dcfce7; color: #15803d; }
.badge-status-inactive    { background: var(--slate-100); color: var(--slate-500); }
.badge-status-terminated  { background: var(--danger-light); color: var(--danger); }
.badge-status-suspended   { background: var(--warning-light); color: var(--warning); }
.badge-status-pending     { background: #fef9c3; color: #a16207; }
.badge-status-approved    { background: #dcfce7; color: #15803d; }
.badge-status-rejected    { background: var(--danger-light); color: var(--danger); }
.badge-status-confirmed   { background: var(--blue-50); color: var(--primary); }
.badge-status-sent        { background: #d1fae5; color: #059669; }
.badge-status-locked      { background: #ede9fe; color: var(--purple); }
.badge-status-draft       { background: var(--slate-100); color: var(--slate-500); }
.badge-status-processing  { background: #fef3c7; color: #b45309; }
.badge-status-closed      { background: var(--slate-100); color: var(--slate-600); }

/* =============================================================================
   FILTER CARD
   ============================================================================= */
.filter-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1rem 1.25rem;
    margin-bottom: 1.25rem; box-shadow: var(--shadow-xs);
}
.filter-card .filter-label {
    font-size: .7rem; font-weight: 600; color: var(--slate-500);
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem;
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.empty-state {
    text-align: center; padding: 3.5rem 2rem;
}
.empty-state-icon {
    font-size: 3rem; opacity: .18; margin-bottom: 1.25rem;
    display: block; color: var(--slate-400);
}
.empty-state-title {
    font-size: 1rem; font-weight: 700;
    color: var(--slate-600); margin-bottom: .5rem;
}
.empty-state-text {
    font-size: var(--text-sm); color: var(--slate-400);
    max-width: 320px; margin: 0 auto 1.25rem;
}

/* =============================================================================
   LOADING
   ============================================================================= */
.loading-overlay {
    position: absolute; inset: 0;
    background: rgba(255,255,255,.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; border-radius: var(--radius-md);
    backdrop-filter: blur(2px);
}

/* =============================================================================
   AVATAR
   ============================================================================= */
.avatar {
    object-fit: cover; flex-shrink: 0; border-radius: 50%;
    width: 40px; height: 40px;
}
.avatar-xs  { width: 24px; height: 24px; }
.avatar-sm  { width: 32px; height: 32px; }
.avatar-md  { width: 44px; height: 44px; }
.avatar-lg  { width: 56px; height: 56px; border: 3px solid white; box-shadow: var(--shadow-sm); }
.avatar-xl  { width: 80px; height: 80px; border: 4px solid white; box-shadow: var(--shadow-md); }
.avatar-2xl { width: 96px; height: 96px; border: 4px solid white; box-shadow: var(--shadow-md); }

/* ── Avatar letras (fallback) ── */
.avatar-initials {
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--blue-100); color: var(--blue-700);
    font-weight: 700; letter-spacing: -.02em; user-select: none;
    flex-shrink: 0;
}

/* =============================================================================
   INFO BLOCKS
   ============================================================================= */
.info-row {
    display: flex; align-items: baseline; gap: .75rem;
    padding: .5625rem 0;
    border-bottom: 1px solid var(--slate-100);
}
.info-row:last-child { border-bottom: none; }
.info-label {
    font-size: .7375rem; font-weight: 600; color: var(--slate-400);
    min-width: 140px; text-transform: uppercase; letter-spacing: .03em; flex-shrink: 0;
}
.info-value {
    font-size: var(--text-sm); color: var(--slate-800); font-weight: 500;
    word-break: break-word;
}

/* Summary Box */
.summary-box {
    background: var(--slate-50); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1rem 1.125rem;
}
.summary-row { display: flex; justify-content: space-between; padding: .325rem 0; font-size: var(--text-sm); }
.summary-row.subtotal { border-top: 1px solid var(--border); padding-top: .5rem; margin-top: .25rem; font-weight: 600; }
.summary-row.total { border-top: 2px solid var(--primary); padding-top: .5rem; margin-top: .5rem; font-weight: 800; font-size: var(--text-lg); color: var(--primary); }

/* =============================================================================
   USER MINI CARD
   ============================================================================= */
.user-mini-card {
    display: flex; align-items: center; gap: .75rem;
    padding: .625rem .875rem; background: var(--slate-50);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.user-mini-card-name { font-size: var(--text-sm); font-weight: 600; color: var(--slate-800); }
.user-mini-card-sub  { font-size: .7rem; color: var(--slate-500); }

/* =============================================================================
   TIMELINE
   ============================================================================= */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
    content: ''; position: absolute; left: .5rem; top: 0; bottom: 0;
    width: 2px; background: var(--slate-200);
}
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-dot {
    position: absolute; left: -1.1rem; top: .3rem;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--primary); border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-time { font-size: .7rem; color: var(--slate-400); margin-bottom: .2rem; }
.timeline-content { font-size: var(--text-sm); color: var(--slate-700); }

/* =============================================================================
   SELECT2 CUSTOM THEME
   ============================================================================= */
.select2-container--bootstrap-5 .select2-selection {
    border: 1.5px solid var(--slate-200) !important;
    border-radius: var(--radius-sm) !important;
    font-size: var(--text-sm) !important;
    font-family: var(--font) !important;
    min-height: 36px !important;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open  .select2-selection {
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-glow-primary) !important;
}
.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    font-size: var(--text-sm) !important;
    font-family: var(--font) !important;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background: var(--blue-50) !important; color: var(--primary-dark) !important;
}
.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
    background: var(--primary) !important; color: white !important;
}
.select2-container--bootstrap-5 .select2-search__field {
    font-size: var(--text-sm) !important; font-family: var(--font) !important;
    border-color: var(--slate-200) !important;
}

/* =============================================================================
   intl-tel-input
   ============================================================================= */
.iti {
    display: block !important;
    width: 100% !important;
}
.iti__tel-input {
    width: 100% !important;
}
.iti__flag-container { z-index: 5; }
.iti__selected-flag {
    background: var(--slate-50) !important;
    border-right: 1px solid var(--slate-200) !important;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}
/* Modo básico (apenas bandeira) */
.iti input, .iti input[type=text], .iti input[type=tel] {
    border: 1.5px solid var(--slate-200) !important;
    border-radius: var(--radius-sm) !important;
    font-size: var(--text-sm) !important;
    font-family: var(--font) !important;
    height: 38px !important;
    width: 100% !important;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
/* Modo separateDialCode=true: o botão tem bandeira + código, precisa mais espaço */
.iti--separate-dial-code input,
.iti--separate-dial-code input[type=text],
.iti--separate-dial-code input[type=tel] {
    padding-left: 96px !important;
}
/* Modo sem separateDialCode: apenas bandeira */
.iti:not(.iti--separate-dial-code) input,
.iti:not(.iti--separate-dial-code) input[type=text],
.iti:not(.iti--separate-dial-code) input[type=tel] {
    padding-left: 52px !important;
}
.iti input:focus {
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-glow-primary) !important;
    outline: none !important;
}
.iti__country-list {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    font-size: var(--text-sm) !important;
    font-family: var(--font) !important;
}
.iti__country.iti__highlight { background: var(--blue-50) !important; }
/* Garantir que o dial code se alinha bem */
.iti__selected-dial-code {
    font-size: var(--text-sm) !important;
    font-weight: 500 !important;
    color: var(--slate-700) !important;
}

/* =============================================================================
   SWEETALERT2 PREMIUM THEME
   ============================================================================= */
.swal2-popup {
    border-radius: var(--radius-lg) !important;
    font-family: var(--font) !important;
    padding: 2rem !important;
    box-shadow: var(--shadow-xl) !important;
}
.swal2-title {
    font-size: 1.125rem !important; font-weight: 700 !important;
    color: var(--slate-900) !important; letter-spacing: -.015em !important;
}
.swal2-html-container {
    font-size: var(--text-sm) !important; color: var(--slate-600) !important;
    line-height: 1.6 !important;
}
.swal2-confirm {
    font-family: var(--font) !important; font-weight: 600 !important;
    border-radius: var(--radius-sm) !important; font-size: var(--text-sm) !important;
    padding: .5rem 1.375rem !important;
}
.swal2-cancel {
    font-family: var(--font) !important; font-weight: 500 !important;
    border-radius: var(--radius-sm) !important; font-size: var(--text-sm) !important;
    padding: .5rem 1.375rem !important;
}
.swal2-icon { margin: 0 auto .875rem !important; }
.swal-toast-popup {
    border-radius: var(--radius-sm) !important;
    font-family: var(--font) !important;
    font-size: var(--text-sm) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* =============================================================================
   MODALS
   ============================================================================= */
.modal-content {
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl); overflow: hidden;
}
.modal-header {
    background: white; border-bottom: 1px solid var(--border);
    padding: 1.125rem 1.375rem;
}
.modal-title { font-size: var(--text-lg); font-weight: 700; color: var(--slate-900); letter-spacing: -.015em; }
.modal-body { padding: 1.375rem; }
.modal-footer { background: var(--slate-50); border-top: 1px solid var(--border); padding: 1rem 1.375rem; }

/* =============================================================================
   DROPDOWNS
   ============================================================================= */
/* Dropdowns geridos pelo Alpine.js — não usar .dropdown-menu que tem display:none no Bootstrap */
.x-dropdown {
    display: block; /* Alpine controla via x-show (toggle inline display:none) */
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1060;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: .375rem;
    min-width: 10rem;
}

.dropdown-menu {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); font-size: var(--text-sm);
    padding: .375rem; z-index: 1050;
}
.dropdown-item {
    border-radius: var(--radius-sm); padding: .4375rem .75rem;
    font-size: var(--text-sm); color: var(--slate-700); font-weight: 500;
    display: flex; align-items: center; gap: .5rem;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.dropdown-item:hover { background: var(--slate-100); color: var(--slate-900); }
.dropdown-item.active, .dropdown-item:active { background: var(--blue-50); color: var(--primary); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider { border-color: var(--border); margin: .25rem 0; }
.dropdown-header {
    font-size: .7rem; font-weight: 700; color: var(--slate-400);
    text-transform: uppercase; letter-spacing: .07em; padding: .5rem .75rem .25rem;
}

/* =============================================================================
   LIST GROUP
   ============================================================================= */
.list-group-item { font-size: var(--text-sm); border-color: var(--border); }
.list-group-item-action:hover { background: var(--slate-50); }
.list-group-flush .list-group-item { padding-left: 1rem; padding-right: 1rem; }

/* =============================================================================
   PAGINATION
   ============================================================================= */
.pagination .page-link {
    font-size: .8rem; border-radius: var(--radius-sm) !important;
    border-color: var(--border); color: var(--slate-600);
    padding: .3125rem .625rem; margin: 0 1px;
}
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.pagination .page-link:hover { background: var(--slate-100); border-color: var(--slate-300); color: var(--slate-800); }

/* =============================================================================
   PROGRESS
   ============================================================================= */
.progress { border-radius: 99px; background: var(--slate-200); }
.progress-bar { border-radius: 99px; font-size: .65rem; font-weight: 700; }

/* =============================================================================
   APP FOOTER
   ============================================================================= */
.app-footer {
    padding: .875rem 1.5rem;
    border-top: 1px solid var(--border);
    background: white; text-align: center;
    font-size: .75rem; color: var(--slate-400);
}

/* =============================================================================
   AUTH LAYOUT — Premium Split Screen
   ============================================================================= */
.auth-wrapper { min-height: 100vh; display: flex; align-items: stretch; }

/* Left panel */
.auth-panel-left {
    flex: 1;
    background: var(--slate-950);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 3rem 3.5rem; color: white;
    position: relative; overflow: hidden;
}
/* Subtle gradient mesh */
.auth-panel-left::before {
    content: '';
    position: absolute; top: -30%; right: -20%;
    width: 700px; height: 700px; border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 60%);
    pointer-events: none;
}
.auth-panel-left::after {
    content: '';
    position: absolute; bottom: -20%; left: -15%;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.1) 0%, transparent 60%);
    pointer-events: none;
}
/* Subtle grid overlay */
.auth-panel-left .auth-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.auth-panel-left-inner { position: relative; z-index: 1; max-width: 460px; width: 100%; }

.auth-brand {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 4rem;
}
.auth-brand-icon {
    width: 50px; height: 50px;
    background: linear-gradient(135deg, rgba(59,130,246,.4), rgba(37,99,235,.3));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: var(--blue-300);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(37,99,235,.25);
}
.auth-brand-name {
    font-size: 1.25rem; font-weight: 800;
    letter-spacing: -.025em; color: white;
}
.auth-brand-sub  { font-size: .7rem; color: rgba(255,255,255,.4); margin-top: 1px; letter-spacing: .05em; text-transform: uppercase; }

.auth-tagline {
    font-size: 2rem; font-weight: 800; line-height: 1.2;
    margin-bottom: 1rem; letter-spacing: -.035em; color: white;
}
.auth-tagline span { color: var(--blue-400); }

.auth-desc {
    color: rgba(255,255,255,.45); font-size: .875rem;
    line-height: 1.7; margin-bottom: 2.5rem;
}

.auth-features { list-style: none; padding: 0; margin: 0; }
.auth-features li {
    display: flex; align-items: center; gap: .75rem;
    margin-bottom: .75rem; font-size: .8375rem;
    color: rgba(255,255,255,.6);
}
.auth-features li .feat-icon {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    background: rgba(59,130,246,.2); border: 1px solid rgba(59,130,246,.3);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; color: var(--blue-300);
}

.auth-bottom {
    position: absolute; bottom: 1.75rem; left: 0; right: 0;
    text-align: center; font-size: .7rem; color: rgba(255,255,255,.2);
    z-index: 1;
}

/* Right panel (login form) */
.auth-panel-right {
    width: 480px; background: white;
    display: flex; align-items: center; justify-content: center;
    padding: 3rem 2.5rem;
}
.auth-form-wrap { width: 100%; max-width: 360px; }

/* Mini logo on right */
.auth-logo-mini { display: flex; align-items: center; gap: .75rem; margin-bottom: 2.25rem; }
.auth-logo-mini .logo-box {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: .95rem; color: white;
    box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.auth-logo-mini .logo-text-wrap .name { font-size: .9375rem; font-weight: 800; color: var(--slate-900); letter-spacing: -.02em; }
.auth-logo-mini .logo-text-wrap .sub  { font-size: .625rem; color: var(--slate-400); text-transform: uppercase; letter-spacing: .1em; }

.auth-title    { font-size: 1.5rem; font-weight: 800; color: var(--slate-900); margin-bottom: .3rem; letter-spacing: -.025em; }
.auth-subtitle { color: var(--slate-500); font-size: .8375rem; margin-bottom: 1.875rem; line-height: 1.5; }

.btn-auth { padding: .6875rem; font-size: var(--text-md); font-weight: 600; letter-spacing: -.01em; width: 100%; }

@media (max-width: 768px) {
    .auth-panel-left { display: none; }
    .auth-panel-right { width: 100%; }
}

/* =============================================================================
   EMPLOYEE PORTAL
   ============================================================================= */
.portal-welcome {
    background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 50%, var(--blue-500) 100%);
    border-radius: var(--radius-lg); padding: 1.875rem 2rem;
    color: white; position: relative; overflow: hidden;
    box-shadow: 0 6px 24px rgba(37,99,235,.3);
}
.portal-welcome::before {
    content: ''; position: absolute; right: -60px; top: -60px;
    width: 240px; height: 240px; border-radius: 50%;
    background: rgba(255,255,255,.07);
}
.portal-welcome::after {
    content: ''; position: absolute; right: 40px; bottom: -80px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,.05);
}
.portal-welcome-name { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.025em; }
.portal-welcome-sub  { color: rgba(255,255,255,.65); font-size: .825rem; margin-top: .25rem; }
.portal-welcome-inner { position: relative; z-index: 1; }

.portal-payroll-card {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: .875rem 1rem; transition: all var(--duration-md) var(--ease); background: white;
    display: flex; align-items: center; gap: 1rem;
    text-decoration: none; color: inherit;
}
.portal-payroll-card:hover {
    box-shadow: var(--shadow-md); transform: translateY(-1px);
    border-color: var(--blue-200); color: inherit; text-decoration: none;
}

/* =============================================================================
   GESTOR PANEL
   ============================================================================= */
.team-member-row {
    display: flex; align-items: center; gap: .875rem;
    padding: .625rem 0; border-bottom: 1px solid var(--slate-100);
}
.team-member-row:last-child { border-bottom: none; }

/* =============================================================================
   PAYROLL PREVIEW
   ============================================================================= */
.payroll-preview-header {
    background: linear-gradient(135deg, var(--slate-900), var(--slate-800));
    color: white; border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem; margin-bottom: 1.375rem;
}
.payroll-line {
    display: flex; justify-content: space-between; align-items: center;
    padding: .4375rem 0; font-size: var(--text-sm);
}
.payroll-line.subtotal {
    border-top: 1px solid var(--border); margin-top: .25rem;
    font-weight: 600; padding-top: .5rem;
}
.payroll-line.total-net {
    border-top: 2px solid var(--primary); margin-top: .5rem;
    font-size: 1.125rem; font-weight: 800; color: var(--primary); padding-top: .5rem;
}

/* =============================================================================
   DASHBOARD WIDGETS
   ============================================================================= */
/* Metric Big Number block */
.metric-block {
    padding: 1.25rem; background: white;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.metric-number {
    font-size: 2.5rem; font-weight: 800;
    color: var(--slate-900); letter-spacing: -.04em; line-height: 1;
}
.metric-label {
    font-size: .75rem; font-weight: 600; color: var(--slate-400);
    text-transform: uppercase; letter-spacing: .05em; margin-top: .375rem;
}

/* Chart card */
.chart-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.chart-card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.chart-card-body { padding: 1.25rem; }

/* Alert compact strip */
.alert-strip {
    display: flex; align-items: flex-start; gap: .625rem;
    padding: .625rem .875rem; border-radius: var(--radius-sm);
    font-size: var(--text-sm); font-weight: 500; margin-bottom: .5rem;
}
.alert-strip.warning { background: var(--warning-light); color: #92400e; border-left: 3px solid var(--warning); }
.alert-strip.danger  { background: var(--danger-light);  color: #991b1b; border-left: 3px solid var(--danger); }
.alert-strip.info    { background: var(--info-light);    color: #075985; border-left: 3px solid var(--info); }
.alert-strip.success { background: var(--success-light); color: #065f46; border-left: 3px solid var(--success); }

/* Birthday row */
.birthday-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .5625rem 0; border-bottom: 1px solid var(--slate-100);
}
.birthday-row:last-child { border-bottom: none; }

/* =============================================================================
   UTILITY HELPERS
   ============================================================================= */
.fw-500  { font-weight: 500; }
.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.fw-800  { font-weight: 800; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-md { font-size: var(--text-md); }
.text-xl { font-size: var(--text-xl); }

.text-primary-strong { color: var(--primary) !important; }
.bg-primary-soft { background: var(--blue-50) !important; color: var(--blue-700) !important; }
.bg-success-soft  { background: var(--success-light) !important; color: var(--success) !important; }
.bg-danger-soft   { background: var(--danger-light) !important;  color: var(--danger) !important; }
.bg-warning-soft  { background: var(--warning-light) !important; color: var(--warning) !important; }
.bg-info-soft     { background: var(--info-light) !important;    color: var(--info) !important; }
.bg-purple-soft   { background: var(--purple-light) !important;  color: var(--purple) !important; }

.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: .75rem !important; }
.gap-4 { gap: 1rem !important; }
.shadow-glow-primary { box-shadow: 0 4px 20px rgba(37,99,235,.2) !important; }
.border-primary { border-color: var(--primary) !important; }

/* Uppercase input */
.input-uppercase { text-transform: uppercase; }
.input-uppercase::placeholder { text-transform: none; }

/* Monospace value */
.mono { font-family: 'Courier New', monospace; letter-spacing: .03em; }

/* Divider with label */
.divider-text {
    display: flex; align-items: center; gap: .75rem;
    font-size: .7rem; font-weight: 600; color: var(--slate-400);
    text-transform: uppercase; letter-spacing: .07em; margin: 1.5rem 0;
}
.divider-text::before, .divider-text::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* =============================================================================
   HOVER ROW NAVIGATION
   ============================================================================= */
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--slate-50) !important; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 1199px) {
    .auth-panel-right { width: 420px; }
}
@media (max-width: 991px) {
    .content-wrapper { padding: 1.25rem 1.125rem 2rem; }
}
@media (max-width: 767px) {
    .page-title { font-size: 1.125rem; }
    .stat-value { font-size: 1.625rem; }
    .topbar { padding: 0 1rem; }
    .filter-card .row > [class*="col-"] { margin-bottom: .5rem; }
    .table-actions { justify-content: flex-start; }
    .card-body { padding: 1rem; }
    .auth-panel-right { padding: 2rem 1.5rem; }
}
@media (max-width: 479px) {
    .content-wrapper { padding: .875rem .75rem 2rem; }
    .stat-value { font-size: 1.375rem; }
}

/* =============================================================================
   HOVER STATES — Link rows inside cards
   ============================================================================= */
.hover-bg-gray:hover { background: var(--slate-50) !important; }
.team-member-row:hover { background: var(--slate-50); }
.birthday-row:hover { background: var(--slate-50); }

/* =============================================================================
   FOCUS VISIBLE — Accessibility
   ============================================================================= */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* =============================================================================
   FORM CHECK — custom checkbox & radio
   ============================================================================= */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-check-input:focus {
    box-shadow: var(--shadow-glow-primary);
    border-color: var(--primary);
}
.form-check-label { font-size: var(--text-sm); }

/* =============================================================================
   INPUT GROUP — remove double borders
   ============================================================================= */
.input-group .input-group-text {
    border-color: var(--slate-200);
}
.input-group .form-control:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}
.input-group .form-control:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.input-group .form-control:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
.input-group .input-group-text:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.input-group .input-group-text:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

/* =============================================================================
   CARD hover for tables (companies/employees index)
   ============================================================================= */
.card .table tbody tr:hover td { background: var(--slate-50) !important; }

/* =============================================================================
   BUTTON FOCUS
   ============================================================================= */
.btn:focus-visible {
    box-shadow: var(--shadow-glow-primary) !important;
    outline: none;
}

/* =============================================================================
   BADGE — ensure correct display when inline
   ============================================================================= */
span.badge { display: inline-flex; align-items: center; }

/* =============================================================================
   AUTH PAGE — input group left/right borders
   ============================================================================= */
.auth-form-wrap .input-group .form-control {
    border-left-color: transparent;
    border-right-color: transparent;
}
.auth-form-wrap .input-group .input-group-text {
    background: white;
    border-color: var(--slate-200);
}
.auth-form-wrap .input-group:focus-within .input-group-text {
    border-color: var(--primary);
}
.auth-form-wrap .input-group:focus-within .form-control {
    border-color: var(--primary);
    box-shadow: none;
}
.auth-form-wrap .input-group:focus-within {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-glow-primary);
}
/* Remove individual focus glow inside input-group */
.auth-form-wrap .input-group .form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

/* =============================================================================
   SIDEBAR — section label hidden when collapsed
   ============================================================================= */
.sidebar-collapsed .sidebar .sidebar-section-label { display: none !important; }

/* =============================================================================
   DARK MODE — Overrides when data-bs-theme="dark"
   ============================================================================= */
[data-bs-theme="dark"] body.zerionix-body {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .card {
    background: var(--bs-card-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .topbar {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .breadcrumb-wrapper {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .page-title,
[data-bs-theme="dark"] .page-subtitle {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .topbar-title {
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] .x-dropdown {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

/* =============================================================================
   PRINT
   ============================================================================= */
@media print {
    .sidebar, .topbar, .breadcrumb-wrapper, .app-footer,
    .btn, .filter-card, .table-actions { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    .content-wrapper { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
