:root{
  --navy:#0D1F3C;--navy2:#162D55;--navy3:#1E3A6A;
  --gold:#D4A017;--gold2:#F0C040;--gold-pale:#FDF5DC;
  --white:#FFFFFF;--off:#F7F5EF;--surface:#FFFFFF;
  --border:#D8D4C8;--text:#0D1F3C;--muted:#5A6478;
  --green:#1A5C38;--green-l:#E3F5EC;--red:#8B1A1A;--red-l:#FDF0F0;
  --radius:10px;--shadow:0 4px 20px rgba(13,31,60,.10);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Source Sans 3',sans-serif;background:var(--off);min-height:100vh;display:flex;flex-direction:column;align-items:center}

header{width:100%;background:var(--navy);border-bottom:3px solid var(--gold);padding:0 2rem;height:66px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100}
.logo{display:flex;align-items:center;gap:12px}
.logo-img{width:44px;height:44px;border-radius:50%;border:2px solid var(--gold);overflow:hidden;display:flex;align-items:center;justify-content:center;background:var(--navy2)}
.logo-img img{width:100%;height:100%;object-fit:cover}
.logo-fb{font-family:'Playfair Display',serif;font-size:14px;font-weight:700;color:var(--gold2)}
.logo-name{font-family:'Playfair Display',serif;color:#fff;font-size:15px;font-weight:600}
.logo-sub{font-size:11px;color:var(--gold2);text-transform:uppercase;letter-spacing:.08em}
.user-badge{display:none;align-items:center;gap:8px;font-size:13px;color:rgba(255,255,255,.8)}
.user-badge.on{display:flex}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--gold);color:var(--navy);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}
#uName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.btn-out{background:none;border:1px solid rgba(212,160,23,.5);color:var(--gold2);border-radius:6px;padding:5px 12px;font-size:12px;font-family:inherit;cursor:pointer;transition:all .15s;}
.btn-out:hover{background:rgba(212,160,23,.12)}
/* Colores de ícono para las tarjetas 3, 4 y 5 (antes solo cubrías 1 y 2) */
.dash-permisos .dash-icon { background: #EEF3FB; color: var(--navy3); }
.dash-aprobar  .dash-icon { background: var(--green-l); color: var(--green); }
.dash-monitor  .dash-icon { background: #EEF3FB; color: var(--navy3); }

/* Borde de acento en hover, igual que ya haces con .dash-biblio */
.dash-permisos:hover, .dash-aprobar:hover, .dash-monitor:hover { border-color: var(--navy3); }
.dash-aprobar:hover { border-color: var(--green); }

/* Grid responsivo: 1 columna en móvil, 2 en pantallas más anchas */
@media (min-width: 601px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-card { text-align: left; display: flex; flex-direction: column; }
  .dash-icon { margin: 0 0 1rem 0; }
}
/* Clases de Navegación (Tabs) */
.nav-tabs { display: flex; gap: 8px; margin: 1.5rem 1rem 0; width: 100%; max-width: 540px; padding: 0 4px; justify-content: center; }
.btn-tab { flex: 1; padding: 11px 4px; background: #E0DDD5; border: none; color: var(--navy); font-size: 13.5px; font-weight: 600; font-family: inherit; border-radius: 8px; cursor: pointer; transition: all .15s; text-align: center; }
.btn-tab.sel { background: var(--navy); color: var(--gold2); box-shadow: var(--shadow); }
.btn-tab.btn-tab-back { background: transparent; border: 1px solid var(--border); color: var(--muted); flex: 0.5; }
.btn-tab.btn-tab-back:hover { background: #fff; color: var(--navy); border-color: var(--navy); }

/* Dashboard Grid */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
.dash-card { background: var(--surface); border: 2px solid var(--border); border-radius: 12px; padding: 2rem; text-align: center; cursor: pointer; transition: all .2s; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.dash-card:hover { transform: translateY(-3px); border-color: var(--navy); box-shadow: var(--shadow); }
.dash-card.dash-biblio:hover { border-color: var(--green); }
.dash-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; }
.dash-card:nth-child(1) .dash-icon { background: #EEF3FB; color: var(--navy); }
.dash-card:nth-child(2) .dash-icon { background: var(--green-l); color: var(--green); }
.dash-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.dash-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* --- 1. REDISEÑO DEL HERO (ARMONÍA VISUAL) --- */
.hero, .hero-biblioteca {
  width: 100%;
  background: linear-gradient(135deg, var(--navy2), var(--navy3));
  border-radius: 12px; /* Redondeado para armonizar con las demás tarjetas */
  box-shadow: 0 8px 25px rgba(13, 31, 60, 0.15); /* Elevación moderna */
  border: 1px solid rgba(212, 160, 23, 0.3); /* Borde dorado sutil */
  padding: 2rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem; /* Separación con el contenido inferior */
}

/* --- 2. TRANSICIÓN SUAVE (FADE-IN) --- */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 3. MEJORA DE SOMBRAS EN TARJETAS --- */
.card, .dash-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  box-shadow: 0 8px 30px rgba(13, 31, 60, 0.12); /* Sombra más profunda al pasar el mouse */
}
.apod-card:hover {
  border-color: var(--navy);
  box-shadow: 0 4px 12px rgba(13, 31, 60, 0.08);
}

/* --- 4. NUEVO DISEÑO DEL INPUT DE ARCHIVOS --- */
.file-custom-wrapper {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.file-custom-input {
  width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; position: absolute; z-index: -1;
}
.file-custom-label {
  display: flex; align-items: center; justify-content: center;
  background: #F0F4FA; color: var(--navy); border: 1px dashed var(--navy);
  padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-custom-label:hover, .file-custom-input:focus + .file-custom-label {
  background: var(--navy); color: #fff;
}
.hero-biblioteca h1{font-family:'Playfair Display',serif;color:#fff;font-size:22px;font-weight:600}
.hero-biblioteca p{font-size:12px;color:var(--gold2);margin-top:4px;text-transform:uppercase;letter-spacing:.07em}
.hero h1{font-family:'Playfair Display',serif;color:#fff;font-size:22px;font-weight:600}
.hero p{font-size:12px;color:var(--gold2);margin-top:4px;text-transform:uppercase;letter-spacing:.07em}

/* Main Content Area */
main{width:100%;max-width:560px;padding:1.5rem 1rem 3rem;flex:1; display:flex; flex-direction:column;}
.card{background:var(--surface);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);padding:2rem 2rem 1.75rem;position:relative}
.card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,var(--navy),var(--gold),var(--navy));border-radius:var(--radius) var(--radius) 0 0}
.card-biblioteca::before{background:linear-gradient(90deg,var(--green),var(--gold),var(--green));}

/* Stepper (Agendas) */
.stepper{display:flex;align-items:center;gap:0;margin-bottom:2rem;padding:0 4px}
.s-dot{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex-shrink:0;transition:all .3s}
.s-dot.idle{background:#1A2740;color:#5A7090;border:2px solid #2A3F60}
.s-dot.active{background:transparent;color:var(--gold2);border:2px solid var(--gold2);box-shadow:0 0 0 4px rgba(212,160,23,.15)}
.s-dot.done{background:var(--navy3);color:#fff;border:2px solid var(--navy3)}
.s-line{flex:1;height:2px;transition:background .3s}
.s-line.idle{background:#1A2740}
.s-line.done{background:var(--navy3)}

/* List Items */
.item-cita-lista { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: #fff; transition: transform 0.15s; }
.item-cita-lista:hover { transform: translateY(-1px); }
.tag-curso { font-size: 11px; font-weight: 700; background: #E0DDD5; color: var(--navy); padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.tag-estado { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; display:inline-block;}

/* Typography & Fields */
.eyebrow{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--gold);font-weight:600;margin-bottom:4px}
.sec-title{font-family:'Playfair Display',serif;font-size:20px;font-weight:600;color:var(--navy);margin-bottom:3px}
.sec-sub{font-size:13px;color:var(--muted);margin-bottom:1.6rem;line-height:1.5}
.field{margin-bottom:1rem}
.field label{display:block;font-size:12.5px;font-weight:600;color:var(--navy);margin-bottom:5px;letter-spacing:.02em}
.field input,.field select,.field textarea{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:8px;font-size:14px;font-family:inherit;color:var(--text);background:#fff;outline:none;appearance:none;box-sizing:border-box}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--gold);box-shadow:0 0 0 3px rgba(212,160,23,.15)}
.field select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235A6478' d='M6 8L1 3h10z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:32px}
.field select:disabled{background-color:#f6f5f0;color:#aaa;cursor:not-allowed}
.field textarea{resize:vertical;min-height:85px;line-height:1.5}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* Apoderados Selection */
.nivel-btns{display:flex;gap:8px;margin-bottom:1.2rem}
.btn-nivel{flex:1;padding:9px 4px;border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--navy);font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;transition:all .15s}
.btn-nivel.sel{background:var(--navy);color:var(--gold2);border-color:var(--navy)}

.apod-card{border:1px solid var(--border);border-radius:10px;padding:14px 16px;display:flex;align-items:flex-start;gap:12px;cursor:pointer;transition:all .2s;background:#fff;margin-bottom:10px}
.apod-card.sel{background:var(--gold-pale);border-color:var(--gold)}
.apod-card.disabled{opacity:.45;cursor:not-allowed}
.apod-cb{width:20px;height:20px;border:2px solid var(--border);border-radius:5px;flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:1px;transition:all .15s}
.apod-card.sel .apod-cb{background:var(--gold);border-color:var(--gold)}
.apod-cb svg{display:none}
.apod-card.sel .apod-cb svg{display:block}
.apod-tipo{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--gold);margin-bottom:2px}
.apod-nombre{font-size:14px;font-weight:600;color:var(--navy)}
.apod-detalle{font-size:12px;color:var(--muted);margin-top:1px}

/* Buttons */
.btn-primary{width:100%;padding:12px 16px;background:var(--navy);color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:600;font-family:inherit;cursor:pointer;transition:background .15s;margin-top:8px;display:flex;align-items:center;justify-content:center;gap:8px}
.btn-primary:hover{background:var(--navy2)}
.btn-primary:disabled{background:#9CA3AF;cursor:not-allowed}
.btn-back{background:none;border:1px solid var(--border);color:var(--muted);border-radius:8px;padding:9px 18px;font-size:13px;font-family:inherit;cursor:pointer;transition:all .15s}
.btn-back:hover{border-color:var(--navy);color:var(--navy)}
.btn-danger{background:#FDF0F0;border:1px solid #F5C0C0;color:var(--red);border-radius:8px;padding:9px 18px;font-size:13px;font-family:inherit;cursor:pointer;transition:all .15s;width:100%}
.btn-danger:hover{background:#F5C0C0}
.btn-row{display:flex;gap:10px;margin-top:8px}
.btn-row .btn-primary{flex:1;margin-top:0}
.btn-biblio{background:var(--green);}
.btn-biblio:hover{background:#0a361e;}

/* Alerts & UI Elements */
.alert{padding:10px 14px;border-radius:8px;font-size:13px;margin-bottom:1rem;display:flex;align-items:flex-start;gap:8px;line-height:1.4}
.alert-error{background:var(--red-l);color:var(--red);border:1px solid #F5C0C0}
.alert-ok{background:var(--green-l);color:var(--green);border:1px solid #A8DFC0}

.divider{position:relative;text-align:center;margin:1.2rem 0}
.divider::before{content:'';position:absolute;top:50%;left:0;right:0;height:1px;background:var(--border)}
.divider span{position:relative;background:var(--surface);padding:0 10px;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;font-weight:600}

/* Login specific styles */
.login-header{text-align:center;padding:2rem 0 1.5rem}
.login-logo{width:72px;height:72px;border-radius:50%;overflow:hidden;border:2px solid var(--gold);margin:0 auto 1rem;background:var(--navy);display:flex;align-items:center;justify-content:center}
.login-logo img{width:100%;height:100%;object-fit:cover}
.login-title{font-family:'Playfair Display',serif;font-size:24px;color:var(--navy);margin-bottom:5px}
.login-sub{font-size:13px;color:var(--muted);line-height:1.5}

.success-icon{width:64px;height:64px;border-radius:50%;background:var(--green-l);border:2px solid #A8DFC0;display:flex;align-items:center;justify-content:center;margin:0 auto 1.2rem}
.success-icon svg{width:28px;height:28px;stroke:var(--green)}
.success-title{font-family:'Playfair Display',serif;font-size:22px;font-weight:600;color:var(--navy);text-align:center;margin-bottom:6px}
.success-sub{font-size:13px;color:var(--muted);text-align:center;margin-bottom:1.5rem;line-height:1.5}

.checkbox-container { align-items:flex-start; gap:10px; font-size:11.5px; color:var(--muted); margin-top:10px; line-height:1.5; text-align:justify; background:#F8F9FA; padding:12px; border-radius:8px; border:1px solid var(--border); }
.checkbox-container input { margin-top:3px; cursor:pointer; }

/* Archivos Multiples Biblio */
.file-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; align-items: center; background: #fdfdfd; border: 1px solid #e8e8e8; border-radius: 8px; padding: 8px; }
.file-row input, .file-row select { padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; font-family: inherit; }
.file-row input[type="time"] { width: 90px; }
.file-row input[type="file"] { flex: 1; min-width: 180px; font-size: 12px; }
.file-row input[type="number"] { width: 75px; }
.file-row select { width: 100px; }
.btn-del-file { background: #FDF0F0; border: 1px solid #F5C0C0; color: var(--red); border-radius: 4px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

footer{width:100%;background:var(--navy);border-top:2px solid var(--gold);text-align:center;font-size:11.5px;color:rgba(255,255,255,.45);padding:14px 1rem;letter-spacing:.04em;margin-top:auto;}
footer span{color:var(--gold2)}

/* Mobile Adjustments */
@media (max-width: 600px) {
  header { padding: 0 1rem; height: 60px; }
  .logo-sub { display: none; }
  .logo-name { font-size: 13px; }
  .user-badge { font-size: 12px; gap: 6px; }
  .btn-out { padding: 5px 8px; font-size: 11px; }
  main { padding: 1rem 0.5rem 2rem; }
  .card { padding: 1.5rem 1.1rem; }
  .nav-tabs { margin: 1rem 0.5rem 0; flex-wrap:wrap; }
  .btn-tab { padding: 9px; font-size: 12.5px; flex-basis: 48%; }
  .btn-tab.btn-tab-back { flex-basis: 100%; margin-top: 4px; }
  .field-row { display: flex; flex-direction: column; gap: 0; }
  .field-row .field { margin-bottom: 1rem !important; }
  .btn-row { flex-direction: column-reverse; gap: 8px; }
  .btn-back { width: 100%; border: none; background: #F0F4FA; color: var(--navy); margin-top: 4px; padding: 11px; }
}

.cita-com { border-radius: 0; padding: 7px 11px; font-size: 12px; border-left: 3px solid; margin-top: 6px; line-height: 1.5; }
.cita-com__label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 2px; }
.cita-com__texto { font-size: 12px; }

/* Loader and Spinner */
.session-loader{position:fixed;inset:0;background:var(--off);z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}
.session-loader .spin-lg{width:44px;height:44px;border:3px solid rgba(13,31,60,.15);border-top-color:var(--navy);border-radius:50%;animation:rot .8s linear infinite}
.session-loader p{font-size:13px;color:var(--muted);letter-spacing:.02em}

.spin{width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:rot .7s linear infinite;display:inline-block}
@keyframes rot{to{transform:rotate(360deg)}}

/* Toasts */
.toast-container{position:fixed;top:16px;right:16px;z-index:10000;display:flex;flex-direction:column;gap:10px;max-width:340px;width:calc(100% - 32px)}
.toast{background:#fff;border-left:4px solid var(--navy);border-radius:8px;box-shadow:var(--shadow);padding:12px 14px;display:flex;gap:10px;align-items:flex-start;animation:toastIn .25s ease-out;cursor:pointer}
.toast.ok{border-left-color:var(--green)}
.toast.warn{border-left-color:var(--gold)}
.toast.error{border-left-color:var(--red)}
.toast-ic{font-size:16px;flex-shrink:0;margin-top:1px}
.toast-txt strong{display:block;font-size:13px;color:var(--navy);margin-bottom:2px}
.toast-txt span{font-size:12px;color:var(--muted);line-height:1.4}
@keyframes toastIn{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}
@media(max-width:600px){.toast-container{left:8px;right:8px;top:8px;max-width:none}}

/* Ocultar Vistas por defecto (las maneja JS) */
.vista { display: none; }