/* ============================================================
   ICE DIOS DE PACTO - ESTILOS COMPLETOS
   ============================================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.5;
}

/* ==================== LOGIN ==================== */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 35px 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo h2 { font-size: 28px; color: #1a237e; margin-bottom: 2px; }
.login-logo span { font-size: 12px; color: #666; }
.login-container h3 { text-align: center; margin-bottom: 20px; color: #333; }
.login-container label { display: block; margin-bottom: 5px; font-weight: 600; color: #444; }
.login-container input {
    width: 100%; padding: 11px 14px; margin-bottom: 16px;
    border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
    transition: border-color 0.2s;
}
.login-container input:focus { border-color: #1a237e; outline: none; box-shadow: 0 0 0 3px rgba(26,35,126,0.1); }
.login-container button {
    width: 100%; padding: 12px; background: #1a237e; color: #fff;
    border: none; border-radius: 6px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.login-container button:hover { background: #283593; }

.error {
    background: #ffebee; color: #c62828; padding: 12px;
    border-radius: 6px; margin-bottom: 16px; text-align: center; font-size: 14px;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard { display: flex; min-height: 100vh; }

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 250px; background: linear-gradient(180deg, #1a237e 0%, #0d1442 100%);
    color: #fff; display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
}

.sidebar-header { padding: 24px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h2 { font-size: 26px; font-weight: 700; letter-spacing: 2px; }
.sidebar-header span { font-size: 11px; opacity: 0.6; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section { padding: 16px 20px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.4; }

.nav-item {
    display: flex; align-items: center; padding: 10px 20px;
    color: rgba(255,255,255,0.75); text-decoration: none;
    transition: all 0.2s; font-size: 14px; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: #ffd54f; }
.nav-item .icono { margin-right: 12px; font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
}
.sidebar-footer span { display: block; font-weight: 600; }
.sidebar-footer small { display: block; opacity: 0.5; font-size: 11px; margin-bottom: 6px; }
.btn-cerrar { color: #ff8a80; text-decoration: none; font-size: 12px; }
.btn-cerrar:hover { text-decoration: underline; }

/* ==================== CONTENT ==================== */
.content { margin-left: 250px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    background: #fff; padding: 18px 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 20px; color: #1a237e; font-weight: 600; }

.module-content { padding: 28px 30px; flex: 1; }

/* ==================== KPI CARDS (DSS) ==================== */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.kpi-card {
    background: #fff; padding: 20px; border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.kpi-label { display: block; font-size: 12px; color: #666; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 28px; font-weight: 700; color: #1a237e; }

/* ==================== DSS GRID ==================== */
.dss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dss-full { grid-column: 1 / -1; }
.dss-card {
    background: #fff; padding: 22px; border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dss-card h3 { font-size: 14px; color: #444; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

.badge-alerta, .badge-educacion, .badge-zonas {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff;
}
.badge-alerta { background: #e53935; }
.badge-educacion { background: #1e88e5; }
.badge-zonas { background: #43a047; }

/* ==================== TABLES ==================== */
.table-responsive { overflow-x: auto; margin-top: 12px; }
.table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.table thead { background: #f5f6fa; }
.table th { padding: 12px 14px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #666; font-weight: 600; }
.table td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.table tbody tr:hover { background: #f8f9ff; }
.table-dss { width: 100%; border-collapse: collapse; }
.table-dss th, .table-dss td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.table-dss th { font-weight: 600; color: #666; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

.tag {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600; background: #e8eaf6; color: #283593;
}
.tag-activo { background: #e8f5e9; color: #2e7d32; }
.tag-observacion { background: #fff8e1; color: #f57f17; }
.tag-traslado { background: #e3f2fd; color: #1565c0; }
.tag-inactivo { background: #fafafa; color: #757575; }
.tag-saludable { background: #e8f5e9; color: #2e7d32; }
.tag-estable { background: #e3f2fd; color: #1565c0; }
.tag-critico { background: #ffebee; color: #c62828; }

.row-success { background: #f1f8e9; }
.row-warning { background: #fff8e1; }

/* ==================== ALERTAS ==================== */
.lista-alertas { list-style: none; }
.lista-alertas li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px;
}
.lista-alertas li:last-child { border-bottom: none; }
.tag-ausente { background: #ffebee; color: #c62828; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: auto; }

.text-success { color: #2e7d32; font-weight: 500; }
.text-muted { color: #999; font-size: 14px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ==================== BARRAS DE PROGRESO ==================== */
.barra-progreso { display: flex; flex-direction: column; gap: 12px; }
.barra-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.barra-item span { min-width: 140px; }
.barra { flex: 1; height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.barra-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
.fill-success { background: #43a047; }
.fill-info { background: #1e88e5; }
.fill-warning { background: #fb8c00; }

/* ==================== MODALS ==================== */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s;
}
.modal-content {
    background: #fff; margin: 40px auto; padding: 28px;
    border-radius: 12px; max-width: 650px; width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); max-height: 85vh; overflow-y: auto;
    animation: slideIn 0.25s;
}
.modal-content h3 { margin-bottom: 20px; color: #1a237e; font-size: 18px; }
.close { float: right; font-size: 26px; cursor: pointer; color: #999; line-height: 1; }
.close:hover { color: #333; }

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

/* ==================== FORMS ==================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 13px; font-weight: 600; color: #444; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
    padding: 9px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #1a237e; outline: none; box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}
.form-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px;
    font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: #1a237e; color: #fff; }
.btn-primary:hover { background: #283593; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-sm { padding: 6px 10px; border: none; border-radius: 4px; cursor: pointer; background: #f0f0f0; font-size: 14px; }
.btn-sm:hover { background: #e0e0e0; }
.btn-danger { background: #ffebee; color: #c62828; }
.btn-danger:hover { background: #ffcdd2; }
.acciones { display: flex; gap: 4px; }

/* ==================== FILTROS ==================== */
.filtros {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    margin-bottom: 18px; background: #fff; padding: 14px 18px;
    border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.filtros input, .filtros select {
    padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.filtros label { font-size: 13px; font-weight: 600; color: #555; }
.filtros input:focus, .filtros select:focus { border-color: #1a237e; outline: none; }

/* ==================== MODULE HEADER ==================== */
.module-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.module-header h2 { font-size: 18px; color: #1a237e; }

/* ==================== ASISTENCIA MÓVIL ==================== */
.asistencia-container { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.asistencia-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px; margin-top: 14px;
}
.asistencia-item {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: #fafafa; border: 1px solid #eee; border-radius: 8px;
    cursor: pointer; transition: all 0.15s; font-size: 14px;
}
.asistencia-item:hover { border-color: #1a237e; background: #f5f6ff; }
.asistencia-item.checked { background: #e8f5e9; border-color: #43a047; }
.asistencia-item input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #1a237e; }

#asistenciaInfo { margin-bottom: 8px; font-size: 14px; }

.alert-success, .alert-error {
    padding: 12px 16px; border-radius: 6px; margin-top: 14px;
    font-size: 14px; font-weight: 500;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* ==================== PLACEHOLDER ==================== */
.placeholder-modulo {
    background: #fff; border-radius: 10px; padding: 50px;
    text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.placeholder-modulo h2 { color: #1a237e; margin-bottom: 8px; }
.placeholder-modulo p { color: #999; }

/* ==================== WELCOME ==================== */
.welcome { margin-bottom: 20px; }
.welcome h2 { font-size: 22px; color: #1a237e; }
.rol-info { font-size: 14px; color: #666; margin-top: 4px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .sidebar { width: 60px; overflow: hidden; }
    .sidebar:hover { width: 250px; overflow-y: auto; position: fixed; z-index: 200; }
    .sidebar-header h2 { font-size: 14px; }
    .sidebar-header span, .nav-item span:not(.icono), .nav-section, .sidebar-footer small, .sidebar-footer span { display: none; }
    .sidebar:hover .sidebar-header span,
    .sidebar:hover .nav-item span:not(.icono),
    .sidebar:hover .nav-section,
    .sidebar:hover .sidebar-footer small,
    .sidebar:hover .sidebar-footer span { display: inline; }
    .nav-item { justify-content: center; padding: 14px; }
    .sidebar:hover .nav-item { justify-content: flex-start; padding: 10px 20px; }
    .content { margin-left: 60px; }
    .dss-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .module-content { padding: 18px; }
    .topbar { padding: 14px 18px; }
}

@media (max-width: 600px) {
    .asistencia-grid { grid-template-columns: 1fr 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .login-container { margin: 40px 16px; }
    .modal-content { width: 95%; margin: 20px auto; padding: 20px; }
}
