/* 
 * SISBAR - Design System Hub (Versão 2.0 - Premium)
 * Focado em estética Glassmorphism, Fluid UI e UX Moderna.
 */

:root {
    /* Color Palette - Indigo & Slate */
    --primary-h: 239;
    --primary-s: 84%;
    --primary-l: 67%;
    
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 5%));
    --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);
    --primary-soft: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    
    --secondary: #8b5cf6;
    
    /* Sidebar Dark Theme - New */
    --sidebar-bg: #0f172a; /* Slate 900 */
    --sidebar-text: #94a3b8; /* Slate 400 */
    --sidebar-text-hover: #f1f5f9; /* Slate 100 */
    --sidebar-active-bg: var(--primary);
    --sidebar-active-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    
    /* Neutral Colors - Slate 2.0 (Professional) */
    --canvas: #f1f5f9; /* Slate 100 - Clean Background */
    --surface: #ffffff; /* pure white for cards */
    --surface-glass: rgba(255, 255, 255, 0.9);
    
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --text-light: #94a3b8; /* Slate 400 */
    
    /* Semantic Colors - High Contrast */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Borders & Dividers */
    --border-light: #e2e8f0;
    --border-strong: #cbd5e1;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Shadows - Layered */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--canvas);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Utilities - More Subtle */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Layout System */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: var(--canvas);
    align-items: stretch;
}

/* Sidebar Modernized - Premium Dark */
.sidebar {
    width: 270px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    transition: var(--transition-base);
    color: var(--sidebar-text);
    overflow-y: auto;
}

.sidebar-header {
    padding: var(--space-lg) var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    width: 100%;
}

.sidebar-brand--logo-only {
    justify-content: center;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Ícone padrão quando não há logo customizada — maior e centralizado */
.brand-icon.brand-icon--solo {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    font-size: 1.65rem;
    border-radius: 16px;
}

.brand-icon.brand-icon--logo {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 16px;
    padding: 8px;
    box-sizing: border-box;
}

.sidebar-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    letter-spacing: -0.02em;
}

.brand-text small {
    font-size: 0.625rem;
    color: var(--primary);
    display: block;
    margin-top: -4px;
    letter-spacing: 0.1em;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.menu-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: var(--space-md) var(--space-md) var(--space-xs);
    margin-top: var(--space-sm);
}

.menu-list {
    list-style: none;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    margin-bottom: 2px;
    list-style: none;
}

.menu-item::marker {
    content: none;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem var(--space-md);
    text-decoration: none;
    color: var(--sidebar-text);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(4px);
}

.menu-link.active {
    background: var(--sidebar-active-bg);
    color: white;
    box-shadow: var(--sidebar-active-shadow);
    font-weight: 600;
}

.menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

.active .menu-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-avatar-premium {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.user-info-text {
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--sidebar-text);
    margin: 0;
    opacity: 0.7;
}

.logout-action {
    color: var(--text-light);
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.logout-action:hover {
    color: var(--danger);
}

/* Botão recolher menu: só desktop | ☰ só mobile */
@media (min-width: 1025px) {
    .sisbar-mobile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .sisbar-sidebar-toggle-desktop {
        display: none !important;
    }
}

/* Menu lateral retrátil (preferência do usuário) */
.dashboard-layout.sidebar-collapsed .sidebar {
    width: 82px;
}

.dashboard-layout.sidebar-collapsed .main-wrapper {
    margin-left: 82px;
}

.dashboard-layout.sidebar-collapsed .menu-group-label {
    display: none;
}

.dashboard-layout.sidebar-collapsed .menu-link span {
    display: none;
}

.dashboard-layout.sidebar-collapsed .menu-link {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    position: relative;
}

.dashboard-layout.sidebar-collapsed .menu-link:hover {
    transform: none;
}

/* Legenda do menu recolhido: elemento fixo no body (#sisbarSidebarTooltip), ver main.js */
.sisbar-sidebar-tooltip {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    max-width: 280px;
    padding: 8px 12px;
    background: #0f172a;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.35);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, visibility 0.12s ease;
}

.sisbar-sidebar-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

.dashboard-layout.sidebar-collapsed .user-info-text {
    display: none;
}

.dashboard-layout.sidebar-collapsed .user-profile {
    justify-content: center;
}

.dashboard-layout.sidebar-collapsed .sidebar-footer {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
}

.dashboard-layout.sidebar-collapsed .brand-icon--logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 4px;
}

.dashboard-layout.sidebar-collapsed .brand-icon--solo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.2rem;
}

/* Top Header */
.top-header-premium {
    height: 70px;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--border-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.breadcrumb .separator {
    font-size: 0.75rem;
    color: var(--text-light);
}

.breadcrumb .current {
    color: var(--text-main);
    font-weight: 600;
}

.btn-icon-modern {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.btn-icon-modern:hover {
    background: var(--primary-soft);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-date-badge {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 270px;
    background: var(--canvas);
}

.main-content {
    padding: var(--space-xl);
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }

/* Buttons Premium */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

.btn-outline {
    background: white;
    border: 1.5px solid var(--border-light);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-success-soft { background: #d1fae5; color: #065f46; }
.btn-success-soft:hover { background: #10b981; color: white; }

.btn-danger-soft { background: #fee2e2; color: #991b1b; }
.btn-danger-soft:hover { background: #ef4444; color: white; }

.btn-warning-soft { background: #fef3c7; color: #92400e; }
.btn-warning-soft:hover { background: #f59e0b; color: white; }

.btn-info-soft { background: #dbeafe; color: #1e40af; }
.btn-info-soft:hover { background: #3b82f6; color: white; }

/* Form Controls */
.form-control-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: var(--transition-base);
    background: white;
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: var(--border-strong); 
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* Animation Utils */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-up {
    animation: slideUp 0.4s ease-out forwards;
}
/* Premium Table */
.premium-table-wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.premium-table th {
    background: var(--canvas);
    padding: 1rem var(--space-md);
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-light);
}

.premium-table td {
    padding: 1rem var(--space-md);
    border-bottom: 1px solid var(--canvas);
    color: var(--text-main);
    transition: var(--transition-fast);
}

.premium-table tr:hover td {
    background-color: #f8fafc; /* subtle slate hover */
}

.premium-table tr:last-child td {
    border-bottom: none;
}

/* Table Action Buttons */
.table-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    justify-content: center;
}

.btn-table-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.8125rem;
}

.btn-table-action:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: transparent;
}

.btn-table-action.btn-danger-soft:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* ================================================
   LEGACY CLASS ALIASES — Premium Unification
   Makes ALL old classes use the premium design.
   ================================================ */

/* data-table → premium-table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table th {
    background: var(--canvas);
    padding: 1rem var(--space-md);
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-light);
}

.data-table td {
    padding: 1rem var(--space-md);
    border-bottom: 1px solid var(--canvas);
    color: var(--text-main);
    transition: var(--transition-fast);
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* table-card → premium-table-wrapper */
.table-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.table-card > .card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.table-card > .card-header h3,
.table-card > .card-header .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-card > .card-header h3 i,
.table-card > .card-header .card-title i {
    color: var(--primary);
}

.table-card > .card-body {
    padding: 0;
}

/* Legacy badges → premium badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    gap: 0.375rem;
}

.badge-success,
.badge.badge-success { background: #d1fae5; color: #065f46; }

.badge-warning,
.badge.badge-warning { background: #fef3c7; color: #92400e; }

.badge-danger,
.badge.badge-danger { background: #fee2e2; color: #991b1b; }

.badge-info,
.badge.badge-info { background: #dbeafe; color: #1e40af; }

.badge-primary,
.badge.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* Status badges (comissoes, etc.) */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    gap: 0.375rem;
}

.status-badge.pendente { background: #fef3c7; color: #92400e; }
.status-badge.paga { background: #d1fae5; color: #065f46; }
.status-badge.cancelada { background: #fee2e2; color: #991b1b; }

/* Legacy action buttons → premium action buttons */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.8125rem;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: transparent;
}

/* btn-icon color variants — visible by default, not just on hover */
.btn-icon.btn-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #dbeafe;
}
.btn-icon.btn-info:hover {
    background: #3b82f6;
    color: white;
}

.btn-icon.btn-primary {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-soft);
}
.btn-icon.btn-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-icon.btn-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #d1fae5;
}
.btn-icon.btn-success:hover {
    background: #10b981;
    color: white;
}

.btn-icon.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fee2e2;
}
.btn-icon.btn-danger:hover {
    background: #ef4444;
    color: white;
}

.btn-icon.btn-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fef3c7;
}
.btn-icon.btn-warning:hover {
    background: #f59e0b;
    color: white;
}

.btn-icon.btn-edit { background: #dbeafe; color: #1e40af; border-color: #dbeafe; }
.btn-icon.btn-edit:hover { background: #3b82f6; color: white; }
.btn-icon.btn-delete { background: #fee2e2; color: #991b1b; border-color: #fee2e2; }
.btn-icon.btn-delete:hover { background: #ef4444; color: white; }
.btn-icon.btn-comissoes { background: #ede9fe; color: #7c3aed; border-color: #ede9fe; }
.btn-icon.btn-comissoes:hover { background: #7c3aed; color: white; }
.btn-icon.btn-contas { background: #d1fae5; color: #065f46; border-color: #d1fae5; }
.btn-icon.btn-contas:hover { background: #10b981; color: white; }

/* card-modern → premium-table-wrapper (used in caixa.php) */
.card-modern {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.card-header-modern {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.card-header-modern .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header-modern .card-title i {
    color: var(--primary);
}

/* badge-secondary */
.badge-secondary,
.badge.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--space-lg);
}

.pagination-wrapper .btn-modern {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.pagination-wrapper .btn-modern:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: transparent;
}

/* Legacy card styles (used by comissoes/creditos/contas_receber) */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card > .card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}

.card > .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card > .card-header h3 i {
    color: var(--primary);
}

.card > .card-body {
    padding: var(--space-lg);
}

/* Legacy form-card (used by usuarios.php) */
.form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.form-card > .card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-card > .card-header .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-card > .card-header .card-title i {
    color: var(--primary);
}

.form-card > .card-body {
    padding: var(--space-lg);
}

/* Wrapper unification (comissoes, contas_receber, creditos) */
.comissoes-wrapper,
.contas-receber-wrapper,
.usuarios-wrapper {
    background: transparent;
}

.comissoes-container,
.contas-receber-container,
.usuarios-container {
    max-width: 100%;
}

/* Comissoes table wrapper → premium-table-wrapper */
.comissoes-table-wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.comissoes-table-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comissoes-table-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comissoes-table-header h3 i {
    color: var(--primary);
}

.btn-export {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    background: var(--canvas);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--transition-fast);
}

.btn-export:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: transparent;
}

/* Comissao action button */
.btn-action {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--transition-fast);
}

.btn-action-success {
    background: #d1fae5;
    color: #065f46;
}

.btn-action-success:hover {
    background: #10b981;
    color: white;
}

/* Page header section (usuarios/creditos/contas) - premium override */
.page-header-section {
    margin-bottom: var(--space-xl);
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.page-header-content .page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header-content .page-title i {
    color: var(--primary);
}

/* Premium alerts */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-sucesso {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-erro {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Empty states */
.empty-state,
.empty-state-comissao {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i,
.empty-state-comissao i {
    font-size: 3rem;
    color: var(--border-strong);
    margin-bottom: var(--space-md);
    display: block;
}

.empty-state p,
.empty-state-comissao h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
}

.empty-state-comissao p {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Table-itens (used in modals) */
.table-itens {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-itens th {
    background: var(--canvas);
    padding: 0.75rem var(--space-md);
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-light);
}

.table-itens td {
    padding: 0.75rem var(--space-md);
    border-bottom: 1px solid var(--canvas);
    color: var(--text-main);
}

/* ================================================
   LEGACY STAT CARDS — Premium Unification
   Makes ALL old card classes use the premium design.
   ================================================ */

/* stats-cards (comissoes, creditos, contas_receber) → stats-grid */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* stat-card-comissao → stat-card */
.stat-card-comissao {
    background: var(--surface);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card-comissao:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

/* stat-icon-comissao → stat-card-icon */
.stat-icon-comissao {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon-comissao.total { background: var(--primary-soft); color: var(--primary); }
.stat-icon-comissao.pendente { background: #fffbeb; color: #f59e0b; }
.stat-icon-comissao.paga { background: #ecfdf5; color: #10b981; }
.stat-icon-comissao.receber { background: #eff6ff; color: #3b82f6; }

/* stat-content-comissao → stat-card-info */
.stat-content-comissao {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value-comissao {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label-comissao {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* metrics-grid (vendas) → stats-grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* stat-box (vendas) — scoped to .metrics-grid to avoid conflict with caixa.css */
.metrics-grid > .stat-box {
    background: var(--surface);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.metrics-grid > .stat-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

.stat-box-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-box-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-box-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-top: 0.25rem;
}

.stat-box-sub {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Resumo usuario cards (comissoes, contas_receber, creditos) */
.resumo-usuarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.resumo-usuario-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    transition: var(--transition-base);
}

.resumo-usuario-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

.resumo-usuario-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.resumo-usuario-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    flex-shrink: 0;
}

.resumo-usuario-info {
    flex: 1;
    min-width: 0;
}

.resumo-usuario-nome {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resumo-usuario-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.resumo-usuario-valores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--canvas);
    border-radius: var(--radius-md);
}

.resumo-valor-item {
    text-align: center;
    padding: 0.5rem;
}

.resumo-valor-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.resumo-valor-amount {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.resumo-valor-item.pendente .resumo-valor-amount { color: #f59e0b; }
.resumo-valor-item.paga .resumo-valor-amount { color: #10b981; }
.resumo-valor-item.deve .resumo-valor-amount { color: #ef4444; }
.resumo-valor-item.receber .resumo-valor-amount { color: #3b82f6; }
.resumo-valor-item.total .resumo-valor-amount { color: var(--primary); }
.resumo-valor-item.credito .resumo-valor-amount { color: #8b5cf6; }

.resumo-usuario-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Filter sections */
.relatorios-filters {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    align-items: end;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.filter-group .form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition-base);
    background: white;
}

.filter-group .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

/* Tabs (contas_receber) */
.tabs-container {
    margin-bottom: var(--space-lg);
}

.tabs-header {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-base);
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-soft);
    font-weight: 700;
}

/* Detalhes comissao modal internals */
.detalhes-comissao-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.detalhes-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
}

.resumo-item {
    background: var(--canvas);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.resumo-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.resumo-value {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-main);
}

.resumo-value.pendente { color: #f59e0b; }
.resumo-value.paga { color: #10b981; }
.resumo-value.deve { color: #ef4444; }
.resumo-value.receber { color: #3b82f6; }

.detalhes-tabela {
    overflow-x: auto;
}

/* Trend indicators */
.stat-card-trend.trend-up { color: #10b981; }
.stat-card-trend.trend-down { color: #ef4444; }
.stat-card-trend.trend-neutral { color: var(--text-muted); }

/* Form grid and actions (for forms inside cards) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition-base);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
}

/* Button base styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.39);
}

.btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

.btn.btn-secondary {
    background: var(--canvas);
    color: var(--text-main);
    border: 1.5px solid var(--border-light);
}

.btn.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn.btn-info {
    background: #dbeafe;
    color: #1e40af;
}

.btn.btn-info:hover {
    background: #3b82f6;
    color: white;
}

.btn.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn.disabled,
.btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-close:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* Modal legacy (comissoes, contas_receber, creditos) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.modal-content.modal-detalhes-comissao {
    max-width: 900px;
}

.modal-header {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* Detalhes conta (contas_receber modal) */
.detalhes-conta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.detalhes-conta-tipo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.875rem;
}

.detalhes-conta-tipo.tipo-venda { background: #dbeafe; color: #1e40af; }
.detalhes-conta-tipo.tipo-conta { background: #fef3c7; color: #92400e; }

.detalhes-conta-id {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.detalhes-conta-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.detalhes-conta-info-grid .info-item {
    padding: var(--space-md);
    background: var(--canvas);
    border-radius: var(--radius-md);
}

.detalhes-conta-info-grid .info-item label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.detalhes-conta-info-grid .info-item span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.detalhes-conta-info-grid .valor-total {
    color: var(--primary) !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
}

.detalhes-conta-descricao {
    margin-bottom: var(--space-lg);
}

.detalhes-conta-descricao label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.descricao-content {
    padding: var(--space-md);
    background: var(--canvas);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-main);
    line-height: 1.6;
}

.detalhes-conta-itens h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 var(--space-md) 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detalhes-conta-itens h4 i {
    color: var(--primary);
}

.detalhes-conta-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
}

/* Text alignment helpers */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-xs { font-size: 0.75rem; }

/* Badges Premium */
.badge-premium {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    gap: 0.375rem;
}

.badge-premium-success { background: #d1fae5; color: #065f46; }
.badge-premium-warning { background: #fef3c7; color: #92400e; }
.badge-premium-danger { background: #fee2e2; color: #991b1b; }
.badge-premium-info { background: #dbeafe; color: #1e40af; }
.badge-premium-primary { background: var(--primary-soft); color: var(--primary); }

/* Modals Premium */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active { display: flex; }
.modal-overlay.active .modal-card { transform: translateY(0); }

/* Dialog padrão do sistema (avisos/confirmações) */
.sisbar-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1000001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sisbar-dialog-overlay.active {
    display: flex;
}

.sisbar-dialog-card {
    width: min(520px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.sisbar-dialog-header {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.sisbar-dialog-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sisbar-dialog-icon {
    font-size: 1.1rem;
    color: #fff;
}

.sisbar-dialog-title {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
}

.sisbar-dialog-body {
    padding: var(--space-lg);
    color: var(--text-main);
    line-height: 1.6;
    white-space: pre-line;
}

.sisbar-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: 0 var(--space-lg) var(--space-lg);
}

.sisbar-dialog-btn-cancel {
    background: var(--canvas);
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.sisbar-dialog-overlay.is-error .sisbar-dialog-header {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.sisbar-dialog-overlay.is-success .sisbar-dialog-header {
    background: linear-gradient(135deg, #059669, #047857);
}

.sisbar-dialog-overlay.is-info .sisbar-dialog-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.sisbar-dialog-overlay.is-confirm .sisbar-dialog-header {
    background: linear-gradient(135deg, #0f172a, #334155);
}

.modal-header-premium {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body-premium {
    padding: var(--space-lg);
    overflow-y: auto;
}

/* Unified Stats Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--surface);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-icon.success { background: #ecfdf5; color: #10b981; }
.stat-card-icon.warning { background: #fffbeb; color: #f59e0b; }
.stat-card-icon.danger { background: #fef2f2; color: #ef4444; }
.stat-card-icon.info { background: #eff6ff; color: #3b82f6; }

.stat-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-card-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Page Header & Actions */
.page-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.page-title-group h1 {
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: -0.03em;
}

.page-title-group p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
}

.page-actions-group {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

/* Card Header */
.card-header-premium {
    padding: var(--space-lg);
    background: var(--canvas);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-premium h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Main Footer Modern */
.main-footer {
    padding: var(--space-xl) 0;
    margin-top: auto;
    border-top: 1px solid var(--border-light);
    text-align: center;
    background: var(--canvas);
}

.footer-container p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Responsive Design - Sidebar & Layout */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100vh;
        z-index: 2000;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .top-header-premium {
        padding: 0 var(--space-md);
    }

    .breadcrumb {
        display: none;
    }

    .page-header-premium {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .page-actions-group {
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1500;
}

.sidebar-overlay.active {
    display: block;
}

/* Hidden Utility */
.hidden { display: none !important; }
