/* ================================================================
   Sistema de Vinculación - Estilos Principales
   Adaptado del Sistema de Reservas
   ================================================================ */

:root {
    --primary:        #4f46e5;
    --primary-dark:   #3730a3;
    --primary-light:  #e0e7ff;
    --accent:         #ec4899;
    --accent-light:   #fce7f3;
    --success:        #10b981;
    --success-light:  #d1fae5;
    --warning:        #f59e0b;
    --warning-light:  #fef3c7;
    --danger:         #ef4444;
    --danger-light:   #fee2e2;
    --info:           #06b6d4;
    --info-light:     #cffafe;

    --dark-bg:        #1e293b;
    --body-bg:        #eef2ff;
    --body-bg-2:      #faf5ff;

    --sidebar-bg:         #1e293b;
    --sidebar-surface:    #ffffff;
    --sidebar-text:       #e5e7eb;
    --sidebar-muted:      #94a3b8;
    --sidebar-border:     rgba(255,255,255,.08);
    --sidebar-hover:      rgba(255,255,255,.08);
    --sidebar-active:     rgba(255,255,255,.15);
    --sidebar-w:          280px;
    --sidebar-w-collapsed: 80px;

    --text-muted:     #475569;
    --border-soft:    #e2e8f0;

    --header-h:       60px;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow:         0 2px 12px rgba(79,70,229,.08);
    --shadow-md:      0 6px 24px rgba(79,70,229,.15);
    --transition:     .25s ease;
}

/* ---- Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: #f5f7fa;
    background-attachment: fixed;
    color: #1f2937;
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================================================================
   LAYOUT
   ================================================================ */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-w-collapsed);
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition);
    z-index: 1000;
    overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); overflow: visible; }
.sidebar.collapsed .sidebar-title span,
.sidebar.collapsed .sidebar-menu a span,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .user-details,
.sidebar.collapsed .user-info .fa-chevron-down,
.sidebar.collapsed .sidebar-logo-center,
.sidebar.collapsed .btn-logout span { display: none; }
.sidebar.collapsed .sidebar-menu a { justify-content: center; padding: 1rem 0; }
.sidebar.collapsed .sidebar-menu a i { margin: 0; font-size: 1.25rem; }
.sidebar.collapsed .btn-logout { justify-content: center; padding: .75rem .5rem; }
.sidebar.collapsed .sidebar-toggle-btn i { transform: rotate(180deg); }
.sidebar.collapsed .user-info { justify-content: center; }

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--sidebar-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: .4rem;
    border-radius: 6px;
    transition: all var(--transition);
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.sidebar-toggle-btn i { transition: transform var(--transition); }

.sidebar-section-title {
    padding: .65rem 1.5rem .3rem;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--sidebar-muted);
    white-space: nowrap;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: .25rem 0;
    overflow-y: auto;
}
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(100,116,139,.3); border-radius: 4px; }

.sidebar-menu li { margin: .1rem 0; }

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .85rem;
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: .92rem;
    margin: .15rem .75rem;
    border-radius: 10px;
    transition: all var(--transition);
    white-space: nowrap;
}
.sidebar-menu a:hover { background: var(--sidebar-hover); color: var(--sidebar-text); text-decoration: none; }
.sidebar-menu a.active { background: var(--sidebar-active); color: var(--sidebar-text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--sidebar-border); }
.sidebar-menu a i { width: 20px; text-align: center; font-size: .95rem; flex-shrink: 0; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
}

.sidebar-logo-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}
.sidebar-logo-img {
    max-width: 110px;
    width: 100%;
    height: auto;
    opacity: .85;
}

.user-info {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .75rem;
    background: rgba(255,255,255,.06);
    border-radius: 8px;
    border: 1px solid var(--sidebar-border);
    cursor: pointer;
    transition: background var(--transition);
}
.user-info:hover { background: rgba(255,255,255,.12); }
.user-info > .fa-user-circle { font-size: 1.75rem; color: var(--sidebar-muted); }
.user-details { flex: 1; min-width: 0; overflow: hidden; }
.user-details strong { display: block; font-size: .8rem; font-weight: 600; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-details small { font-size: .7rem; color: var(--sidebar-muted); text-transform: capitalize; }

.btn-logout {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .9rem;
    margin-top: .6rem;
    background: #fff1f2;
    color: #b91c1c;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-logout:hover { background: #ffe4e6; border-color: #fda4af; text-decoration: none; }

.user-dropdown-menu {
    margin-top: .5rem;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    overflow: hidden;
}
.sidebar.collapsed .user-dropdown-menu {
    position: absolute;
    bottom: 1rem;
    left: calc(var(--sidebar-w-collapsed) - .5rem);
    margin-top: 0;
    min-width: 190px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    box-shadow: 4px 4px 16px rgba(0,0,0,.35);
    z-index: 2000;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .6rem .85rem;
    background: transparent;
    color: var(--sidebar-text);
    border: none;
    font-size: .82rem;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
    font-family: inherit;
}
.user-dropdown-item + .user-dropdown-item { border-top: 1px solid var(--sidebar-border); }
.user-dropdown-item:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.user-dropdown-item i { width: 16px; text-align: center; color: var(--sidebar-muted); }
.user-dropdown-item:hover i { color: #fff; }

/* Top header user (versión limpia) */
.top-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .25rem .5rem;
}
.top-user > .fa-user-circle { font-size: 1.6rem; color: #94a3b8; }
.top-user-text { display: flex; flex-direction: column; line-height: 1.1; }
.top-user-name { font-size: .85rem; font-weight: 600; color: #0f172a; }
.top-user-rol  { font-size: .7rem; color: var(--text-muted); text-transform: capitalize; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 999;
}

/* ================================================================
   TOP HEADER
   ================================================================ */
.top-header {
    height: var(--header-h);
    background: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 1px 0 rgba(15,23,42,.04);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
.top-header-left { flex: 1; }
.page-heading { font-size: 1.05rem; font-weight: 600; color: #0f172a; margin: 0; }
.top-header-right { display: flex; align-items: center; gap: 1rem; }

.top-user-badge {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: #1f2937;
    background: #f1f5f9;
    padding: .35rem .75rem;
    border-radius: 99px;
    border: 1px solid var(--border-soft);
}
.rol-badge {
    font-size: .7rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    padding: .15rem .5rem;
    border-radius: 99px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #334155;
    cursor: pointer;
    padding: .4rem;
}

/* ================================================================
   PAGE CONTENT
   ================================================================ */
.page-content {
    padding: 1.5rem 1.5rem 3rem;
    flex: 1;
}

/* ================================================================
   BOTONES
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 6px rgba(15,23,42,.15); }

.btn-success   { background: var(--success); color: #fff; border-color: transparent; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.btn-success:hover { background: #059669; }

.btn-outline   { background: #fff; color: var(--primary); border-color: #c7d2fe; }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary); }

.btn-ghost     { background: transparent; color: #64748b; border-color: transparent; }
.btn-ghost:hover { background: #f1f5f9; color: #374151; }

.btn-ghost--danger { color: var(--danger); }
.btn-ghost--danger:hover { background: var(--danger-light); }

.btn-sm        { padding: .35rem .75rem; font-size: .8rem; }
.btn-icon-text { padding: .4rem .6rem; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-success   { background: var(--success-light); color: #166534; }
.badge-warning   { background: var(--warning-light); color: #92400e; }
.badge-danger    { background: var(--danger-light);  color: #991b1b; }
.badge-info      { background: var(--info-light);    color: #155e75; }
.badge-dark      { background: var(--dark-bg);       color: #fff; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* ================================================================
   TIPO DE VISITA (badges visuales con icono direccional)
   ================================================================ */
.tv {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}
.tv i { font-size: .8rem; }
.tv--salida  { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.tv--entrada { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.tv--reunion { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.tv--otro    { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.tv--icon-only {
    width: 26px; height: 26px;
    padding: 0; justify-content: center;
    border-radius: 50%;
}
.tv--icon-only i { font-size: .85rem; }

/* ================================================================
   MIS AGENDAMIENTOS (dashboard)
   ================================================================ */
.mis-agenda-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}
@media (max-width: 1100px) { .mis-agenda-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .mis-agenda-list { grid-template-columns: 1fr; } }
.mis-agenda-item {
    display: flex; align-items: flex-start; gap: 1rem;
    padding: .75rem 1rem;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: all .15s ease;
}
.mis-agenda-item:hover { background: #f8fafc; border-left-color: var(--primary-dark); transform: translateX(2px); text-decoration: none; }
.mis-agenda-item--pasado { opacity: .6; border-left-color: #94a3b8; }
.mis-agenda-fecha {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 56px; padding: .35rem .5rem;
    background: var(--primary-light); color: var(--primary-dark);
    border-radius: var(--radius-sm);
    line-height: 1.1;
}
.mis-agenda-fecha .dia { font-size: 1.4rem; font-weight: 800; }
.mis-agenda-fecha .mes { font-size: .65rem; font-weight: 700; letter-spacing: .04em; }
.mis-agenda-info { flex: 1; min-width: 0; }
.mis-agenda-titulo { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: #0f172a; flex-wrap: wrap; }
.mis-agenda-titulo strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.mis-agenda-meta {
    display: flex; flex-wrap: wrap; gap: .65rem;
    margin-top: .3rem; font-size: .75rem; color: var(--text-muted);
}
.mis-agenda-meta i { margin-right: .2rem; }
.mis-agenda-personas {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    margin-top: .3rem;
    padding-top: .25rem;
    border-top: 1px dashed var(--border-soft);
}
.mis-agenda-persona {
    display: flex;
    align-items: flex-start;
    gap: .3rem;
    font-size: .74rem;
    color: #475569;
    line-height: 1.35;
}
.mis-agenda-persona i { flex-shrink: 0; margin-top: .1rem; opacity: .65; }
.mis-agenda-persona--resp { font-weight: 700; color: #1e293b; }
.rol-tag {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .1rem .45rem; border-radius: 999px;
    font-size: .68rem; font-weight: 600;
}
.rol-tag--resp { background: var(--primary-light); color: var(--primary-dark); }
.rol-tag--part { background: var(--success-light); color: #065f46; }

/* ================================================================
   DISPONIBILIDAD
   ================================================================ */
.disp-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
@media (max-width: 1100px) { .disp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .disp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .disp-grid { grid-template-columns: 1fr; } }

.disp-equipo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .75rem;
}
@media (max-width: 768px) { .disp-equipo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 500px)  { .disp-equipo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px)  { .disp-equipo-grid { grid-template-columns: 1fr; } }

.disp-day-card {
    background: #fff;
    border: 1px solid #e9d5ff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 220px;
}
.disp-day-head {
    background: #1e293b;
    color: #fff;
    padding: .65rem .9rem;
    font-weight: 700;
    font-size: .9rem;
    display: flex; align-items: center; gap: .5rem;
}
.disp-day-head .disp-count {
    margin-left: auto;
    background: rgba(255,255,255,.2);
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
}
.disp-day-body { padding: .6rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.disp-empty { color: var(--text-muted); font-size: .8rem; text-align: center; padding: 1rem .5rem; font-style: italic; }
.disp-block {
    background: var(--primary-light);
    border: 1px solid #c7d2fe;
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: .55rem .65rem;
    font-size: .82rem;
}
.disp-block-time { font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: .35rem; }
.disp-block-notas { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }
.disp-block-actions { display: flex; gap: .25rem; margin-top: .35rem; justify-content: flex-end; }

/* Disponibles en modal de agendamiento */
.disponibles-list {
    display: flex; flex-wrap: wrap; gap: .35rem;
    margin-top: .35rem; padding: .5rem;
    background: #f8fafc; border: 1px dashed var(--border-soft); border-radius: var(--radius-sm);
    max-height: 110px; overflow-y: auto;
}
.disponibles-list .chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .55rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600;
    background: var(--success-light); color: #065f46;
    border: 1px solid #a7f3d0;
}
.disponibles-list .chip--no      { background: var(--danger-light);  color: #991b1b; border-color: #fecaca; opacity: .85; }
.disponibles-list .chip--no-disp { background: var(--danger-light);  color: #991b1b; border-color: #fecaca; }
.disponibles-list .chip--sin     { background: #f1f5f9; color: #64748b; border-color: var(--border-soft); }
.disponibles-list .chip i      { font-size: .7rem; }
.disponibles-empty { color: var(--text-muted); font-size: .75rem; padding: .35rem; }
.disponibles-loading { color: var(--text-muted); font-size: .75rem; padding: .35rem; }

/* ================================================================
   PANEL SOLICITUDES PÚBLICAS (admin)
   ================================================================ */
.solicitudes-panel {
    background: #fffbeb;
    border: 1.5px solid #fcd34d;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(245,158,11,.12);
}
.solicitudes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    gap: 12px;
    flex-wrap: wrap;
}
.solicitudes-badge {
    background: #d97706;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.solicitudes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    padding: 16px;
}
.solicitud-card {
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.solicitud-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.solicitud-badge-nuevo {
    background: #fef08a;
    color: #92400e;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid #fcd34d;
}
.solicitud-colegio {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.solicitud-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}
.solicitud-meta span { display: flex; align-items: center; gap: 4px; }
.solicitud-solicitante {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    background: #f8fafc;
    border-radius: 6px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
}
.solicitud-email {
    color: #1565C0;
    font-size: 12px;
    text-decoration: none;
}
.solicitud-email:hover { text-decoration: underline; }
.solicitud-asunto {
    font-size: 12.5px;
    color: #475569;
    font-style: italic;
    line-height: 1.5;
}
.solicitud-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.btn-success {
    background: var(--success);
    color: #fff;
    border: none;
}
.btn-success:hover { background: #0da271; }

/* Badge "Solicitud externa" (amarillo) */
.badge-sol-externa {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef08a;
    color: #92400e;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid #fcd34d;
    letter-spacing: .02em;
    vertical-align: middle;
}
.badge-sol-externa i { font-size: 9px; }

/* Versión modal (en el título h3) */
.badge-sol-externa-modal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef08a;
    color: #92400e;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid #fcd34d;
    margin-left: 8px;
    vertical-align: middle;
    white-space: nowrap;
}
.badge-sol-externa-modal i { font-size: 9px; }

/* ================================================================
   STATS
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--sidebar-border);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.stat-icon--primary  { background: var(--primary-light); color: var(--primary); }
.stat-icon--success  { background: var(--success-light); color: var(--success); }
.stat-icon--warning  { background: var(--warning-light); color: var(--warning); }
.stat-icon--danger   { background: var(--danger-light);  color: var(--danger); }
.stat-icon--info     { background: var(--info-light);    color: var(--info); }
.stat-icon--dark     { background: #e2e8f0; color: var(--dark-bg); }

.stat-number { font-size: 1.6rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.stat-label  { font-size: .78rem; color: var(--sidebar-muted); margin-top: .15rem; }

/* ================================================================
   DASHBOARD
   ================================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.panel {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e9d5ff;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #ede9fe;
    background: #f8fafc;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.panel-header h3 { font-size: .95rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; color: #0f172a; }
.panel-header h3 i { color: var(--primary); }
.panel-header h3 small { font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.panel-body { padding: 1rem; flex: 1; overflow-y: auto; max-height: 420px; }
.panel-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--sidebar-border); }

/* Visita cards en dashboard */
.visita-card {
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-sm);
    padding: .85rem 1rem;
    margin-bottom: .65rem;
    border-left: 4px solid #e2e8f0;
    background: #fafafa;
    transition: box-shadow var(--transition);
}
.visita-card:hover { box-shadow: var(--shadow); }
.visita-card--pendiente  { border-left-color: var(--warning); }
.visita-card--en_proceso { border-left-color: var(--info); }
.visita-card--completada { border-left-color: var(--success); }
.visita-card--cancelada  { border-left-color: var(--danger); opacity: .7; }

.visita-card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.visita-tipo-badge { font-size: .72rem; font-weight: 600; color: var(--sidebar-muted); }
.visita-card-title { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: #0f172a; }
.visita-card-meta { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .78rem; color: var(--sidebar-muted); margin-bottom: .4rem; }
.visita-card-meta span { display: flex; align-items: center; gap: .25rem; }
.visita-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; }
.participantes-count { display: flex; align-items: center; gap: .3rem; color: var(--sidebar-muted); }
.responsable-badge { display: flex; align-items: center; gap: .3rem; color: var(--sidebar-muted); }

/* Ranking */
.ranking-list { display: flex; flex-direction: column; gap: .5rem; }
.ranking-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; background: #f8fafc; border-radius: 10px; border: 1px solid var(--sidebar-border); }
.ranking-pos { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: #e2e8f0; color: #334155; flex-shrink: 0; }
.ranking-pos--1 { background: #fbbf24; color: #78350f; }
.ranking-pos--2 { background: #94a3b8; color: #fff; }
.ranking-pos--3 { background: #d97706; color: #fff; }
.ranking-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--dark-bg); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.ranking-nombre { font-size: .875rem; font-weight: 600; }
.ranking-participaciones { font-size: .75rem; color: var(--sidebar-muted); }

/* ================================================================
   TU SEMANA EN UN VISTAZO
   ================================================================ */
.dashboard-hello {
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 60%, #818cf8 100%);
    color: #fff;
    padding: 1.75rem 2rem;
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(79,70,229,.28);
    position: relative;
    overflow: hidden;
}
.dashboard-hello::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,.07);
    border-radius: 50%;
    pointer-events: none;
}
.dashboard-hello h2 {
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 .35rem;
    letter-spacing: -.01em;
}
.dashboard-hello p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 1rem;
}

.week-nav {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.week-nav .btn { padding: .35rem .55rem; }

.week-panel { margin-bottom: 1.25rem; }
.week-panel > .panel-header {
    background: linear-gradient(90deg, #ede9fe 0%, #f8fafc 100%);
    padding: 1.1rem 1.4rem;
    border-bottom: 2px solid #c7d2fe;
}
.week-panel > .panel-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    gap: .6rem;
}
.week-panel > .panel-header h3 i { font-size: 1rem; }
.week-panel > .panel-header h3 small {
    font-size: .82rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    padding: .15rem .55rem;
    border-radius: 20px;
}
.week-body { max-height: none; padding: 1rem; }

/* Próximas visitas en grilla 3 col */
.proximas-body { max-height: none; }
.proximas-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}
.proximas-grid .visita-card { margin-bottom: 0; }
@media (max-width: 1100px) {
    .proximas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .proximas-grid { grid-template-columns: 1fr; }
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .6rem;
}

.week-day {
    background: #f8fafc;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    min-height: 90px;
    overflow: hidden;
}
.week-day--pasado { opacity: .6; }
.week-day--hoy {
    background: #fff;
    border: 2px solid var(--primary);
    box-shadow: 0 4px 16px rgba(79,70,229,.13);
}

.week-day-head {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    padding: .5rem .65rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: #fff;
}
.week-day--hoy .week-day-head {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-bottom: none;
}
.week-day--hoy .week-day-name { color: rgba(255,255,255,.85); }
.week-day-name { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--sidebar-muted); letter-spacing: .04em; }
.week-day-num  { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin-left: auto; }
.week-day--hoy .week-day-num { color: #fff; }
.week-day-badge {
    font-size: .6rem;
    font-weight: 700;
    background: rgba(255,255,255,.25);
    color: #fff;
    padding: .1rem .35rem;
    border-radius: 4px;
    letter-spacing: .04em;
    border: 1px solid rgba(255,255,255,.4);
}

.week-day-body {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .5rem;
    flex: 1;
}

.week-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    color: #cbd5e1;
    font-size: .7rem;
    flex: 1;
    padding: 1rem .25rem;
    text-align: center;
}
.week-empty i { font-size: 1.1rem; }

.week-visit {
    display: block;
    background: #fff;
    border: 1px solid var(--sidebar-border);
    border-left: 3px solid #cbd5e1;
    border-radius: 6px;
    padding: .45rem .55rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition), transform var(--transition);
}
.week-visit:hover { box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; color: inherit; }
.week-visit--clickable { cursor: pointer; }
.week-visit--pendiente  { border-left-color: var(--warning); }
.week-visit--en_proceso { border-left-color: var(--info); }
.week-visit--completada { border-left-color: var(--success); }
.week-visit--cancelada  { border-left-color: var(--danger); opacity: .65; }
.week-visit--solicitud-externa { border-left-color: #d97706; border-left-width: 5px; background: #fef08a; }
.week-visit-badge-sol {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    color: #92400e;
    margin-bottom: .2rem;
    display: flex;
    align-items: center;
    gap: .25rem;
}

.week-visit-time {
    font-size: .72rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-bottom: .15rem;
}
.week-visit-title {
    font-size: .78rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: .2rem;
}
.week-visit-place {
    font-size: .78rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: .25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.week-visit-place i { margin-right: .15rem; }
.week-visit-foot {
    display: flex;
    justify-content: space-between;
    font-size: .68rem;
    color: var(--sidebar-muted);
    border-top: 1px dashed var(--sidebar-border);
    padding-top: .25rem;
}
.week-visit-foot i { margin-right: .15rem; }

.week-mas-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: .28rem .5rem;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--primary);
    transition: background .15s, color .15s;
    margin-top: .1rem;
}
.week-mas-btn:hover { background: var(--primary); color: #fff; text-decoration: none; }
.week-visit-personas {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    margin-top: .25rem;
    border-top: 1px dashed rgba(0,0,0,.1);
    padding-top: .22rem;
}
.week-visit-persona {
    display: flex;
    align-items: flex-start;
    gap: .3rem;
    font-size: .71rem;
    color: #475569;
    line-height: 1.35;
    word-break: break-word;
}
.week-visit-persona i { flex-shrink: 0; margin-top: .1rem; opacity: .65; }
.week-visit-persona--resp { font-weight: 700; color: #1e293b; }

.tag-resp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    font-style: normal;
    flex-shrink: 0;
    vertical-align: middle;
    margin-left: .2rem;
}

@media (max-width: 1100px) {
    .week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .week-grid { grid-template-columns: 1fr; }
    .week-day { min-height: auto; }
}

/* ================================================================
   PAGE TOOLBAR
   ================================================================ */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.toolbar-right { display: flex; gap: .5rem; align-items: center; }

.search-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.search-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    background: #fff;
    transition: border var(--transition), box-shadow var(--transition);
    overflow: hidden;
}
.search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-icon {
    flex-shrink: 0;
    padding: 0 .55rem 0 .75rem;
    color: var(--sidebar-muted);
    font-size: .875rem;
    pointer-events: none;
    line-height: 1;
}
.search-input {
    border: none;
    outline: none;
    padding: .55rem .75rem .55rem 0;
    font-size: .875rem;
    width: 260px;
    background: transparent;
}
.search-input:focus { box-shadow: none; }


.filter-label { font-size: .875rem; color: var(--sidebar-muted); display: flex; align-items: center; gap: .35rem; }
.filter-select { padding: .55rem .75rem; border: 1px solid #d1d5db; border-radius: var(--radius-sm); font-size: .875rem; outline: none; }
/* Radio group de vista */
.filter-radio-group { display: flex; align-items: center; background: #f1f5f9; border-radius: 8px; padding: .2rem; gap: .15rem; }
.filter-radio { display: flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border-radius: 6px; font-size: .8rem; font-weight: 600; color: #64748b; cursor: pointer; transition: background .15s, color .15s; user-select: none; }
.filter-radio input[type="radio"] { display: none; }
.filter-radio:hover { background: #e2e8f0; color: #334155; }
.filter-radio--active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ================================================================
   TABLE
   ================================================================ */
.table-panel {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--sidebar-border);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-panel-header { padding: .75rem 1.25rem; border-bottom: 1px solid var(--sidebar-border); display: flex; align-items: center; justify-content: space-between; }
.table-count { font-size: .82rem; color: var(--sidebar-muted); }
.table-panel-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--sidebar-border); display: flex; justify-content: flex-end; }
.table-responsive { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead th { background: #f8fafc; padding: .75rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; color: var(--sidebar-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--sidebar-border); white-space: nowrap; }
.data-table tbody td { padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafafa; }
.td-empty { text-align: center; color: var(--sidebar-muted); padding: 2rem 1rem; }

.user-cell { display: flex; align-items: center; gap: .65rem; }
.user-avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--dark-bg); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; }

.colegio-cell { display: flex; align-items: center; gap: .65rem; }
.colegio-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); background: #f1f5f9; display: flex; align-items: center; justify-content: center; color: var(--sidebar-muted); flex-shrink: 0; }

.link-email { font-size: .82rem; color: var(--primary); }
.link-email:hover { text-decoration: underline; }

.action-btns { display: flex; gap: .4rem; }
.btn-icon { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; display: flex; align-items: center; justify-content: center; font-size: .8rem; cursor: pointer; transition: all var(--transition); }
.btn-icon:hover { transform: scale(1.05); }
.btn-icon--edit   { color: var(--primary); }
.btn-icon--edit:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-icon--delete { color: var(--danger); }
.btn-icon--delete:hover { background: var(--danger-light); border-color: var(--danger); }

/* Paginación */
.pagination { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.page-item .page-link { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; font-size: .82rem; color: #374151; border: 1px solid #e2e8f0; background: #fff; transition: all var(--transition); cursor: pointer; text-decoration: none; }
.page-item.active .page-link { background: var(--dark-bg); color: #fff; border-color: var(--dark-bg); }
.page-item.disabled .page-link { opacity: .5; cursor: not-allowed; }
.page-item .page-link:hover:not(.active):not(.disabled) { background: #f1f5f9; }

/* ================================================================
   AGENDAMIENTOS GRID (vista listado)
   ================================================================ */
.agendamientos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.agendamiento-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--sidebar-border);
    border-left: 4px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}
.agendamiento-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.agendamiento-card--pendiente  { border-left-color: var(--warning); }
.agendamiento-card--en_proceso { border-left-color: var(--info); }
.agendamiento-card--completada { border-left-color: var(--success); }
.agendamiento-card--cancelada  { border-left-color: var(--danger); opacity: .75; }
/* Watermark de estado en esquina */
.card-estado-watermark {
    position: absolute; bottom: .7rem; right: .9rem;
    display: flex; align-items: center; gap: .35rem;
    pointer-events: none; line-height: 1;
    opacity: .55; transition: opacity .2s;
}
.agendamiento-card:hover .card-estado-watermark { opacity: .85; }
.card-estado-watermark > i { font-size: 1.6rem; }
.card-estado-watermark-label { font-size: .7rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
/* quitar estilos propios de .fecha-relativa dentro del watermark */
.card-estado-watermark .fecha-relativa { background: none; border: none; padding: 0; font-size: .7rem; font-weight: 700; color: inherit; }
.card-estado-watermark--ok        { color: var(--success); }
.card-estado-watermark--cancelada { color: var(--danger); }
.card-estado-watermark--pendiente { color: var(--warning); }

.agendamiento-card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.agendamiento-tipo { display: flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; color: var(--sidebar-muted); }
.tipo-icon { width: 22px; height: 22px; border-radius: 6px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--sidebar-muted); }
.agendamiento-card-title { font-size: .95rem; font-weight: 600; color: #0f172a; }
.agendamiento-card-asunto { font-size: .8rem; color: #475569; margin-top: .2rem; display: flex; align-items: center; gap: .3rem; }
.agendamiento-card-asunto i { color: var(--primary); font-size: .72rem; }
.agendamiento-card-detalle { font-size: .8rem; color: #475569; line-height: 1.45; margin-top: .25rem; font-style: italic; }
.agendamiento-card-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .78rem; color: var(--sidebar-muted); }
.agendamiento-card-meta span { display: flex; align-items: center; gap: .25rem; }
/* Etiquetas de fecha relativa */
.fecha-relativa { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 20px; font-size: .7rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.fecha-rel--hoy   { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.fecha-rel--pronto { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.fecha-rel--semana { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.fecha-rel--mes   { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.fecha-rel--pasado { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; }
.agendamiento-card-info { display: flex; flex-direction: column; gap: .3rem; background: #f8fafc; border-left: 3px solid #e2e8f0; border-radius: 0 6px 6px 0; padding: .45rem .6rem; font-size: .78rem; }
.agendamiento-info-item { display: flex; flex-direction: column; gap: .1rem; }
.agendamiento-info-label { font-weight: 600; color: #64748b; display: flex; align-items: center; gap: .25rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.agendamiento-info-label i { font-size: .68rem; }
.agendamiento-info-text { color: #334155; line-height: 1.4; }
.agendamiento-card-footer { display: flex; align-items: flex-start; justify-content: space-between; font-size: .78rem; margin-top: .25rem; padding-top: .5rem; border-top: 1px solid #f1f5f9; gap: .5rem; }
.agendamiento-personas-lista { display: flex; flex-direction: column; gap: .22rem; }
.agendamiento-personas-label { font-weight: 600; color: #64748b; display: flex; align-items: center; gap: .3rem; margin-bottom: .1rem; }
.agendamiento-persona-item { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: #334155; }
.agendamiento-persona-item--resp { font-weight: 700; color: #0f172a; }
.agendamiento-responsable { display: flex; align-items: center; gap: .3rem; color: var(--sidebar-muted); }
.warn-participantes { color: var(--warning); margin-left: .25rem; }
.agendamiento-card-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ================================================================
   AGRUPACIÓN POR MES
   ================================================================ */
.mes-grupo { margin-bottom: 2rem; }
.mes-grupo-header {
    display: flex; align-items: center; gap: .6rem;
    margin-bottom: 1rem; padding: .45rem .1rem;
    color: #334155;
}
.mes-grupo-header i { font-size: .9rem; color: var(--primary); }
.mes-grupo-label { font-size: .95rem; font-weight: 700; white-space: nowrap; }
.mes-grupo-linea { flex: 1; height: 2px; background: #e2e8f0; border-radius: 2px; }
.mes-grupo-badge-actual {
    font-size: .65rem; font-weight: 700; padding: .15rem .5rem;
    background: #dbeafe; color: #1d4ed8; border-radius: 20px; border: 1px solid #93c5fd;
}
.mes-grupo-badge-pasado {
    font-size: .65rem; font-weight: 600; padding: .15rem .5rem;
    background: #f1f5f9; color: #94a3b8; border-radius: 20px; border: 1px solid #e2e8f0;
}
.mes-grupo-header--actual .mes-grupo-label { color: #1d4ed8; }
.mes-grupo-header--actual i { color: #1d4ed8; }
.mes-grupo-header--actual .mes-grupo-linea { background: #bfdbfe; }
.mes-grupo-header--pasado .mes-grupo-label { color: #94a3b8; }
.mes-grupo-header--pasado i { color: #94a3b8; }
.mes-grupo-header--pasado .mes-grupo-linea { background: #e2e8f0; }

/* ================================================================
   CALENDARIO
   ================================================================ */
.cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: .5rem; }
.cal-mes-titulo {
    font-size: 1.5rem; font-weight: 800; min-width: 240px; text-align: center;
    color: var(--dark-bg); letter-spacing: -.02em;
}
.cal-actions { display: flex; gap: .5rem; }

.cal-leyenda {
    display: flex;
    gap: 1.25rem;
    margin-bottom: .85rem;
    flex-wrap: wrap;
    padding: .5rem .75rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid #e8edf3;
}
.leyenda-item { display: flex; align-items: center; gap: .45rem; font-size: .83rem; color: #374151; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 4px; }
.dot--pendiente  { background: #ca8a04; }
.dot--en_proceso { background: var(--info); }
.dot--completada { background: var(--success); }
.dot--cancelada  { background: #94a3b8; }

.calendario-container {
    background: #fff;
    border-radius: 0;
    border: 2px solid #94a3b8;
    box-shadow: none;
    overflow: hidden;
}

.cal-header-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #1e293b;
}
.cal-day-header {
    padding: .65rem;
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #fff;
    border-right: 1px solid rgba(255,255,255,.2);
}
.cal-day-header:last-child { border-right: none; }

.cal-body {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 125px;
}

.cal-cell {
    overflow: hidden;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    padding: .4rem .5rem .35rem;
    vertical-align: top;
    position: relative;
    cursor: pointer;
    background: #fff;
    transition: background .15s ease;
}
.cal-cell:hover { background: #f5f8ff; }
.cal-cell--clickable { cursor: pointer; }
.cal-cell--clickable::after {
    content: '\f067'; /* fa-plus */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: .7rem;
    color: var(--primary);
    background: var(--primary-light);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}
.cal-cell--clickable:hover::after { opacity: 1; }
.cal-cell.empty { background: #fafbfc; cursor: default; opacity: .6; }
.cal-cell.today { background: #eff6ff; border-top: 2.5px solid var(--primary); }
.cal-cell:nth-child(5n) { border-right: none; }

/* Estado drag & drop */
.cal-cell.drag-over {
    background: #dbeafe !important;
    outline: 2px dashed #2563eb;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 100px rgba(37,99,235,.05);
}

.cal-day-number {
    font-size: .82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: .35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cal-cell.today .cal-day-number { color: var(--primary); }
.cal-today-dot {
    width: 30px; height: 30px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(37,99,235,.4);
}

/* Eventos: estilo stripe lateral (tipo Google Calendar) */
.calendario-evento {
    border-radius: 6px;
    padding: .42rem .6rem .5rem .8rem;
    margin-bottom: .35rem;
    cursor: grab;
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
    border-left: 4px solid transparent;
    user-select: none;
    line-height: 1.4;
}
.calendario-evento:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.13); }
.calendario-evento.dragging { opacity: .35; cursor: grabbing; transform: scale(.97); }

.calendario-evento.evento-pendiente        { background: #fef9c3; border-left-color: #ca8a04; color: #78350f; }
.calendario-evento.evento-en_proceso       { background: #dbeafe; border-left-color: #2563eb; color: #1e3a8a; }
.calendario-evento.evento-completada       { background: #dcfce7; border-left-color: #16a34a; color: #14532d; }
.calendario-evento.evento-cancelada        { background: #f1f5f9; border-left-color: #94a3b8; color: #475569; }
.calendario-evento.evento-solicitud-externa { background: #fef08a; border-left-color: #d97706; color: #78350f; border-left-width: 5px; }

.evento-tipo    { font-size: .71rem; font-weight: 700; opacity: .8; margin-bottom: .15rem; text-transform: uppercase; letter-spacing: .04em; }
.evento-colegio { font-weight: 700; font-size: .86rem; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.evento-meta    { display: flex; gap: .5rem; font-size: .71rem; opacity: .85; margin-top: .2rem; }
.evento-personas {
    display: flex;
    flex-direction: column;
    gap: .22rem;
    margin-top: .28rem;
    border-top: 1px dashed rgba(0,0,0,.12);
    padding-top: .22rem;
}
.evento-persona {
    display: flex;
    align-items: flex-start;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 500;
    opacity: .9;
    line-height: 1.35;
    word-break: break-word;
}
.evento-persona i {
    flex-shrink: 0;
    margin-top: .1rem;
    opacity: .7;
}
.evento-persona--resp { font-weight: 700; }
.evento-persona--asist { opacity: .85; }

.cal-add-btn {
    position: absolute;
    top: .35rem; right: .35rem;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: .85rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.cal-cell:hover .cal-add-btn { display: flex; }
.cal-add-btn:hover { background: var(--primary); color: #fff; transform: scale(1.15); box-shadow: 0 2px 8px rgba(37,99,235,.35); }

.cal-ver-mas {
    display: flex;
    align-items: center;
    gap: .35rem;
    width: 100%;
    margin-top: .3rem;
    padding: .3rem .6rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 700;
    color: #2563eb;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    justify-content: center;
    letter-spacing: .02em;
}
.cal-ver-mas:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ================================================================
   CALENDARIO – VISTA LISTA (móvil < 580px)
   ================================================================ */
.cal-lista-mobil {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.cal-lista-dia {
    border-bottom: 1px solid #e8edf3;
    padding: .55rem .85rem;
    transition: background .12s;
}
.cal-lista-dia--hoy  { background: #eff6ff; border-left: 3px solid var(--primary); }
.cal-lista-dia--vacio { opacity: .5; }

.cal-lista-dia-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .3rem;
}
.cal-lista-dia-num {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; font-weight: 700; color: #334155;
    flex-shrink: 0;
}
.cal-lista-dia-num--hoy {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(79,70,229,.4);
}
.cal-lista-dia-nombre {
    font-size: .75rem; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: .05em;
    flex: 1;
}
.cal-lista-agregar {
    margin-left: auto;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #c7d2fe;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.cal-lista-agregar:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.cal-lista-eventos {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding-left: 1.5rem;
}
.cal-lista-evento {
    border-left: 3px solid #e2e8f0;
    padding: .45rem .65rem;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    transition: background .12s, transform .12s;
}
.cal-lista-evento:hover { background: #eff6ff; transform: translateX(2px); }

.cal-lista-evento-hora {
    font-size: .72rem; font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    min-width: 44px;
    margin-top: .15rem;
}
.cal-lista-evento-info { flex: 1; min-width: 0; }
.cal-lista-evento-info strong {
    display: block;
    font-size: .88rem; font-weight: 700; color: #0f172a;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-lista-evento-info span {
    font-size: .73rem; color: #64748b;
}
.cal-lista-evento-resp {
    display: flex; align-items: center; gap: .3rem;
    font-size: .7rem; color: #64748b; margin-top: .15rem;
}
.cal-lista-evento-resp i { font-size: .65rem; opacity: .7; }

/* ================================================================
   GOOGLE CALENDAR – botón y enlace toast
   ================================================================ */
.gcal-btn {
    border-color: #4285F4 !important;
    color: #4285F4 !important;
}
.gcal-btn:hover {
    background: #4285F4 !important;
    color: #fff !important;
}
.gcal-toast-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #4285F4;
    color: #fff !important;
    padding: .2rem .65rem;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none !important;
    margin-top: .3rem;
    transition: background .15s;
}
.gcal-toast-link:hover { background: #3367d6; color: #fff !important; text-decoration: none !important; }

/* ================================================================
   MODAL AGENDA DEL DÍA
   ================================================================ */
.modal-box--agenda { max-width: 640px; }

.agenda-dia-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.1rem 1.25rem;
}
.agenda-dia-titulo {
    display: flex;
    align-items: center;
    gap: .85rem;
}
.agenda-dia-titulo i {
    font-size: 1.5rem;
    opacity: .85;
    color: #93c5fd;
}
.agenda-dia-titulo h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.agenda-dia-subtitulo { font-size: .8rem; color: #94a3b8; margin-top: .1rem; display: block; }
.agenda-dia-header .modal-close { color: rgba(255,255,255,.7); }
.agenda-dia-header .modal-close:hover { color: #fff; background: rgba(255,255,255,.12); }

.agenda-dia-lista {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.agenda-dia-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: .85rem 1rem;
    border-left: 4px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: background .15s;
}
.agenda-dia-item:hover { background: #f1f5f9; }

.agenda-dia-hora {
    min-width: 56px;
    font-size: .82rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding-top: .1rem;
}
.agenda-dia-hora i { font-size: .7rem; color: #94a3b8; }

.agenda-dia-info { flex: 1; min-width: 0; }
.agenda-dia-tipo   { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .15rem; }
.agenda-dia-asunto { font-size: .9rem; font-weight: 600; color: #1e293b; margin-bottom: .25rem; }
.agenda-dia-colegio {
    font-size: .78rem;
    color: #64748b;
    margin-bottom: .35rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.agenda-dia-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}
.agenda-dia-badge {
    display: inline-flex;
    align-items: center;
    padding: .18rem .55rem;
    border-radius: 20px;
    font-size: .67rem;
    font-weight: 700;
}
.agenda-dia-tag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .7rem;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: .15rem .5rem;
}

.agenda-dia-acciones {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    align-items: center;
}
.btn-agenda-accion {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: .78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.btn-agenda-ver     { background: #eff6ff; color: #2563eb; }
.btn-agenda-ver:hover { background: #2563eb; color: #fff; }
.btn-agenda-editar  { background: #f0fdf4; color: #16a34a; }
.btn-agenda-editar:hover { background: #16a34a; color: #fff; }
.btn-agenda-eliminar { background: #fff1f2; color: #dc2626; }
.btn-agenda-eliminar:hover { background: #dc2626; color: #fff; }

/* ================================================================
   MODALES
   ================================================================ */
/* SweetAlert2 SIEMPRE por encima de modales propios (modal-backdrop=2000) */
.swal2-container { z-index: 10500 !important; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
    animation: fadeIn .2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp .25s ease;
}
.modal-box--lg  { max-width: 720px; }
.modal-box--xl  { max-width: 900px; }
.modal-box--xl .modal-body { padding: 1rem 1.25rem; }
.modal-box--xl .form-row   { margin-bottom: .6rem; }
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius) var(--radius) 0 0;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; margin: 0; color: #fff; }
.modal-close { background: none; border: none; font-size: 1.1rem; color: rgba(255,255,255,.6); cursor: pointer; padding: .35rem; border-radius: 6px; transition: all var(--transition); }
.modal-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.modal-body { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-footer { padding: .75rem 1.5rem; border-top: 1px solid var(--sidebar-border); display: flex; justify-content: flex-end; gap: .5rem; background: #f8fafc; border-radius: 0 0 var(--radius) var(--radius); flex-shrink: 0; flex-wrap: wrap; }

/* ================================================================
   FORMULARIOS
   ================================================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
    margin-bottom: .85rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .85rem;
}
.form-group:last-child { margin-bottom: 0; }
.field-hint { font-size: .75rem; color: #64748b; margin-top: .15rem; }

/* ---- Sección octavos en modal colegio ---- */
.octavos-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: .85rem;
}
.octavos-header {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.octavos-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #6366f1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
}
.curso-est-input:focus {
    outline: none;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
#cursosContainer .curso-card {
    background: #fff;
    border: 1.5px solid #e0e7ff;
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
#cursosContainer .curso-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #eef2ff;
    padding: .5rem .75rem;
    gap: .5rem;
}
#cursosContainer .curso-card-head label {
    font-size: .82rem;
    font-weight: 700;
    color: #4338ca;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0;
    cursor: default;
}
#cursosContainer .curso-card-head input[type="number"] {
    width: 90px;
    text-align: center;
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
    border: 1.5px solid #c7d2fe;
    border-radius: 8px;
    padding: .25rem .4rem;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    -moz-appearance: textfield;
}
#cursosContainer .curso-card-head input[type="number"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}
#cursosContainer .curso-prof-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: .5rem .75rem;
}
#cursosContainer .curso-prof-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .28rem 0;
    border-bottom: 1px solid #f1f5f9;
}
#cursosContainer .curso-prof-row:last-child {
    border-bottom: none;
}
#cursosContainer .curso-prof-row i {
    width: 14px;
    text-align: center;
    color: #a5b4fc;
    font-size: .72rem;
    flex-shrink: 0;
}
#cursosContainer .curso-prof-row input {
    border: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    padding: .1rem .2rem !important;
    font-size: .75rem !important;
    font-weight: 400 !important;
    color: #475569 !important;
    background: transparent !important;
    outline: none !important;
    width: 100%;
    box-shadow: none !important;
}
#cursosContainer .curso-prof-row input::placeholder { color: #cbd5e1; }
#cursosContainer .curso-prof-row input:focus { color: #1e293b !important; }
#cursosContainer .curso-card:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
#cursosContainer .cursos-total {
    font-size: .8rem;
    font-weight: 600;
    color: #6366f1;
    margin-top: .4rem;
    padding: .3rem .6rem;
    background: #eef2ff;
    border-radius: 20px;
    display: inline-block;
}

/* ---- Bloque solo-lectura de curso en Cierre Visita ---- */
.cierre-curso-info {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    padding: .65rem 1rem;
    margin-top: .15rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}
.cierre-cursos-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    flex: 1;
}
.cierre-curso-chip {
    background: #dcfce7;
    color: #166534;
    font-size: .8rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.cierre-curso-chip i { color: #22c55e; font-size: .7rem; }
.cierre-curso-chip em { font-style: normal; color: #15803d; font-weight: 400; }
.cierre-curso-nombre {
    font-weight: 600;
    color: #166534;
    font-size: .9rem;
}
.cierre-curso-nombre i { margin-right: .4rem; color: #22c55e; }
.cierre-curso-total {
    font-size: 1rem;
    font-weight: 700;
    color: #15803d;
    background: #bbf7d0;
    padding: .2rem .65rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* ---- Checkboxes de cursos en form agendamiento ---- */
.cursos-checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .2rem;
}
.curso-checkbox-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: .4rem .75rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.curso-checkbox-item:has(input:checked) {
    border-color: #6366f1;
    background: #eef2ff;
}
.curso-checkbox-item input[type="checkbox"] {
    accent-color: #6366f1;
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.curso-cb-nombre {
    font-weight: 600;
    font-size: .85rem;
    color: #1e293b;
}
.curso-cb-est {
    font-size: .75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: .1rem .4rem;
    border-radius: 10px;
}

/* ---- Chips de cursos en cards de agendamiento ---- */
.card-cursos-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin: .35rem 0 .1rem;
}
.card-curso-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    font-size: .78rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 20px;
}
.card-curso-chip i { color: #6366f1; font-size: .68rem; }
.card-curso-chip em { font-style: normal; font-weight: 400; color: #6366f1; }
.card-curso-total {
    margin-left: auto;
    font-size: .78rem;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    padding: .2rem .55rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* ================================================================
   ESTADÍSTICAS
   ================================================================ */
.stats-page { display: flex; flex-direction: column; gap: 1.5rem; }
.stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.kpi-card { display: flex; align-items: center; gap: 1rem; background: #fff; border-radius: 12px; padding: 1.1rem 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); border-left: 4px solid #e2e8f0; }
.kpi-card--blue   { border-color: #3b82f6; } .kpi-card--blue   .kpi-icon { background: #eff6ff; color: #3b82f6; }
.kpi-card--purple { border-color: #8b5cf6; } .kpi-card--purple .kpi-icon { background: #f5f3ff; color: #8b5cf6; }
.kpi-card--orange { border-color: #f59e0b; } .kpi-card--orange .kpi-icon { background: #fffbeb; color: #f59e0b; }
.kpi-card--green  { border-color: #10b981; } .kpi-card--green  .kpi-icon { background: #ecfdf5; color: #10b981; }
.kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.kpi-label { font-size: .82rem; font-weight: 600; color: #374151; }
.kpi-sub   { font-size: .72rem; color: #94a3b8; }
.kpi-nota  { font-size: .68rem; color: #f59e0b; margin-top: .25rem; display: flex; align-items: center; gap: .25rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stats-panel-header { padding: .75rem 1.1rem; font-weight: 700; font-size: .88rem; color: #1e293b; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: .5rem; background: #f8fafc; }
.stats-panel-badge { margin-left: auto; background: #6366f1; color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 20px; min-width: 20px; text-align: center; }
.stats-panel-body { padding: 1rem 1.1rem; }
.stats-panel-body--fill { padding: 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.stats-panel { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; display: flex; flex-direction: column; }
.stats-panel--full { grid-column: 1 / -1; }
.stats-panel--wide { grid-column: span 2; }
.stats-empty { color: #94a3b8; font-size: .85rem; text-align: center; padding: 1.5rem 0; }

/* Top colegios - tarjetas */
.top-colegios-grid { display: flex; flex-direction: column; gap: .6rem; }
.top-colegio-card { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.top-colegio-header { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.top-colegio-nombre { font-weight: 700; font-size: .9rem; color: #1e293b; }
.top-colegio-ciudad { font-size: .75rem; color: #94a3b8; }
.top-colegio-ciudad i { margin-right: .2rem; }
.top-colegio-stats { display: none; }
.top-colegio-info-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.top-colegio-stat { font-size: .78rem; color: #475569; background: #fff; border: 1px solid #e2e8f0; padding: .2rem .55rem; border-radius: 20px; display: flex; align-items: center; gap: .3rem; }
.top-colegio-stat i { font-size: .7rem; color: #94a3b8; }
.top-colegio-stat--green { color: #15803d; background: #f0fdf4; border-color: #86efac; }
.top-colegio-stat--green i { color: #22c55e; }
.top-colegio-cursos { display: flex; flex-wrap: wrap; gap: .35rem; }
.top-colegio-curso-chip { display: inline-flex; align-items: center; gap: .3rem; background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 20px; }
.top-colegio-curso-chip i { color: #6366f1; font-size: .65rem; }
.top-colegio-curso-chip em { font-style: normal; font-weight: 400; color: #6366f1; }

.ranking-list { display: flex; flex-direction: column; flex: 1; justify-content: space-evenly; gap: 0; }
.ranking-item { display: flex; align-items: center; gap: .75rem; }
.ranking-pos  { width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9; font-size: .72rem; font-weight: 700; color: #64748b; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-size: .82rem; font-weight: 600; color: #1e293b; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-bar-wrap { height: 12px; background: #e2e8f0; border-radius: 6px; }
.ranking-bar { height: 12px; background: #3b82f6; border-radius: 6px; transition: width .4s; }
.ranking-value { font-size: .78rem; color: #64748b; white-space: nowrap; }

.stats-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.stats-table th { text-align: left; padding: .4rem .6rem; font-size: .72rem; text-transform: uppercase; color: #94a3b8; border-bottom: 1px solid #f1f5f9; }
.stats-table td { padding: .45rem .6rem; color: #334155; border-bottom: 1px solid #f8fafc; }
.stats-table tr:last-child td { border-bottom: none; }

.tipo-stat-list { display: flex; flex-direction: column; flex: 1; justify-content: space-evenly; }
.tipo-stat-item { display: flex; align-items: center; gap: .75rem; margin-bottom: 0; }
.tipo-stat-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tipo-stat-info { flex: 1; min-width: 0; }
.tipo-stat-name { font-size: .8rem; font-weight: 600; color: #1e293b; margin-bottom: .2rem; }
.tipo-stat-bar-wrap { height: 12px; background: #e2e8f0; border-radius: 6px; }
.tipo-stat-bar { height: 12px; border-radius: 6px; transition: width .4s; }
.tipo-stat-count { font-size: .78rem; color: #64748b; white-space: nowrap; }
.tipo-stat-count small { color: #94a3b8; }

.bar-chart { display: flex; align-items: flex-end; gap: .5rem; height: 150px; overflow-x: auto; padding-bottom: .5rem; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1; min-width: 40px; }
.bar-value { font-size: .7rem; font-weight: 700; color: #3b82f6; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: #3b82f6; border-radius: 4px 4px 0 0; min-height: 4px; transition: height .4s; }
.bar-label { font-size: .65rem; color: #94a3b8; text-align: center; white-space: nowrap; }

/* ---- Línea de tiempo de visitas por mes ---- */
.timeline-meses { display: flex; flex-direction: column; gap: 1rem; }
.timeline-mes { border-left: 3px solid #e0e7ff; padding-left: 1rem; }
.timeline-mes-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.timeline-mes-label { font-weight: 700; font-size: .9rem; color: #1e293b; }
.timeline-mes-badge { background: #eef2ff; color: #4f46e5; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 20px; }
.timeline-visitas { display: flex; flex-direction: column; gap: .35rem; }
.timeline-visita-item { display: flex; align-items: center; gap: .75rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: .45rem .75rem; }
.timeline-visita-fecha { font-size: .8rem; font-weight: 700; color: #6366f1; background: #eef2ff; border-radius: 6px; padding: .1rem .4rem; min-width: 26px; text-align: center; }
.timeline-visita-info { flex: 1; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.timeline-visita-colegio { font-weight: 600; font-size: .85rem; color: #1e293b; }
.timeline-visita-curso { font-size: .75rem; color: #6366f1; background: #eef2ff; border: 1px solid #c7d2fe; padding: .1rem .4rem; border-radius: 20px; }
.timeline-visita-tipo { font-size: .72rem; color: #64748b; white-space: nowrap; background: #f1f5f9; padding: .15rem .5rem; border-radius: 20px; }
.timeline-visita-hora { font-size: .72rem; color: #0ea5e9; background: #e0f2fe; border: 1px solid #bae6fd; padding: .1rem .4rem; border-radius: 20px; white-space: nowrap; }
.timeline-visita-hora i { margin-right: .2rem; }
.timeline-visita-resp { font-size: .72rem; color: #7c3aed; background: #f5f3ff; border: 1px solid #ddd6fe; padding: .1rem .45rem; border-radius: 20px; white-space: nowrap; }
.timeline-visita-resp i { margin-right: .2rem; }
.timeline-visita-asistentes { font-size: .72rem; color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; padding: .1rem .45rem; border-radius: 20px; }
.timeline-visita-asistentes i { margin-right: .2rem; }
.timeline-visita-curso em.est-count { font-style: normal; font-size: .68rem; color: #7c3aed; margin-left: .3rem; }
.timeline-visita-total-est { font-size: .72rem; color: #059669; background: #d1fae5; border: 1px solid #6ee7b7; padding: .1rem .45rem; border-radius: 20px; font-weight: 600; }
.timeline-visita-total-est i { margin-right: .2rem; }
.timeline-visita-sin-est { font-size: .7rem; color: #b45309; background: #fef3c7; border: 1px solid #fcd34d; padding: .1rem .45rem; border-radius: 20px; }
.timeline-visita-sin-est i { margin-right: .2rem; }

label {
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
    padding: .6rem .85rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    transition: border var(--transition), box-shadow var(--transition);
    background: #fff;
    width: 100%;
    color: #1e293b;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { resize: vertical; min-height: 80px; }

.field-error { font-size: .75rem; color: var(--danger); }

/* ================================================================
   DETALLE MODAL CONTENIDO
   ================================================================ */
.detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: 1.25rem;
}
.detalle-item {
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 10px;
    padding: .7rem .9rem;
}
.detalle-item label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .3rem;
}
.detalle-item p { font-size: .92rem; color: #1e293b; font-weight: 500; margin: 0; }

/* Selector de estado inline */
.detalle-item--estado {
    background: #eff6ff;
    border-color: #bfdbfe;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
}
.detalle-item--estado label { margin-bottom: 0; color: #1d4ed8; }
.estado-inline { display: flex; align-items: center; gap: .5rem; }
.estado-select {
    padding: .42rem .75rem;
    border: 1.5px solid #93c5fd;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.estado-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.btn-estado-guardar {
    height: 34px;
    padding: 0 .9rem;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.btn-estado-guardar:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.detalle-full { grid-column: 1 / -1; }

.detalle-section { margin-top: .85rem; }
.detalle-section-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .72rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .45rem;
    padding-bottom: .35rem;
    border-bottom: 2px solid #f1f5f9;
}
.detalle-section-title i {
    width: 20px; height: 20px;
    background: #f1f5f9;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
    color: var(--primary);
    flex-shrink: 0;
}

.participante-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.participante-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .4rem .75rem;
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid var(--sidebar-border);
    transition: background .15s;
    width: fit-content;
}
.participante-item:hover { background: #f1f5f9; }
.participante-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--dark-bg); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.participante-nombre { font-size: .88rem; font-weight: 600; }
.participante-rol { font-size: .72rem; color: var(--sidebar-muted); text-transform: capitalize; }

/* Historial timeline */
.historial-list { display: flex; flex-direction: column; position: relative; padding-left: 1.5rem; }
.historial-list::before {
    content: '';
    position: absolute;
    left: .55rem;
    top: .5rem;
    bottom: .5rem;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}
.historial-item {
    position: relative;
    padding: .5rem .75rem .5rem .9rem;
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 8px;
    margin-bottom: .45rem;
}
.historial-item::before {
    content: '';
    position: absolute;
    left: -1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #bfdbfe;
}
.historial-fecha { font-size: .73rem; color: var(--sidebar-muted); margin-bottom: .2rem; }
.historial-texto { font-size: .83rem; color: #334155; line-height: 1.45; }

/* ================================================================
   LOADING / EMPTY STATES
   ================================================================ */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--sidebar-muted);
    font-size: .9rem;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--sidebar-muted);
}
.empty-state i { font-size: 2rem; margin-bottom: .5rem; display: block; opacity: .4; }
.empty-state p { font-size: .875rem; }

.empty-state-full {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--sidebar-muted);
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--sidebar-border);
}
.empty-state-full i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: .3; }
.empty-state-full h3 { font-size: 1.1rem; font-weight: 600; color: #334155; margin-bottom: .5rem; }
.empty-state-full p { margin-bottom: 1.25rem; }

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
#toastContainer {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}

.toast-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: .85rem 1.1rem;
    min-width: 280px;
    max-width: 360px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    pointer-events: all;
    animation: toastIn .3s ease;
}
.toast-item.toast-out { animation: toastOut .3s ease forwards; }

@keyframes toastIn  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

.toast-item--success { border-left-color: var(--success); }
.toast-item--error   { border-left-color: var(--danger); }
.toast-item--warning { border-left-color: var(--warning); }
.toast-item--info    { border-left-color: var(--info); }

.toast-icon { font-size: 1rem; flex-shrink: 0; padding-top: .1rem; }
.toast-item--success .toast-icon { color: var(--success); }
.toast-item--error   .toast-icon { color: var(--danger); }
.toast-item--warning .toast-icon { color: var(--warning); }
.toast-item--info    .toast-icon { color: var(--info); }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: .82rem; font-weight: 700; color: #0f172a; margin-bottom: .1rem; }
.toast-msg   { font-size: .78rem; color: #64748b; }

/* ================================================================
   LOGIN  —  Diseño split-screen profesional
   ================================================================ */

/* ── Body ── */
.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #0f172a;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    overflow: hidden;
}

/* ── Partículas de fondo ── */
.login-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.login-particles span {
    position: absolute;
    display: block;
    border-radius: 50%;
    opacity: 0;
    animation: lp-float 18s infinite ease-in-out;
}
.login-particles span:nth-child(1)  { width:340px; height:340px; background:radial-gradient(circle,rgba(79,70,229,.25),transparent 70%); top:-80px;  left:-80px;  animation-delay:0s;  animation-duration:20s; }
.login-particles span:nth-child(2)  { width:260px; height:260px; background:radial-gradient(circle,rgba(37,99,235,.2),transparent 70%);  top:60%;   left:15%;   animation-delay:4s;  animation-duration:22s; }
.login-particles span:nth-child(3)  { width:200px; height:200px; background:radial-gradient(circle,rgba(139,92,246,.2),transparent 70%); top:20%;   right:5%;   animation-delay:2s;  animation-duration:16s; }
.login-particles span:nth-child(4)  { width:180px; height:180px; background:radial-gradient(circle,rgba(16,185,129,.15),transparent 70%);bottom:5%; right:20%;  animation-delay:6s;  animation-duration:24s; }
.login-particles span:nth-child(5)  { width:120px; height:120px; background:radial-gradient(circle,rgba(236,72,153,.15),transparent 70%); top:40%;   left:55%;   animation-delay:8s;  animation-duration:19s; }
.login-particles span:nth-child(6)  { width: 80px; height: 80px; background:radial-gradient(circle,rgba(255,255,255,.06),transparent 70%);top:75%;   left:40%;   animation-delay:1s;  animation-duration:14s; }
.login-particles span:nth-child(7)  { width:150px; height:150px; background:radial-gradient(circle,rgba(79,70,229,.18),transparent 70%); bottom:15%;left:5%;    animation-delay:10s; animation-duration:21s; }
.login-particles span:nth-child(8)  { width:220px; height:220px; background:radial-gradient(circle,rgba(37,99,235,.12),transparent 70%); top:10%;   left:30%;   animation-delay:5s;  animation-duration:26s; }

@keyframes lp-float {
    0%   { opacity:0;   transform: translateY(0)    scale(1);   }
    20%  { opacity:1; }
    50%  { opacity:.7;  transform: translateY(-40px) scale(1.06); }
    80%  { opacity:1; }
    100% { opacity:0;   transform: translateY(0)    scale(1);   }
}

/* ── Layout split ── */
.login-page {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ──────────────────────────────────────
   Panel izquierdo – branding
   ────────────────────────────────────── */
.login-left {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 50%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
}

/* Decoraciones geométricas */
.login-left__deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.login-left__deco--1 {
    width: 520px; height: 520px;
    border: 1.5px solid rgba(79,70,229,.18);
    top: -180px; left: -180px;
    animation: lp-spin 40s linear infinite;
}
.login-left__deco--2 {
    width: 380px; height: 380px;
    border: 1.5px solid rgba(37,99,235,.14);
    bottom: -140px; right: -100px;
    animation: lp-spin 55s linear infinite reverse;
}
.login-left__deco--3 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(79,70,229,.15) 0%, transparent 70%);
    top: 45%; left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes lp-spin {
    to { transform: rotate(360deg); }
}

.login-left__inner {
    position: relative;
    z-index: 2;
    max-width: 380px;
    text-align: center;
    color: #fff;
}

/* Logo izquierdo */
.login-left__logo {
    width: 130px;
    height: 130px;
    margin: 0 auto 1.5rem;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.login-left__logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.35));
}

@keyframes lp-pulse {
    0%, 100% { box-shadow: 0 12px 40px rgba(79,70,229,.5), 0 0 0 8px rgba(79,70,229,.1); }
    50%       { box-shadow: 0 16px 50px rgba(79,70,229,.65), 0 0 0 14px rgba(79,70,229,.07); }
}

.login-left__name {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -.4px;
    margin-bottom: .5rem;
    background: linear-gradient(90deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-left__tagline {
    font-size: .9rem;
    color: rgba(255,255,255,.55);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

/* Lista de características */
.login-features {
    list-style: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: .85rem;
    font-size: .875rem;
    color: rgba(255,255,255,.75);
    font-weight: 400;
    animation: lp-slide-in .5s ease both;
}
.login-features li:nth-child(1) { animation-delay: .1s; }
.login-features li:nth-child(2) { animation-delay: .2s; }
.login-features li:nth-child(3) { animation-delay: .3s; }
.login-features li:nth-child(4) { animation-delay: .4s; }

@keyframes lp-slide-in {
    from { opacity:0; transform: translateX(-16px); }
    to   { opacity:1; transform: translateX(0); }
}

.lf-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(79,70,229,.2);
    border: 1px solid rgba(79,70,229,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: #a5b4fc;
}

/* ──────────────────────────────────────
   Panel derecho – formulario
   ────────────────────────────────────── */
.login-right {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    position: relative;
}

/* Degradado superior decorativo */
.login-right::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #2563eb, #10b981);
}

.login-right__inner {
    width: 100%;
    max-width: 400px;
    animation: lp-fade-up .55s ease both;
}

@keyframes lp-fade-up {
    from { opacity:0; transform: translateY(22px); }
    to   { opacity:1; transform: translateY(0); }
}

/* Logo móvil (oculto en desktop) */
.login-mobile-brand {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}
.login-mobile-brand__icon {
    width: 110px; height: 110px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.login-mobile-brand__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
}

/* Encabezado del formulario */
.login-form-head {
    margin-bottom: 2rem;
}
.login-form-head h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.5px;
    margin-bottom: .35rem;
}
.login-form-head p {
    font-size: .875rem;
    color: #64748b;
}

/* Alerta de error */
.login-alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    border-radius: 10px;
    padding: .8rem 1rem;
    font-size: .845rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.4rem;
    animation: lp-shake .35s ease;
}
@keyframes lp-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* Grupos de campo */
.lf-group {
    margin-bottom: 1.25rem;
}
.lf-group label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .45rem;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.lf-input-wrap {
    position: relative;
}
.lf-input-icon {
    position: absolute;
    left: .95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: .875rem;
    pointer-events: none;
    transition: color .2s;
}
.lf-input-wrap:focus-within .lf-input-icon {
    color: #4f46e5;
}

.lf-input-wrap input {
    width: 100%;
    padding: .78rem 2.8rem .78rem 2.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.lf-input-wrap input::placeholder { color: #cbd5e1; }
.lf-input-wrap input:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79,70,229,.1);
}
.lf-input-wrap input:focus + .lf-input-icon,
.lf-input-wrap:focus-within .lf-input-icon { color: #4f46e5; }

/* Botón ojo */
.lf-eye-btn {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: .9rem;
    padding: .3rem;
    border-radius: 6px;
    transition: color .2s, background .2s;
}
.lf-eye-btn:hover {
    color: #4f46e5;
    background: rgba(79,70,229,.08);
}

/* Botón submit */
.btn-login {
    width: 100%;
    margin-top: 1.5rem;
    padding: .875rem 1rem;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .975rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    transition: transform .15s, box-shadow .15s, background .2s;
    box-shadow: 0 6px 20px rgba(0,0,0,.3);
    letter-spacing: .2px;
}
.btn-login__text,
.btn-login__loading {
    display: flex;
    align-items: center;
    gap: .55rem;
}
.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #1e293b;
    box-shadow: 0 10px 28px rgba(0,0,0,.4);
}
.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.btn-login:disabled {
    opacity: .75;
    cursor: not-allowed;
    transform: none;
}

/* Footer copyright */
.login-copy {
    font-size: .78rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 2rem;
    line-height: 1.7;
}
.login-copy strong { color: #64748b; font-weight: 600; }
.login-copy a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}
.login-copy a:hover { color: #2563eb; text-decoration: underline; }

/* ──────────────────────────────────────
   RESPONSIVE LOGIN
   ────────────────────────────────────── */
@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; }

    .login-left { display: none; }

    .login-right {
        min-height: 100vh;
        background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
        padding: 2rem 1.25rem;
    }
    .login-right::before { background: linear-gradient(90deg, #4f46e5, #10b981); }

    .login-right__inner { max-width: 440px; margin: auto; }

    .login-mobile-brand { display: flex; color: #fff; font-size: 1rem; }
    .login-form-head h1 { color: #fff; font-size: 1.5rem; }
    .login-form-head p  { color: rgba(255,255,255,.55); }

    .lf-group label { color: rgba(255,255,255,.75); }

    .lf-input-wrap input {
        background: rgba(255,255,255,.07);
        border-color: rgba(255,255,255,.12);
        color: #fff;
    }
    .lf-input-wrap input::placeholder { color: rgba(255,255,255,.25); }
    .lf-input-wrap input:focus {
        background: rgba(255,255,255,.1);
        border-color: #818cf8;
        box-shadow: 0 0 0 4px rgba(129,140,248,.15);
    }
    .lf-input-icon { color: rgba(255,255,255,.35); }
    .lf-input-wrap:focus-within .lf-input-icon { color: #818cf8; }
    .lf-eye-btn { color: rgba(255,255,255,.4); }
    .lf-eye-btn:hover { color: #818cf8; background: rgba(129,140,248,.12); }

    .login-alert {
        background: rgba(239,68,68,.12);
        border-color: rgba(239,68,68,.35);
        border-left-color: #ef4444;
        color: #fca5a5;
    }

    .login-copy { color: rgba(255,255,255,.3); }
    .login-copy strong { color: rgba(255,255,255,.55); }
    .login-copy a { color: #818cf8; }
    .login-copy a:hover { color: #a5b4fc; }
    .login-mobile-brand__img { filter: drop-shadow(0 4px 16px rgba(0,0,0,.4)); }
}

@media (max-width: 480px) {
    .login-right { padding: 1.25rem .9rem; }
    .login-mobile-brand__icon { width: 90px; height: 90px; }
    .login-form-head h1 { font-size: 1.3rem; }
}

/* ================================================================
   RESPONSIVE – SISTEMA COMPLETO
   No se modifica nada del diseño desktop (≥ 1024px)
   ================================================================ */

/* ── Tablet ancha (≤ 1024px) ─────────────────────────────── */
@media (max-width: 1024px) {
    /* Sidebar se colapsa para ganar espacio */
    .sidebar {
        width: var(--sidebar-w-collapsed);
    }
    .sidebar .sidebar-title span,
    .sidebar .sidebar-section-title,
    .sidebar-menu a span,
    .sidebar-logo-center,
    .sidebar-user-info { display: none; }
    .sidebar-toggle-btn { display: none; }
    .main-content { margin-left: var(--sidebar-w-collapsed); }

    /* Tabla con scroll horizontal */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Modales más anchos pero con scroll */
    .modal-box--xl { max-width: 98vw; }
    .modal-box--lg { max-width: 96vw; }

    /* Reporte */
    .rpt-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet (≤ 768px): sidebar overlay ──────────────────── */
@media (max-width: 768px) {
    /* Sidebar fuera de pantalla por defecto */
    .sidebar {
        width: var(--sidebar-w) !important;
        transform: translateX(-100%);
        transition: transform var(--transition);
    }
    .sidebar .sidebar-title span,
    .sidebar .sidebar-section-title,
    .sidebar-menu a span,
    .sidebar-logo-center,
    .sidebar-user-info { display: block !important; }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }

    .main-content { margin-left: 0 !important; }
    .mobile-menu-btn { display: flex; }
    .top-user-badge { display: none; }

    /* Page content con menos padding */
    .page-content { padding: 1rem 1rem 2.5rem; }

    /* Toolbar: botones debajo del filtro */
    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: .6rem;
    }
    .toolbar-right {
        flex-wrap: wrap;
        gap: .4rem;
    }
    .toolbar-right .btn { flex: 1; justify-content: center; }
    .search-form { width: 100%; }
    .search-wrap  { flex: 1; }
    .search-input { width: 100%; }
    .filter-select { flex: 1; }

    /* Formularios: una sola columna */
    .form-row               { grid-template-columns: 1fr; }
    .form-row--3            { grid-template-columns: 1fr; }
    .form-row .form-group[style*="grid-column"] { grid-column: auto !important; }

    /* Dashboard */
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-hello { padding: 1.25rem 1.25rem; }
    .dashboard-hello h2 { font-size: 1.4rem; }
    .dashboard-hello p  { font-size: .88rem; }
    .week-panel > .panel-header { padding: .85rem 1rem; flex-wrap: wrap; gap: .5rem; }
    .week-panel > .panel-header h3 { font-size: .95rem; }
    .week-body { padding: .75rem; }
    .week-grid { gap: .4rem; grid-template-columns: repeat(3, minmax(0,1fr)); }
    .mis-agenda-list { grid-template-columns: 1fr; }
    .mis-agenda-item { flex-direction: row; }
    .mis-agenda-titulo { flex-wrap: wrap; }
    .mis-agenda-titulo strong { white-space: normal; flex-basis: 100%; }

    /* Estadísticas */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-panel--wide { grid-column: span 2; }

    /* Reporte */
    .rpt-kpis { grid-template-columns: repeat(2, 1fr); }
    .rpt-doc  { padding: 1.25rem 1rem; }
    .rpt-table thead th:nth-child(7),
    .rpt-table tbody td:nth-child(7) { display: none; } /* ocultar col participantes */

    /* Agendamientos */
    .agendamientos-grid { grid-template-columns: 1fr; }

    /* Cards de agendamiento: compactar elementos */
    .agendamiento-card { padding: .85rem 1rem; gap: .45rem; }
    .agendamiento-card-header { flex-wrap: wrap; gap: .35rem; }
    .agendamiento-card-meta { gap: .3rem .6rem; }
    .agendamiento-card-footer { flex-direction: column; align-items: stretch; gap: .5rem; }
    .agendamiento-card-actions { justify-content: flex-end; flex-wrap: wrap; gap: .3rem; }
    .agendamiento-card-actions .btn { font-size: .78rem; padding: .35rem .7rem; }
    .card-cursos-row { flex-wrap: wrap; gap: .3rem; }
    .agendamiento-personas-lista { font-size: .8rem; }

    /* Detalle */
    .detalle-grid { grid-template-columns: 1fr; }

    /* Modales full-width */
    .modal-box, .modal-box--lg, .modal-box--xl {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }
    .modal-backdrop { align-items: flex-end !important; }

    /* Disponibilidad equipo */
    .equipo-bloque { font-size: .7rem; }
    .disp-equipo-grid { gap: .5rem; }
    .disp-day-card { min-height: 160px; }

    /* Calendario – tablet: reducir celdas */
    .cal-header-row,
    .cal-body {
        grid-template-columns: repeat(5, 1fr);
        font-size: .72rem;
    }
    .cal-day-header { padding: .4rem .3rem; font-size: .65rem; }
    .cal-body { grid-auto-rows: 100px; }
    .calendario-evento { padding: .3rem .45rem .3rem .6rem; margin-bottom: .25rem; }
    .evento-personas { display: none; }

    /* Tablas: scroll horizontal obligatorio */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 600px; }

    /* Cursos en modal colegio */
    #cursosContainer { display: flex; flex-wrap: wrap; gap: .5rem; }
    #cursosContainer .curso-card { min-width: 140px; flex: 1 1 140px; }
}

/* ── Móvil (≤ 480px) ─────────────────────────────────────── */
@media (max-width: 480px) {
    .page-content { padding: .75rem .75rem 2rem; }

    /* Stats: una columna */
    .stats-grid { grid-template-columns: 1fr; }
    .stats-panel--wide { grid-column: span 1; }

    /* Top header más compacto */
    .top-header { padding: 0 .85rem; }
    .page-heading { font-size: .9rem; }

    /* Botones más pequeños */
    .btn { font-size: .8rem; padding: .45rem .75rem; }
    .btn-sm { font-size: .72rem; padding: .3rem .5rem; }

    /* Modales */
    .modal-box, .modal-box--lg, .modal-box--xl { max-height: 97vh; }
    .modal-body { padding: .85rem 1rem; }
    .modal-footer { padding: .6rem 1rem; }

    /* Reporte KPIs: 2 columnas en móvil */
    .rpt-kpis { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .rpt-kpi-num { font-size: 1.5rem !important; }
    .rpt-doc  { padding: .9rem .75rem; }

    /* Dashboard en móvil pequeño */
    .dashboard-hello { padding: 1rem; }
    .dashboard-hello h2 { font-size: 1.15rem; }
    .dashboard-hello p  { font-size: .8rem; }
    .week-body { padding: .5rem; }
    .week-grid { grid-template-columns: 1fr; }
    .week-visit { padding: .35rem .4rem; }
    .week-visit-time { font-size: .68rem; }
    .week-visit-place { font-size: .72rem; }
    .week-day-head { padding: .4rem .5rem; }
    .week-day-num { font-size: .9rem; }
    .mis-agenda-fecha .dia { font-size: 1.1rem; }
    .mis-agenda-titulo { font-size: .82rem; }
    .mis-agenda-meta { font-size: .72rem; }

    /* Cards agendamiento en móvil pequeño */
    .agendamiento-card { padding: .7rem .85rem; }
    .agendamiento-card-title { font-size: .88rem; }
    .agendamiento-tipo { font-size: .72rem; }
    .agendamiento-card-meta { font-size: .72rem; }
    .badge { font-size: .65rem; padding: .15rem .45rem; }

    /* Calendario: en móvil JS renderiza vista lista, estilos base */
    .calendario-container { border-width: 1px; }
    .cal-toolbar { flex-direction: column; align-items: stretch; gap: .5rem; }
    .cal-nav { justify-content: center; }
    .cal-mes-titulo { min-width: unset; font-size: 1.2rem; }
    .cal-actions { justify-content: center; }
    .cal-leyenda { gap: .65rem; font-size: .75rem; }

    /* Disponibilidad: compactar tarjetas en móvil */
    .disp-day-card { min-height: 120px; }
    .disp-day-head { font-size: .82rem; padding: .5rem .75rem; }

    /* Search bar ocupar todo */
    .search-wrap, .search-input { width: 100% !important; }

    /* Chips leyenda equipo: más pequeños */
    .leyenda-usuario { font-size: .7rem; padding: .2rem .5rem; }
}

/* ── Botón hamburguesa solo en móvil (ya existe, refuerzo) ── */
@media (min-width: 769px) {
    .mobile-menu-btn { display: none !important; }
    .sidebar-overlay { display: none !important; }
}

/* ========== Radio tile (modal cierre) ========== */
.radio-tile { display:inline-flex; align-items:center; gap:.45rem; padding:.55rem .9rem; border:2px solid #e2e8f0; border-radius:8px; cursor:pointer; background:#fff; transition:all .15s; user-select:none; font-weight:500; color:#334155; }
.radio-tile:hover { border-color:#cbd5e1; background:#f8fafc; }
.radio-tile input[type=radio] { margin:0; accent-color: var(--primary); }
.radio-tile:has(input:checked) { border-color: var(--primary); background:#eef2ff; color:#1e293b; }

/* ========== Toggle switch (configuración) ========== */
.toggle-group { display:flex; align-items:center; gap:.9rem; margin:.4rem 0; }
.toggle-switch { position:relative; display:inline-block; width:48px; height:26px; flex-shrink:0; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider {
    position:absolute; cursor:pointer; inset:0; border-radius:13px;
    background:#cbd5e1; transition:background .25s;
}
.toggle-slider::before {
    content:''; position:absolute; width:20px; height:20px; border-radius:50%;
    left:3px; bottom:3px; background:#fff;
    box-shadow:0 1px 4px rgba(0,0,0,.2); transition:transform .25s;
}
.toggle-switch input:checked + .toggle-slider { background:#10b981; }
.toggle-switch input:checked + .toggle-slider::before { transform:translateX(22px); }
.toggle-label { font-size:.9rem; font-weight:600; color:#475569; }

/* ========== Drop zone logo ========== */
#dropZone:hover { border-color:#3b82f6 !important; background:#eff6ff !important; }
.btn-outline-danger {
    background:transparent; color:#ef4444; border:1.5px solid #ef4444;
    padding:.4rem .85rem; border-radius:6px; font-size:.82rem; cursor:pointer;
    transition:background .15s,color .15s;
}
.btn-outline-danger:hover { background:#ef4444; color:#fff; }
