<?php
/**
 * Estilos CSS compartilhados para o layout do dashboard
 * VERSÃO 2.0 - COM DESIGN SYSTEM UNIFICADO (Card, Modal, Filtros)
 * Incluir com: <?php include __DIR__ . '/../includes/dashboard-styles.php'; ?>
 */
?>
<style>
/* ============================================
   VARIÁVEIS DE TEMA & ESTRUTURA
   ============================================ */

/* Tema Claro (PADRÃO) */
:root, [data-theme="light"] {
    /* --- CORES TEMA CLARO --- */
    --primary: #B8941F;
    --primary-2: rgba(184, 148, 31, 0.2);
    --primary-light: #B8941F15;
    --primary-rgb: 184, 148, 31;
    --bg-dark: #F5F5F7;
    --bg-darker: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8F9FA;
    --bg-preview-logo: #00000014;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --success: #16A34A;
    --warning: #D97706;
    --error: #DC2626;
    --info: #2563EB;
    --border: rgba(0,0,0,0.08);

    /* --- SOMBRAS --- */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 16px rgba(184, 148, 31, 0.3);

    /* --- ESTRUTURA SYSTEM --- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --control-height: 44px;
    --sidebar-width: 260px;
}

/* Tema Escuro */
[data-theme="dark"] {
    --primary: #CCA43B;
    --primary-2: rgba(204, 163, 59, 0.2);
    --primary-light: #CCA43B20;
    --primary-rgb: 204, 164, 59;
    --bg-dark: #0A0A0A;
    --bg-darker: #050505;
    --bg-card: #151515;
    --bg-card-hover: #1A1A1A;
    --bg-preview-logo: #535353ff;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #707070;
    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    --border: rgba(255,255,255,0.1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
    --shadow-primary: 0 4px 16px rgba(211, 166, 52, 0.7);
}

/* Tema Auto - segue preferência do sistema */
@media (prefers-color-scheme: light) {
    [data-theme="auto"] {
        --primary: #B8941F;
        --primary-2: rgba(184, 148, 31, 0.2);
        --primary-light: #B8941F15;
        --primary-rgb: 184, 148, 31;
        --bg-dark: #F5F5F7;
        --bg-darker: #FFFFFF;
        --bg-card: #FFFFFF;
        --bg-card-hover: #F8F9FA;
        --text-primary: #1A1A1A;
        --text-secondary: #6B7280;
        --text-muted: #9CA3AF;
        --success: #16A34A;
        --warning: #D97706;
        --error: #DC2626;
        --info: #2563EB;
        --border: rgba(0,0,0,0.08);
        --shadow: 0 4px 12px rgba(0,0,0,0.05);
        --shadow-lg: 0 20px 50px rgba(0,0,0,0.1);
    }
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --primary: #CCA43B;
        --primary-2: rgba(204, 163, 59, 0.2);
        --primary-light: #CCA43B20;
        --primary-rgb: 204, 164, 59;
        --bg-dark: #0A0A0A;
        --bg-darker: #050505;
        --bg-card: #151515;
        --bg-card-hover: #1A1A1A;
        --text-primary: #FFFFFF;
        --text-secondary: #B0B0B0;
        --text-muted: #707070;
        --success: #22C55E;
        --warning: #F59E0B;
        --error: #EF4444;
        --info: #3B82F6;
        --border: rgba(255,255,255,0.1);
        --shadow: 0 4px 12px rgba(0,0,0,0.3);
        --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
    }
}


/* ============================================
   ESTILOS BASE
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-dark); 
    color: var(--text-primary); 
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

.dashboard-layout { display: flex; min-height: 100vh; }

/* ============================================
   COMPONENTES ESTRUTURAIS (Cards, Modals, Filters)
   Aqui está a solução para a inconsistência
   ============================================ */

/* 1. Classe Base para Containers (Card e Filter) */
.card, 
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); /* Unificado 16px */
    padding: var(--spacing-md);      /* Unificado 1.5rem */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* 2. Filtros Específicos */
.filter-card {
    display: flex;
    align-items: end; /* Alinha inputs e botões na base */
    gap: 1rem;
    flex-wrap: wrap;
}

/* 3. Modal Unificado (Forçando estilo do Card) */
.modal-content {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important; /* Mesmo do Card */
    box-shadow: var(--shadow-lg) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md);
}

.modal-body {
    padding: var(--spacing-md);
    color: var(--text-secondary);
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: var(--spacing-sm) var(--spacing-md);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 4. Títulos Unificados */
.card-title, .filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    width: 100%;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ============================================
   CONTROLES DE FORMULÁRIO E BOTÕES
   (Alinhamento perfeito)
   ============================================ */

.btn, 
.form-input, 
.form-select,
.theme-switcher {
    height: var(--control-height); /* Força 44px em tudo */
    border-radius: var(--radius-md); /* Unificado 8px */
    font-size: 0.9rem;
}

/* Inputs */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0 1rem; /* Padding lateral */
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-textarea {
    height: auto;
    padding: 0.75rem 1rem;
    min-height: 100px;
}

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

.form-input::placeholder { color: var(--text-muted); }

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #FFD700);
    color: #000;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.btn-sm {
    height: 36px; /* Botão pequeno */
    padding: 0 1rem;
    font-size: 0.85rem;
}

/* ============================================
   SIDEBAR & NAV
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 1.25rem; font-weight: 800;
    color: var(--text-primary); text-decoration: none;
}
.sidebar-logo iconify-icon { color: var(--primary); font-size: 1.5rem; }

.business-badge {
    display: inline-block;
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em;
    background: var(--primary-light); color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem; font-weight: 600;
}

.sidebar-action { padding: 1rem 1.5rem; }

.btn-primary-action {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #FFD700 100%);
    color: #000; border: none;
    border-radius: var(--radius-md); /* Unificado 8px */
    font-weight: 700; font-size: 0.9rem; text-decoration: none;
    cursor: pointer; transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}
.btn-primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.sidebar-nav {
    flex: 1; padding: 1rem;
    overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--primary) transparent;
}
/* Scrollbar bonita */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: var(--primary); opacity: 0.5; }

.nav-section { margin-bottom: 1.5rem; }
.nav-section-title {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted); padding: 0.5rem 0.75rem; margin-bottom: 0.5rem;
}

.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary); text-decoration: none;
    transition: all 0.2s; margin-bottom: 0.25rem;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item iconify-icon { font-size: 1.25rem; }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); }

/* User & Store Menu */
.store-preview-link {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--primary-light); color: var(--primary);
    text-decoration: none; font-weight: 500; font-size: 0.9rem; transition: all 0.2s;
}
.store-preview-link:hover { background: var(--primary); color: #000; }

.user-menu {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem;
    border-radius: var(--radius-md); transition: background 0.2s;
}
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #000; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.logout-btn {
    color: var(--text-muted); padding: 0.5rem; border-radius: var(--radius-sm);
    transition: all 0.2s; display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.logout-btn:hover { color: var(--error); background: rgba(239, 68, 68, 0.1); }

/* ============================================
   THEME SWITCHER & HEADER
   ============================================ */
.header-actions {
    position: fixed; top: 1rem; right: 1.5rem; z-index: 150;
    display: flex; align-items: center; gap: 0.75rem;
}

.theme-switcher {
    display: flex; align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md); /* Unificado 8px */
    padding: 4px; gap: 4px;
    height: auto; /* Exceção: switcher ajusta ao conteúdo */
}

.theme-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 6px; /* Ligeiramente menor para caber dentro */
    border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.theme-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.theme-btn.active { background: var(--primary); color: #000; }

/* ============================================
   MAIN CONTENT & STATS
   ============================================ */
.main-content {
    flex: 1; margin-left: var(--sidebar-width);
    padding: 2rem; padding-top: 4.5rem;
    min-height: 100vh; transition: background-color 0.3s ease;
}

.page-header { margin-bottom: 2rem; }
.page-header h1 {
    font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem;
    display: flex; align-items: center; gap: 0.75rem;
}
.page-header h1 iconify-icon { color: var(--primary); }
.page-header p { color: var(--text-secondary); }

/* Stats Grid */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem; margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); /* Unificado */
    padding: var(--spacing-md);
    transition: all 0.3s;
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); }

.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.stat-icon iconify-icon { font-size: 1.5rem; }
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.info { background: rgba(59, 130, 246, 0.15); color: var(--info); }

.stat-value { font-size: 2rem; font-weight: 800; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.9rem; color: var(--text-muted); }

/* ============================================
   TABELAS
   ============================================ */
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 1rem; text-align: left; border-bottom: 1px solid var(--border);
}
.data-table th {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); font-weight: 600;
}
.data-table tr:hover td { background: var(--bg-card-hover); }

/* ============================================
   ALERTS & BADGES
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md); /* Unificado 8px */
    margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.75rem;
}
.alert iconify-icon { font-size: 1.25rem; }

.alert-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.3); color: #86EFAC; }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #FCA5A5; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #FCD34D; }
.alert-info { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: #93C5FD; }

/* Ajuste alerts tema claro */
[data-theme="light"] .alert-success { color: #166534; }
[data-theme="light"] .alert-error { color: #991B1B; }
[data-theme="light"] .alert-warning { color: #92400E; }
[data-theme="light"] .alert-info { color: #1E40AF; }

.badge {
    display: inline-flex; align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ============================================
   UTILITIES
   ============================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.empty-state {
    text-align: center; padding: 3rem 2rem; color: var(--text-muted);
}
.empty-state iconify-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--text-secondary); }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
/* Mobile Logo */
.mobile-logo {
    display: none; position: fixed; top: 0.8rem; left: 1rem; z-index: 200;
    height: 40px; padding: 0 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);border: 1px solid var(--border);
    color: var(--text-primary); align-items: center; justify-content: center;
    text-decoration: none; gap: 0.5rem; font-weight: 700; font-size: 1rem;
}
.mobile-logo iconify-icon { font-size: 1.25rem; color: var(--gold); }
.mobile-logo:hover { background: var(--bg-hover); }

.mobile-menu-toggle {
    display: none; position: fixed; top: 1rem; left: 1rem; z-index: 1001; transition: left 0.3s ease;
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-primary); align-items: center; justify-content: center; cursor: pointer;
}
.mobile-menu-toggle iconify-icon { font-size: 1.5rem; }

.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 99;
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); z-index: 1000; }
    .sidebar.open ~ .mobile-menu-toggle { left: calc(var(--sidebar-width) - 54px); }
    .main-content { margin-left: 0; }
    
    .sidebar-overlay.active { display: block; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .header-actions { right: 1rem; }
    .mobile-logo { display: flex; }
}


@media (max-width: 1024px) {
    .main-content { padding: 1.5rem 1rem; padding-top: 5rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1.5rem; }
    .header-actions { top: 0.75rem; right: 0.75rem; }
}


/* ============================================
   SISTEMA RESPONSIVO COMPLETO
   Breakpoints: 480px, 600px, 768px, 1024px, 1200px
   ============================================ */

/* --- Mobile Muito Pequeno (até 480px) --- */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .page-header h1 {
        font-size: 1.35rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0 1rem;
        font-size: 0.85rem;
        height: 40px;
    }
    
    .filter-bar,
    .filter-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar .search-box,
    .filter-card .search-box {
        max-width: 100%;
        width: 100%;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .card {
        padding: 1rem;
    }
}

/* --- Mobile Padrão (481px - 600px) --- */
@media (min-width: 481px) and (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .filter-bar .search-box {
        max-width: 100%;
    }
}

/* --- Mobile / Tablet Portrait: Cards (até 768px) --- */
@media (max-width: 1024px) {
    .desktop-table {
        display: none !important;
    }
    
    .mobile-cards {
        display: block;
    }
    
    .page-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header-flex .btn {
        width: 100%;
        justify-content: center;
    }
    
    .filter-bar {
        flex-wrap: wrap;
    }
}


/* --- Tablet Portrait (601px - 768px) --- */
@media (min-width: 601px) and (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-card {
        max-width: 100%;
    }
    
    .mobile-card-info {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .form-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-width: 90%;
        margin: 1rem auto;
    }
}

/* --- Tablet Landscape / Desktop: Tabela (769px+) --- */
@media (min-width: 769px) {
    
    .desktop-table {
        display: block;
    }
    
    .page-header-flex {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* --- Tablet Landscape (769px - 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.85rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .data-table th {
        font-size: 0.7rem;
    }
    
    /* Ocultar colunas menos importantes em tablets */
    .data-table .hide-tablet {
        display: none;
    }
    
    .actions-cell {
        gap: 0.35rem;
    }
    
    .actions-cell .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .filter-bar {
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .filter-bar .search-box {
        flex: 1;
        min-width: 200px;
        max-width: 350px;
    }
    
    .modal-content {
        max-width: 85%;
        margin: 2rem auto;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
}

/* --- Desktop Grande (1025px+) --- */
@media (min-width: 1025px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .data-table th,
    .data-table td {
        padding: 1rem 1.25rem;
    }
    
    /* Mostrar todas as colunas em desktop */
    .data-table .hide-tablet {
        display: table-cell;
    }
    
    .modal-content {
        max-width: 600px;
    }
    
    .filter-bar .search-box {
        max-width: 400px;
    }
}

/* --- Desktop Extra Grande (1200px+) --- */
@media (min-width: 1200px) {
    .main-content {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
        padding-left: calc(var(--sidebar-width) + 2rem);
    }
    
    .filter-bar .search-box {
        max-width: 500px;
    }
    
    .stats-grid {
        gap: 1.5rem;
    }
}

/* ============================================
   CLASSES UTILITÁRIAS RESPONSIVAS
   ============================================ */

/* Ocultar em diferentes tamanhos */
.hide-mobile { display: none; }
.hide-tablet-portrait { display: block; }
.hide-tablet-landscape { display: block; }
.hide-desktop { display: block; }

@media (min-width: 769px) {
    .hide-mobile { display: block; }
    .hide-desktop { display: none; }
}

@media (min-width: 601px) and (max-width: 768px) {
    .hide-tablet-portrait { display: none; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hide-tablet-landscape { display: none; }
}

/* Form Grid Responsivo */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Filter Bar Base */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar .search-box {
    flex: 1;
    min-width: 200px;
}

/* Page Header Flex */
.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Mobile Cards Base */
.mobile-cards {
    display: none;
}

.mobile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
}

.mobile-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.mobile-card-info {
    padding: 1rem;
}

.mobile-card-info-item {
    margin-bottom: 0.75rem;
}

.mobile-card-info-item:last-child {
    margin-bottom: 0;
}

.mobile-card-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.mobile-card-info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.mobile-card-info-value a {
    color: var(--primary);
    text-decoration: none;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card-hover);
}

/* Actions Cell */
.actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

/* ============================================
   Logo Theme Switching
   ============================================ */
img.logo-light {
    display: inline-block !important;
}

img.logo-dark {
    display: none !important;
}

[data-theme="dark"] img.logo-light {
    display: none !important;
}

[data-theme="dark"] img.logo-dark {
    display: inline-block !important;
}

[data-theme="light"] img.logo-light {
    display: inline-block !important;
}

[data-theme="light"] img.logo-dark {
    display: none !important;
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] img.logo-light {
        display: none !important;
    }
    [data-theme="auto"] img.logo-dark {
        display: inline-block !important;
    }
}

@media (prefers-color-scheme: light) {
    [data-theme="auto"] img.logo-light {
        display: inline-block !important;
    }
    [data-theme="auto"] img.logo-dark {
        display: none !important;
    }
}


/* ============================================
   PREMIUM LOCK SYSTEM
   ============================================ */

/* Container com conteúdo bloqueado */
.premium-locked {
    position: relative;
    min-height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* Conteúdo borrado no fundo */
.premium-locked .premium-content {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
    opacity: 0.6;
}

/* Overlay escuro */
.premium-locked .premium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 1rem;
}

/* Card de bloqueio */
.premium-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg, 16px);
    padding: 2rem;
    text-align: center;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: premiumCardIn 0.3s ease-out;
}

@keyframes premiumCardIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Ícone do card */
.premium-card-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #D4AF37, #F5D77A);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.premium-card-icon iconify-icon {
    font-size: 1.75rem;
    color: #fff;
}

/* Título */
.premium-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}

/* Descrição */
.premium-card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

/* Badge do plano requerido */
.premium-card-plan {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(245, 215, 122, 0.15));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50px;
    color: #D4AF37;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.premium-card-plan iconify-icon {
    font-size: 1rem;
}

/* Lista de features */
.premium-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    text-align: left;
}

.premium-card-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.premium-card-features li:last-child {
    border-bottom: none;
}

.premium-card-features iconify-icon {
    color: var(--success, #22C55E);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Botão de upgrade */
.btn-upgrade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #D4AF37, #C9A227);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
}

.btn-upgrade:hover {
    background: linear-gradient(135deg, #C9A227, #B8931F);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.btn-upgrade iconify-icon {
    font-size: 1.1rem;
}

/* Variante para página inteira */
.premium-page-lock {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.premium-page-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg, 16px);
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0,0,0,0.1));
}

.premium-page-card .premium-card-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.premium-page-card .premium-card-icon iconify-icon {
    font-size: 2.25rem;
}

.premium-page-card .premium-card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.premium-page-card .premium-card-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Variante pequena */
.premium-sm .premium-card {
    padding: 1.25rem;
    max-width: 300px;
}

.premium-sm .premium-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.premium-sm .premium-card-icon iconify-icon {
    font-size: 1.25rem;
}

.premium-sm .premium-card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.premium-sm .premium-card-description {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.premium-sm .premium-card-plan {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.premium-sm .btn-upgrade {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
}

/* Variante inline */
.premium-inline {
    display: inline-block;
    min-height: auto;
}

.premium-inline .premium-overlay {
    position: relative;
    background: none;
    padding: 0;
}

.premium-inline .premium-card {
    box-shadow: var(--shadow);
    max-width: none;
}

/* Variante para página inteira com blur */
/* Overlay apenas na área de conteúdo */
.premium-full {
    min-height: calc(100vh - 200px);
    position: relative;
}

.premium-full .premium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
}

/* Responsivo */
@media (max-width: 480px) {
    .premium-card {
        padding: 1.5rem;
    }
    
    .premium-card-icon {
        width: 56px;
        height: 56px;
    }
    
    .premium-card-title {
        font-size: 1.1rem;
    }
    
    .premium-page-card {
        padding: 2rem 1.5rem;
    }
}

/* Tablet (769px - 1024px): Mostrar hamburger */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-menu-toggle { display: flex !important; }
}

/* Mobile (768px ou menos): Ocultar hamburger e sidebar */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: none !important; }
    .sidebar { display: none !important; }
    .sidebar-overlay { display: none !important; }
}
</style>

<script>
// ============================================
// SIDEBAR TOGGLE (tema gerenciado pelo dashboard-header.php)
// ============================================
function toggleSidebar() {
    document.querySelector('.sidebar').classList.toggle('open');
    document.querySelector('.sidebar-overlay').classList.toggle('active');
}

document.addEventListener('DOMContentLoaded', function() {
    const overlay = document.querySelector('.sidebar-overlay');
    if (overlay) overlay.addEventListener('click', toggleSidebar);
});
</script>


