/* =====================================================
   Admin CRM - Academinho
   Design Minimalista e Reativo
   ===================================================== */

:root {
    --primary-color: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8C5A;
    --secondary-color: #4A90E2;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;
    --dark-bg: #1A1A1A;
    --dark-sidebar: #252525;
    --dark-hover: #2D2D2D;
    --light-bg: #F8F9FA;
    --border-color: #E0E0E0;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --text-light: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =====================================================
   Layout Principal
   ===================================================== */

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   Sidebar
   ===================================================== */

.admin-sidebar {
    width: 260px;
    background: var(--dark-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
}

.logo-icon {
    font-size: 24px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: var(--dark-hover);
    color: var(--text-light);
}

.nav-item.active {
    background: rgba(255,107,53,0.15);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.nav-icon {
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-icon-btn {
    /* Herda estilos do .nav-item */
    margin: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.footer-icon-btn:hover {
    background: var(--dark-hover);
}

/* =====================================================
   Sidebar - Modo Dashboard (sem rolagem independente)
   ===================================================== */

.admin-sidebar.dashboard-mode {
    overflow-y: auto;
}

.admin-sidebar.dashboard-mode .sidebar-nav {
    overflow-y: visible;
    flex: 1;
    overflow: visible;
}

/* =====================================================
   Sidebar - Modo Compacto (apenas ícones)
   ===================================================== */

.admin-sidebar.compact {
    width: 70px;
    overflow-y: auto;
    overflow-x: visible;
}

.admin-sidebar.compact .sidebar-nav {
    overflow-x: visible;
}

.admin-sidebar.compact .logo-text,
.admin-sidebar.compact .nav-text,
.admin-sidebar.compact .nav-section-title {
    display: none;
}

.admin-sidebar.compact .sidebar-header {
    padding: 20px 12px;
    justify-content: center;
}

.admin-sidebar.compact .logo {
    justify-content: center;
}

.admin-sidebar.compact .sidebar-toggle {
    display: none;
}

.admin-sidebar.compact .sidebar-nav {
    overflow-y: visible;
    flex: 1;
}

.admin-sidebar.compact .nav-item {
    padding: 12px;
    justify-content: center;
}

.admin-sidebar.compact .nav-divider {
    margin: 10px 12px;
}

.admin-sidebar.compact .sidebar-footer {
    padding: 20px 12px;
    position: relative;
    flex-shrink: 0;
}

.admin-sidebar.compact .sidebar-footer-actions {
    align-items: center;
}

.admin-sidebar.compact .footer-icon-btn {
    justify-content: center;
}

/* Desabilitar tooltips CSS no modo compacto - usar JavaScript em vez disso */
.admin-sidebar.compact [data-tooltip]:hover::after {
    display: none;
}

/* =====================================================
   Main Content
   ===================================================== */

.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.admin-main.sidebar-collapsed {
    margin-left: 0;
}

.admin-main.sidebar-compact {
    margin-left: 70px;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.admin-content {
    padding: 30px;
}

/* =====================================================
   Cards e Métricas
   ===================================================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-change {
    font-size: 12px;
    color: var(--success-color);
}

/* =====================================================
   Tabelas
   ===================================================== */

.data-table {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--light-bg);
}

th {
    padding: 12px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

tbody tr:hover {
    background: var(--light-bg);
}

/* =====================================================
   Botões
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-icon {
    padding: 8px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

/* =====================================================
   Lightbox/Modal
   ===================================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lightbox-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lightbox-title {
    font-size: 20px;
    font-weight: 600;
}

.lightbox-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: var(--light-bg);
    color: var(--text-primary);
}

.lightbox-body {
    padding: 24px;
}

/* =====================================================
   Formulários
   ===================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

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

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

/* =====================================================
   Status Badges
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #D4EDDA;
    color: #155724;
}

.badge-warning {
    background: #FFF3CD;
    color: #856404;
}

.badge-danger {
    background: #F8D7DA;
    color: #721C24;
}

.badge-info {
    background: #D1ECF1;
    color: #0C5460;
}

.badge-primary {
    background: rgba(255,107,53,0.1);
    color: var(--primary-color);
}

/* =====================================================
   Tooltips
   ===================================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--dark-bg);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    pointer-events: none;
}

/* =====================================================
   Responsividade
   ===================================================== */

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Utilitários
   ===================================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
