/**
 * Citavial Dashboard - Estilos principales
 * Diseño minimalista inspirado en Apple Design System
 */

/* ============================================================================
   VARIABLES Y RESET
   ============================================================================ */

:root {
    /* Colores principales - Paleta CIVI */
    --primary: #10b981; /* Verde Esmeralda CIVI */
    --primary-dark: #059669;
    --primary-light: #34d399;
    
    --secondary: #87CEEB; /* Azul Cielo CIVI */
    --accent: #7c3aed; /* Morado CIVI */
    
    /* Colores de estado */
    --success: #10b981;
    --warning: #fbbf24;
    --error: #ef4444;
    --info: #2563eb;
    
    /* Grises */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Colores de texto */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    /* Fondos */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    /* Bordes - Más redondeados estilo CIVI */
    --border-color: #e5e7eb;
    --border-radius: 20px; /* Más generoso */
    --border-radius-sm: 16px; /* Nunca menos de 16px */
    --border-radius-lg: 24px;
    
    /* Sombras Claymorphism */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: -4px -4px 12px rgba(255, 255, 255, 0.5), 4px 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: -6px -6px 16px rgba(255, 255, 255, 0.5), 6px 6px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: -8px -8px 16px rgba(255, 255, 255, 0.5), 8px 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: -12px -12px 24px rgba(255, 255, 255, 0.6), 12px 12px 24px rgba(0, 0, 0, 0.12);
    
    /* Transiciones suaves y orgánicas */
    --transition: all 0.3s ease;
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Tipografía CIVI - Inter */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: linear-gradient(135deg, 
        var(--gray-200) 0%,
        var(--gray-100) 25%,
        var(--gray-200) 50%,
        var(--gray-50) 75%,
        var(--gray-100) 100%);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================================
   TIPOGRAFÍA
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
}

.text-muted {
    color: var(--text-secondary);
}

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

/* ============================================================================
   PÁGINA DE LOGIN - ESTILO STARTUP
   ============================================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    background-color: var(--bg-primary);
}

.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Panel Izquierdo - Branding CIVI con Azul Cielo */
.login-brand-panel {
    flex: 1;
    background: linear-gradient(180deg, #87CEEB 0%, #B0D8F0 50%, #D4E8F5 100%);
    padding: 4rem 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.brand-content {
    max-width: 540px;
    position: relative;
    z-index: 1;
    animation: fadeInLeft 0.6s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.brand-logo-section {
    margin-bottom: 2.5rem;
}

.brand-logo {
    width: 240px;
    height: 96px;
    border-radius: 20px;
    object-fit: cover;
    object-position: center top;
    background: white;
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 4px solid rgba(255,255,255,0.3);
    transition: var(--transition-slow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.brand-logo:hover {
    transform: scale(1.05) translateY(-5px);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.brand-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand-description {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.95);
    line-height: 1.7;
    margin-bottom: 3rem;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    transition: var(--transition);
}

.feature-item:hover .feature-icon {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.feature-text h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.25rem 0;
}

.feature-text p {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.85);
    margin: 0;
}

.brand-stats {
    display: flex;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.85);
}

/* Override para stat-label en dashboard (fuera del login) */
.content-area .stat-label,
.dashboard-layout .stat-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* Panel Derecho - Formulario */
.login-form-panel {
    flex: 0 0 500px;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    box-shadow: -20px 0 60px rgba(0,0,0,0.05);
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    animation: fadeInRight 0.6s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

.login-form {
    margin-bottom: 1.5rem;
}

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

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.security-badge svg {
    color: var(--success);
}

/* ============================================================================
   FORMULARIOS
   ============================================================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    transition: var(--transition);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    outline: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--gray-300);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.1);
    transform: translateY(-1px);
}

.form-group:focus-within label {
    color: var(--primary);
}

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

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

/* ============================================================================
   BOTONES
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: var(--font-sans);
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    white-space: nowrap;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 
        -6px -6px 16px rgba(16, 185, 129, 0.5),
        6px 6px 16px rgba(5, 150, 105, 0.6),
        inset -2px -2px 8px rgba(255, 255, 255, 0.2),
        inset 2px 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 25px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        -8px -8px 20px rgba(16, 185, 129, 0.6),
        8px 8px 20px rgba(5, 150, 105, 0.7),
        inset -2px -2px 8px rgba(255, 255, 255, 0.3),
        inset 2px 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary span,
.btn-primary svg {
    position: relative;
    z-index: 1;
}

.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover:not(:disabled) svg {
    transform: translateX(4px);
}

.btn-secondary {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-300);
}

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

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

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

.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

/* ============================================================================
   ALERTAS
   ============================================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

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

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

.alert-warning {
    color: #92400e;
    background-color: #fef3c7;
    border: 1px solid #fde68a;
}

.alert-info {
    color: #1e40af;
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
}

/* ============================================================================
   LAYOUT PRINCIPAL (Dashboard)
   ============================================================================ */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-secondary);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-primary);
    border-right: none;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: var(--spacing-xl) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-brand svg,
.sidebar-brand .logo-img {
    flex-shrink: 0;
}

.logo-img {
    width: 48px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    object-position: center top;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.logo-img:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.sidebar-brand-text h2 {
    font-size: 1.125rem;
    margin: 0;
}

.sidebar-brand-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-lg) 0;
}

.sidebar-nav-section {
    margin-bottom: var(--spacing-lg);
}

.sidebar-nav-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 0 var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.75rem var(--spacing-lg);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9375rem;
    font-weight: 500;
    position: relative;
}

.sidebar-nav-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    box-shadow: -4px -4px 12px rgba(255, 255, 255, 0.5), 4px 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 0 4px 4px 0;
}

.sidebar-nav-item svg {
    flex-shrink: 0;
}

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

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

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

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-lg) var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 90;
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.page-title-section h1 {
    font-size: 1.75rem;
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.content-area {
    flex: 1;
    padding: var(--spacing-xl);
}

/* ============================================================================
   CARDS Y COMPONENTES
   ============================================================================ */

.card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: 
        -6px -6px 16px rgba(255, 255, 255, 0.5),
        6px 6px 16px rgba(0, 0, 0, 0.1),
        inset -2px -2px 8px rgba(255, 255, 255, 0.2),
        inset 2px 2px 8px rgba(0, 0, 0, 0.05);
    border: none;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: var(--spacing-xl);
}

.card-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

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

.stat-card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: 
        -6px -6px 16px rgba(255, 255, 255, 0.5),
        6px 6px 16px rgba(0, 0, 0, 0.1),
        inset -2px -2px 8px rgba(255, 255, 255, 0.2),
        inset 2px 2px 8px rgba(0, 0, 0, 0.05);
    border: none;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: 
        -8px -8px 20px rgba(255, 255, 255, 0.6),
        8px 8px 20px rgba(0, 0, 0, 0.12),
        inset -2px -2px 8px rgba(255, 255, 255, 0.3),
        inset 2px 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-4px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.stat-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-card-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.8125rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--error);
}

.stat-trend.neutral {
    color: var(--text-tertiary);
}

/* ============================================================================
   TABLAS
   ============================================================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
}

.table thead {
    background-color: var(--bg-secondary);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

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

/* ============================================================================
   BADGES Y ETIQUETAS
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

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

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

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

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

.badge-no-show {
    color: #581c87;
    background-color: #f3e8ff;
}

/* ============================================================================
   UTILIDADES
   ============================================================================ */

.d-flex {
    display: flex;
}

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

.justify-content-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 1024px) {
    .login-wrapper {
        flex-direction: column;
    }
    
    .login-brand-panel {
        flex: none;
        min-height: 50vh;
        padding: 3rem 2rem;
    }
    
    .brand-title {
        font-size: 2rem;
    }
    
    .brand-logo {
        width: 180px;
        height: 72px;
    }
    
    .login-form-panel {
        flex: none;
        width: 100%;
        min-height: 50vh;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-area {
        padding: var(--spacing-lg);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar-content {
        flex-wrap: wrap;
    }
    
    /* Login responsive */
    .login-brand-panel {
        padding: 2rem 1.5rem;
    }
    
    .brand-title {
        font-size: 1.75rem;
    }
    
    .brand-description {
        font-size: 1rem;
    }
    
    .brand-logo {
        width: 160px;
        height: 80px;
    }
    
    .brand-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .login-form-panel {
        padding: 2rem 1.5rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   ANIMACIONES
   ============================================================================ */

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

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

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

/* Detalles de cita */
.appointment-detail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.detail-section {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-item span {
    color: var(--text-primary);
}

.detail-item a {
    color: var(--primary);
    text-decoration: none;
}

.detail-item a:hover {
    text-decoration: underline;
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}

.notes-box {
    background: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.detail-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header,
    .modal-body {
        padding: var(--spacing-md);
    }
}

/* ============================================================================
   REPORTES Y GRÁFICOS
   ============================================================================ */

.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.card-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card canvas {
    max-height: 400px;
}

/* Responsive para reportes */
@media (max-width: 1024px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

  
/* Badge en sidebar */  
.sidebar-badge { display: inline-block; padding: 0.125rem 0.375rem; font-size: 0.625rem; font-weight: 700; border-radius: 4px; background: var(--primary); color: white; margin-left: auto; text-transform: uppercase; letter-spacing: 0.5px; } 
