/**
 * ESTILOS CSS - Sistema de Control de Pagos
 * Colegio Santa Ana - Responsive Design
 */

:root {
    --primary-color: #1a5f7a;
    --primary-dark: #134b5f;
    --secondary-color: #57c5b6;
    --accent-color: #159895;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.6;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 45px;
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 0.9rem;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== NAVEGACIÓN MÓVIL ===== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 260px;
    height: calc(100vh - 70px);
    background: var(--white);
    box-shadow: var(--shadow);
    overflow-y: auto;
    transition: var(--transition);
    z-index: 999;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin: 5px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-color);
    color: var(--white);
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    margin-left: 260px;
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

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

.page-title {
    font-size: 1.8rem;
    color: var(--primary-dark);
}

/* ===== TARJETAS ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 1rem 1.5rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-icon.blue { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-icon.green { background: linear-gradient(135deg, #11998e, #38ef7d); }
.stat-icon.orange { background: linear-gradient(135deg, #f093fb, #f5576c); }
.stat-icon.purple { background: linear-gradient(135deg, #9b59b6, #6c3483); }

.stat-info h3 {
    font-size: 1.8rem;
    color: var(--primary-dark);
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

select.form-control {
    cursor: pointer;
}

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

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table .actions {
    white-space: nowrap;
}

.table .actions .btn {
    margin-right: 5px;
}

/* ===== ALERTAS ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #cce5ff;
    color: #004085;
    border-left: 4px solid var(--info-color);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #cce5ff; color: #004085; }
.badge-secondary { background: #e2e3e5; color: #383d41; }
.badge-purple { background: #e8daef; color: #6c3483; }

/* ===== LOGIN ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-box {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

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

.login-header img {
    max-width: 120px;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

/* ===== FACTURA IMPRESIÓN ===== */
.factura-container {
    background: var(--white);
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    box-shadow: var(--shadow);
}

.factura-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.factura-logo {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.factura-logo img {
    height: 80px;
}

.colegio-info h2 {
    color: #00bcd4;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.colegio-info .subtitulo {
    color: var(--dark-color);
    font-size: 0.85rem;
}

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

.forma-libre {
    color: var(--danger-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.num-control {
    color: var(--danger-color);
    font-size: 1.2rem;
    font-weight: bold;
}

.factura-datos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.datos-familia, .datos-pago {
    font-size: 0.9rem;
}

.datos-familia p, .datos-pago p {
    margin-bottom: 5px;
}

.datos-familia strong, .datos-pago strong {
    color: var(--primary-dark);
}

.factura-detalle {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.factura-detalle-header {
    background: var(--light-color);
    padding: 10px 15px;
    font-weight: 600;
    display: grid;
    grid-template-columns: 1fr auto;
}

.factura-detalle-body {
    padding: 15px;
}

.factura-totales {
    display: flex;
    justify-content: flex-end;
}

.totales-box {
    width: 300px;
}

.totales-box .total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.totales-box .total-row.final {
    font-weight: bold;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
}

.factura-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

.escudo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

/* ===== MODAL ===== */
.modal-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;
    padding: 1rem;
}

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

.modal {
    background: var(--white);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--light-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== FILTROS ===== */
.filter-bar {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

/* ===== PAGINACIÓN ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 1.5rem;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark-color);
    background: var(--white);
    border: 1px solid #ddd;
    transition: var(--transition);
}

.pagination a:hover, .pagination span.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .user-info span {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-title {
        font-size: 1.4rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .factura-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .factura-numero {
        text-align: center;
    }
    
    .factura-datos {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar .form-group {
        width: 100%;
    }
    
    .table th, .table td {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-info h3 {
        font-size: 1.4rem;
    }
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: #6c757d; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
    }
    
    .header, .sidebar, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .factura-container {
        box-shadow: none;
        max-width: 100%;
    }
}
