:root {
  --bg: #eef8fc;
  --ink: #1f2933;
  --muted: #697386;
  --primary: #2ea8d8;
  --primary-dark: #1f8ccb;
  --navy: #176b9a;
  --gold: #f2d21b;
  --card: #ffffff;
  --line: #d7edf7;
  --warning: #b45309;
  --ok: #15803d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top left, #ffffff, var(--bg) 42%, #dff3fb); color: var(--ink); }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, rgba(31,140,203,.96), rgba(46,168,216,.9)), url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"%3E%3Cg fill="none" stroke="%23ffffff" stroke-opacity=".16"%3E%3Cpath d="M0 70h140M70 0v140"/%3E%3Ccircle cx="70" cy="70" r="42"/%3E%3C/g%3E%3C/svg%3E'); }
.login-card { width: min(470px, 100%); background: rgba(255,255,255,.97); border-radius: 28px; padding: 34px; box-shadow: 0 30px 80px rgba(4,74,112,.28); border-top: 8px solid var(--gold); }
.login-logo { width: 104px; height: 104px; object-fit: contain; display: block; margin: 0 auto 18px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.12)); }
.login-copy { color: var(--muted); line-height: 1.5; }
.login-form { display: grid; gap: 14px; margin-top: 20px; }
#loginMessage { color: #b91c1c; font-weight: 800; margin: 0; }
.hero { background: linear-gradient(135deg, #1f8ccb, #2ea8d8); color: white; padding: 24px clamp(18px, 5vw, 64px); display: flex; justify-content: space-between; gap: 24px; align-items: end; box-shadow: 0 12px 30px rgba(31,140,203,.24); border-bottom: 5px solid var(--gold); }
.hero-brand { display: flex; align-items: center; gap: 18px; }
.hero-logo { width: 88px; height: 88px; object-fit: contain; background: white; border-radius: 22px; padding: 8px; box-shadow: 0 12px 24px rgba(0,0,0,.16); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; opacity: .78; font-size: 12px; margin: 0 0 8px; font-weight: 900; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 5vw, 52px); margin-bottom: 8px; line-height: .98; }
.hero p:last-child { max-width: 760px; margin-bottom: 0; opacity: .9; }
.storage-alert { margin: 14px clamp(14px, 4vw, 48px) 0; border: 1px solid #f59e0b; background: #fffbeb; color: #92400e; padding: 13px 16px; border-radius: 16px; font-weight: 900; box-shadow: 0 10px 24px rgba(146,64,14,.08); }
.user-panel { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.36); border-radius: 18px; padding: 12px; min-width: 260px; }
.user-panel strong, .user-panel span { display: block; }
.user-panel span { font-size: 13px; opacity: .8; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px clamp(14px, 4vw, 48px); background: rgba(255,255,255,.72); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
button, .button { border: 0; background: var(--primary); color: white; padding: 12px 16px; border-radius: 13px; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-block; transition: .15s ease; }
button:hover, .button:hover { transform: translateY(-1px); background: var(--primary-dark); }
.ghost, .tabs button { background: rgba(46,168,216,.09); color: var(--navy); border: 1px solid rgba(46,168,216,.24); }
.hero .ghost { color: white; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); }
.tabs button.active { background: var(--primary); color: white; box-shadow: 0 10px 22px rgba(46,168,216,.24); }
.secondary { background: #2f3a4a; }
main { padding: 28px clamp(14px, 4vw, 48px); max-width: 1280px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.card { background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 20px 50px rgba(16,105,149,.08); margin-bottom: 22px; }
.inner-card { margin-top: 24px; background: #fbfdff; }
.section-title { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 18px; }
.section-title p { color: var(--muted); margin-bottom: 0; }
.badge, .pill { background: var(--gold); color: #1f2933; padding: 6px 10px; border-radius: 999px; font-weight: 900; font-size: 12px; white-space: nowrap; }
.pill { background: #e8f7fd; color: var(--navy); }
.warning-pill { background: #fff4cc; color: #92400e; }
.holiday-pill { background: #fee2e2; color: #991b1b; }
.grid-form, .schedule-picker, .filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.filter-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.schedule-picker { margin-bottom: 18px; }
.today-schedule { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.academic-context { border: 1px dashed #aadff2; background: rgba(255,255,255,.68); border-radius: 18px; padding: 14px; margin-bottom: 18px; }
.academic-context:empty { display: none; }
.context-line { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.academic-context ul { margin: 0; padding-left: 18px; color: var(--muted); font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.calendar-card { border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, #ffffff, #f5fbff); padding: 18px; box-shadow: 0 10px 24px rgba(16,105,149,.06); }
.calendar-card h3 { margin: 0 0 10px; color: var(--navy); }
.calendar-card p { margin-bottom: 8px; }
.holiday-card { border-color: #fecaca; background: linear-gradient(180deg, #fff, #fff7f7); }
.schedule-card { border: 1px solid var(--line); background: linear-gradient(180deg, #ffffff, #f0faff); border-radius: 18px; padding: 15px; cursor: pointer; }
.schedule-card:hover, .schedule-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,168,216,.16), 0 14px 28px rgba(16,105,149,.09); }
.schedule-card.completed { border-color: #86efac; background: linear-gradient(180deg, #f0fdf4, #dcfce7); }
.schedule-card.completed strong { color: #166534; }
.schedule-card strong { display: block; margin-bottom: 6px; color: var(--navy); }
.schedule-card span { color: #374151; font-weight: 700; }
.schedule-card em { display: inline-block; margin-top: 8px; color: var(--muted); font-style: normal; font-weight: 900; font-size: 12px; }
.schedule-card.completed em { color: #15803d; }
.schedule-copy { margin-top: 10px; display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--navy); font-size: 12px; font-weight: 900; }
.schedule-copy input, .checkbox-line input { width: auto; }
.bulk-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid #bce8f8; background: #e9f8fe; color: var(--navy); border-radius: 16px; padding: 12px 14px; margin: -4px 0 18px; font-weight: 800; }
.bulk-actions span { color: var(--muted); }
.checkbox-line { display: flex; align-items: center; gap: 10px; background: #fbfdff; border: 1px dashed #aadff2; border-radius: 14px; padding: 12px 14px; }
.selected-class { background: #e9f8fe; border: 1px solid #bce8f8; color: var(--navy); border-radius: 16px; padding: 14px; font-weight: 900; }
label { display: grid; gap: 7px; font-weight: 800; color: #374151; }
input, textarea, select { width: 100%; border: 1px solid #c7e5f1; border-radius: 13px; padding: 12px 13px; font: inherit; background: #fbfdff; outline-color: var(--primary); }
select:disabled { opacity: .72; }
textarea { min-height: 96px; resize: vertical; }
.wide { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; gap: 16px; }
#formMessage { margin: 0; color: var(--ok); font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 10px 30px rgba(39,31,24,.05); }
.stat strong { font-size: 32px; display: block; color: var(--primary); }
.stat span { color: var(--muted); font-weight: 800; font-size: 13px; }
.summary { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 13px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.entry { border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; background: #fffdfb; }
.review-box { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: grid; gap: 10px; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pendiente { background: #fef3c7; color: #92400e; }
.status-aprobado { background: #dcfce7; color: #166534; }
.status-observado { background: #fee2e2; color: #991b1b; }
.report-card { overflow: hidden; }
.report-actions { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.report-header { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.report-header div { background: linear-gradient(135deg, var(--navy), var(--primary)); color: white; border-radius: 20px; padding: 18px; box-shadow: 0 12px 28px rgba(31,140,203,.18); }
.report-header span { display: block; opacity: .82; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.report-header strong { display: block; font-size: 26px; margin-top: 6px; }
.report-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.report-day { border: 1px solid var(--line); border-radius: 20px; background: #ffffff; padding: 16px; }
.report-day h3 { margin: 0 0 12px; color: var(--navy); text-transform: capitalize; }
.mini-stats { display: grid; gap: 8px; }
.mini-stats span { background: #f0faff; border-radius: 12px; padding: 9px; color: #374151; font-weight: 800; }
.mini-stats strong { color: var(--primary-dark); }
.entry-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.entry h3 { margin: 0 0 4px; }
.meta { color: var(--muted); font-size: 14px; }
.alerts { margin: 12px 0 0; padding-left: 18px; color: var(--warning); font-weight: 800; }
.ok { color: var(--ok); font-weight: 900; }
.danger { background: #991b1b; padding: 8px 10px; font-size: 12px; }
.small { padding: 8px 10px; font-size: 12px; border-radius: 10px; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; }
td input, td select { min-width: 150px; }
@media (max-width: 850px) {
  .hero { display: block; }
  .hero-brand { display: block; }
  .hero-logo { margin-bottom: 14px; }
  .user-panel { margin-top: 18px; width: 100%; }
  .grid-form, .schedule-picker, .filter-grid, .stats { grid-template-columns: 1fr; }
  .report-header { grid-template-columns: 1fr; }
  .section-title, .entry-header, .actions { display: block; }
  .button, button { width: 100%; text-align: center; margin-top: 8px; }
}
.daily-report-cover { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, #fff, #f5fbff); padding: 20px; margin-bottom: 18px; }
.daily-report-cover h2 { color: var(--navy); margin-bottom: 14px; }
.compact-report-header { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.teacher-print-section { border: 1px solid var(--line); border-radius: 22px; background: white; padding: 18px; margin-bottom: 18px; break-inside: avoid; }
.teacher-print-header, .print-entry-title, .signature-row { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.teacher-print-header { border-bottom: 2px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.teacher-print-header h3 { color: var(--navy); margin: 0 0 4px; }
.print-entry { border: 1px solid #e3f2f8; border-radius: 16px; padding: 13px; margin-bottom: 12px; background: #fffdfb; break-inside: avoid; }
.print-entry p { margin-bottom: 7px; line-height: 1.35; }
.print-entry-title { margin-bottom: 8px; }
.compact-alerts { margin-top: 6px; }
.signature-row { margin-top: 22px; padding-top: 24px; color: var(--muted); font-weight: 900; }
.signature-row span { width: 45%; border-top: 1px solid #9ca3af; padding-top: 8px; text-align: center; }
.print-document { background: white; }
.print-document main { max-width: none; padding: 24px; }
@media print {
  body { background: white !important; color: #111827; }
  .tabs, .hero, .storage-alert, .report-actions, button, .button { display: none !important; }
  main { padding: 0; max-width: none; }
  .card, .teacher-print-section, .print-entry, .daily-report-cover { box-shadow: none !important; }
  .card { border: 0; padding: 0; }
  .daily-report-cover { border: 0; padding: 0 0 10px; }
  .report-header div { background: white !important; color: #111827 !important; border: 1px solid #d1d5db; box-shadow: none; }
  .teacher-print-section { page-break-inside: avoid; break-inside: avoid; border-color: #9ca3af; }
  .print-entry { page-break-inside: avoid; break-inside: avoid; border-color: #d1d5db; }
  .pill, .badge { border: 1px solid #d1d5db; background: white !important; color: #111827 !important; }
}
.weekly-day-block { border-top: 1px dashed #c7e5f1; padding-top: 12px; margin-top: 12px; }
.weekly-day-block h4 { margin: 0 0 10px; color: var(--navy); text-transform: capitalize; }
.weekly-teacher-section { page-break-after: auto; }
@media print {
  .weekly-day-block { border-top-color: #d1d5db; }
  .weekly-day-block h4 { color: #111827; }
}
.compact-weekly-teacher-section { padding: 0; border: 0; background: transparent; }
.duplex-side { border: 1px solid var(--line); border-radius: 18px; background: white; padding: 14px; margin-bottom: 16px; break-inside: avoid; }
.compact-week-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; border-bottom: 2px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.compact-week-header h3 { margin: 0 0 3px; color: var(--navy); font-size: 22px; }
.weekly-summary-days { display: grid; gap: 10px; }
.compact-day-card { border: 1px solid #e3f2f8; border-radius: 12px; padding: 9px; background: #fffdfb; break-inside: avoid; }
.compact-day-card h4 { margin: 0 0 7px; color: var(--navy); text-transform: capitalize; font-size: 15px; }
.compact-week-table { min-width: 0; font-size: 12px; line-height: 1.25; }
.compact-week-table th, .compact-week-table td { padding: 6px; vertical-align: top; border-bottom: 1px solid #e5edf3; }
.compact-week-table th:first-child, .compact-week-table td:first-child { width: 24%; }
.compact-week-table th:nth-child(2), .compact-week-table td:nth-child(2) { width: 46%; }
.compact-week-table th:nth-child(3), .compact-week-table td:nth-child(3) { width: 30%; }
.no-day-records { margin: 0; font-weight: 800; }
.compact-signature-row { margin-top: 16px; padding-top: 20px; }
@media print {
  @page { size: letter; margin: 8mm; }
  .duplex-side { border-color: #9ca3af; box-shadow: none; border-radius: 0; min-height: 250mm; page-break-after: always; break-after: page; padding: 0; margin: 0; }
  .duplex-side:last-child { page-break-after: always; break-after: page; }
  .compact-week-header { border-bottom-color: #9ca3af; }
  .compact-week-header h3 { color: #111827; font-size: 18px; }
  .compact-day-card { border-color: #cbd5e1; padding: 6px; }
  .compact-day-card h4 { color: #111827; font-size: 13px; }
  .compact-week-table { font-size: 10px; }
  .compact-week-table th, .compact-week-table td { padding: 4px; }
  .weekly-teacher-section { border: 0; padding: 0; margin: 0; }
}
.compact-entry-list { display: grid; gap: 7px; }
.compact-entry-card { border: 1px solid #dbeaf1; border-radius: 10px; background: #ffffff; padding: 8px; break-inside: avoid; }
.compact-entry-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; color: var(--navy); font-size: 12px; margin-bottom: 5px; }
.compact-entry-body { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 11px; line-height: 1.25; }
.compact-entry-body p { margin: 0; }
.compact-entry-body p:nth-child(2), .compact-entry-body p:nth-child(3) { grid-column: 1 / -1; }
.compact-warning { color: #92400e; font-weight: 900; white-space: nowrap; }
.compact-ok { color: #166534; font-weight: 900; white-space: nowrap; }
@media print {
  .compact-entry-card { border-color: #cbd5e1; padding: 5px; }
  .compact-entry-top { color: #111827; font-size: 10px; margin-bottom: 3px; }
  .compact-entry-body { font-size: 8.8px; gap: 2px 6px; }
  .compact-warning, .compact-ok { color: #111827; }
}
