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

:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

body {
  font-family: 'Google Sans', 'Google Sans Text', Roboto, 'Segoe UI', Arial, sans-serif;
  background: #f0f4f9;
  background-image: linear-gradient(180deg, #f6f9fc 0%, #f0f4f9 40%);
  background-attachment: fixed;
  color: #202124;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TOP BAR (estilo Google Classroom) ===== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.08), 0 4px 12px 0 rgba(60, 64, 67, 0.05);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 30;
}

.menu-btn {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  color: #202124;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 11.5px;
  color: #5f6368;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1a73e8;
  background-image: linear-gradient(135deg, #1a73e8, #4285f4);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px 0 rgba(26, 115, 232, 0.4);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== LOGIN ===== */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: linear-gradient(135deg, #4285f4, #1a73e8 45%, #1557b0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#login-screen.hidden {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  padding: 32px 28px;
  text-align: center;
}

.login-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid #e8eaed;
  background: #fff;
}

.login-card h1 {
  font-size: 22px;
  color: #202124;
  margin: 8px 0 2px;
}

.login-sub {
  color: #5f6368;
  font-size: 13.5px;
  margin: 0 0 20px;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 12px;
}

.login-card label {
  font-size: 12.5px;
  color: #5f6368;
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 14.5px;
  font-family: inherit;
  box-sizing: border-box;
}

.login-card input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.login-btn {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  margin-top: 4px;
}

.login-error {
  color: #d93025;
  font-size: 13px;
  min-height: 20px;
  margin: 0 0 6px;
}

.login-hint {
  color: #80868b;
  font-size: 12.5px;
  margin: 14px 0 0;
}

body.dark .login-card {
  background: #292a2d;
}

body.dark .login-card h1 {
  color: #e8eaed;
}

body.dark .login-card input {
  background: #202124;
  border-color: #3c4043;
  color: #e8eaed;
}

body.dark .login-logo {
  border-color: #3c4043;
  background: #fff;
}

/* ===== MENÚ LATERAL IZQUIERDO ===== */
.navbar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 220px;
  z-index: 20;
  background: #fff;
  border-right: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
}

.navbar button {
  position: relative;
  border: none;
  background: transparent;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #3c4043;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.navbar button:hover {
  background: #f1f3f4;
  color: #202124;
}

.navbar button.active {
  background: #e8f0fe;
  color: #1967d2;
}

.navbar button.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1a73e8;
}

/* ===== CONTENIDO ===== */
.section {
  display: none;
}

.section.active {
  display: block;
}

main {
  margin-left: 236px;
  padding: 100px 24px 48px;
}

.section-header {
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #202124;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2::before {
  content: '';
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: #1a73e8;
}

.subtitle {
  color: #5f6368;
  font-size: 14px;
  margin-top: 4px;
}

/* ===== TARJETAS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 12px 0 rgba(60, 64, 67, 0.14);
  transform: translateY(-2px);
}

.stat-card .number {
  display: block;
  font-size: 34px;
  font-weight: 700;
  color: #1967d2;
  margin-bottom: 4px;
}

.stat-card .label {
  color: #5f6368;
  font-size: 14px;
}

.card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.06);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 2px 6px 0 rgba(60, 64, 67, 0.1);
}

.card h3 {
  color: #202124;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ===== BOTONES ===== */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  background: #f1f3f4;
  color: #3c4043;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #e8eaed;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 1px 2px 0 rgba(26, 115, 232, 0.3);
}

.btn-primary:hover {
  background: #1769d3;
  box-shadow: 0 2px 6px 0 rgba(26, 115, 232, 0.35);
}

.btn-success {
  background: #188038;
  color: #fff;
}

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

.btn-warning {
  background: #fff8e1;
  color: #b06000;
  border: 1px solid #f9ab00;
}

.btn-warning:hover {
  background: #fef7e0;
}

.btn-danger {
  background: #fce8e6;
  color: #d93025;
  border: 1px solid #f5c6c2;
}

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

.btn-outline {
  background: transparent;
  border: 1px solid #dadce0;
}

.btn-outline:hover {
  border-color: #1967d2;
  color: #1967d2;
  background: #f8fafd;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12.5px;
}

.btn-link {
  background: transparent;
  color: #1a73e8;
}

.btn-link:hover {
  background: #e8f0fe;
}

/* ===== FORMULARIOS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #5f6368;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: #202124;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-group select {
  appearance: auto;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 1px #1a73e8 inset;
}

.form-group textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.search-box {
  margin-bottom: 14px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #c5c7ca;
  border-radius: 24px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: #fafbfc;
}

.search-box input:focus {
  border-color: #1a73e8;
  background: #fff;
  box-shadow: 0 0 0 1px #1a73e8;
}

.search-box select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #c5c7ca;
  border-radius: 24px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: #fafbfc;
}

/* ===== TABLAS ===== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #5f6368;
  background: #fafbfc;
  padding: 12px 14px;
  border-bottom: 1px solid #e8eaed;
}

tbody td {
  padding: 13px 14px;
  font-size: 14px;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f7f9fc;
}

tbody tr:last-child td {
  border-bottom: none;
}

.actions {
  text-align: right;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #80868b;
  font-size: 15px;
}

.report-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.06);
}

.report-card h4 {
  color: #202124;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.report-card p {
  color: #5f6368;
  font-size: 14px;
  margin: 4px 0;
}

/* ===== BADGES / CHIPS ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f3f4;
  color: #3c4043;
}

.badge-success {
  background: #e6f4ea;
  color: #137333;
}

.badge-warning {
  background: #fef7e0;
  color: #b06000;
}

.badge-danger {
  background: #fce8e6;
  color: #c5221f;
}

.chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 5px 14px;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

/* ===== AVATAR ===== */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

/* ===== MODALES ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.6);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: 64px 16px 24px;
  overflow-y: auto;
}

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

.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px 4px rgba(60, 64, 67, 0.25);
  padding: 26px 28px;
  width: 100%;
  max-width: 600px;
}

.modal h3 {
  font-size: 20px;
  font-weight: 600;
  color: #202124;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f3f4;
}

/* ===== AULA VIRTUAL (Google Classroom) ===== */

/* Inicio: tarjetas de clases */
.aulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.class-card {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
  user-select: none;
  position: relative;
}

.class-card .class-del-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.class-card .class-del-btn:hover {
  background: rgba(0, 0, 0, 0.45);
}

.class-card:hover {
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.35), 0 4px 16px 0 rgba(60, 64, 67, 0.2);
}

.class-card .masthead {
  padding: 18px 18px 26px;
  color: #fff;
  min-height: 96px;
}

.class-card .masthead h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
}

.class-card .masthead p {
  font-size: 13.5px;
  opacity: 0.92;
}

.class-card .class-info {
  padding: 14px 18px;
}

.class-card .class-meta {
  display: flex;
  justify-content: space-between;
  color: #5f6368;
  font-size: 13px;
  margin-top: 8px;
}

/* Vista interna del aula */
.aula-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.aula-banner {
  border-radius: 8px;
  color: #fff;
  padding: 22px 24px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.aula-banner h2 {
  font-size: 26px;
  font-weight: 700;
}

.aula-banner .banner-sub {
  opacity: 0.92;
  font-size: 14px;
  margin-top: 4px;
}

.banner-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pestañas */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #dadce0;
  margin-bottom: 20px;
}

.tab {
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #5f6368;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tab:hover {
  background: #f1f3f4;
  border-bottom-color: #f1f3f4;
}

.tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

/* Tablero: caja de publicar */
.compose {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.compose textarea {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  min-height: 48px;
  color: #202124;
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #f1f3f4;
  padding-top: 12px;
}

/* Muro: publicación */
.post {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 16px;
}

.post-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.post-meta {
  flex: 1;
}

.post-meta .post-author {
  font-size: 14.5px;
  font-weight: 600;
  color: #1a73e8;
}

.post-meta .post-date {
  font-size: 12.5px;
  color: #5f6368;
  margin-top: 1px;
}

.post-title {
  font-size: 17px;
  font-weight: 700;
  color: #202124;
  margin: 12px 0 4px;
}

.post-body {
  color: #3c4043;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.post-due {
  margin-top: 10px;
  font-size: 13px;
  color: #d93025;
  font-weight: 600;
}

.post-due.ok {
  color: #137333;
}

.post-due.neutral {
  color: #b06000;
}

.post-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Adjuntos */
.adjuntos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.adjunto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: #174ea6;
  text-decoration: none;
  max-width: 280px;
  overflow: hidden;
}

.adjunto .a-ico {
  flex-shrink: 0;
}

.adjunto span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Trabajo de clase */
.classwork-item {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.classwork-item .cw-main {
  flex: 1;
}

.classwork-item .cw-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a73e8;
}

.classwork-item .cw-sub {
  font-size: 13px;
  color: #5f6368;
  margin-top: 2px;
}

.tarea-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fce8e6;
  color: #c5221f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* Personas */
.people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.people-col {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 16px 20px;
}

.people-col h4 {
  font-size: 15px;
  color: #3c4043;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-top: 1px solid #f1f3f4;
}

.person-info {
  flex: 1;
}

.person-name {
  font-size: 14px;
  font-weight: 600;
  color: #202124;
}

.person-role {
  font-size: 12.5px;
  color: #5f6368;
}

/* Responsive */
@media (max-width: 760px) {
  .navbar {
    top: 64px;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid #e8eaed;
    padding: 4px 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .navbar button {
    padding: 10px 12px;
  }

  .navbar button.active::after {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 2px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
  }

  main {
    margin-left: 0;
    padding: 150px 12px 40px;
  }

  .people-grid {
    grid-template-columns: 1fr;
  }

  .aula-banner {
    padding: 16px 16px;
  }
}
/* ===== ROLES ===== */
.nav-hidden {
  display: none !important;
}

/* ===== COMENTARIOS ===== */
.comentarios {
  border-top: 1px solid #f1f3f4;
  margin-top: 12px;
  padding-top: 10px;
}

.comentario {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 5px 0;
}

.avatar-xs {
  width: 28px;
  height: 28px;
  font-size: 11px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.comentario-body {
  flex: 1;
}

.comentario-autor {
  font-size: 13px;
  font-weight: 600;
  color: #202124;
}

.comentario-fecha {
  font-size: 11.5px;
  color: #80868b;
  font-weight: 400;
  margin-left: 6px;
}

.comentario-texto {
  font-size: 13.5px;
  color: #3c4043;
}

.comentario-form {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.comentario-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
}

/* ===== GRILLA RÁPIDA DE ASISTENCIA ===== */
.att-botones {
  white-space: nowrap;
}

.att-estado {
  padding: 6px 12px;
  border: 1px solid #dadce0;
  background: #fff;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12.5px;
  margin-right: 6px;
  color: #3c4043;
  font-family: inherit;
}

.att-estado.ok.att-estado-active {
  background: #e6f4ea;
  border-color: #188038;
  color: #137333;
  font-weight: 600;
}

.att-estado.tarde.att-estado-active {
  background: #fef7e0;
  border-color: #f9ab00;
  color: #b06000;
  font-weight: 600;
}

.att-estado.falta.att-estado-active {
  background: #fce8e6;
  border-color: #d93025;
  color: #c5221f;
  font-weight: 600;
}

/* ===== GRÁFICAS ===== */
.charts-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.chart-box {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px;
}

.chart-box canvas {
  width: 100%;
  height: 220px;
  display: block;
}

.chart-cap {
  text-align: center;
  font-size: 13px;
  color: #5f6368;
  margin-top: 6px;
}

/* ===== PIE DE PÁGINA ===== */
.app-footer {
  text-align: center;
  padding: 18px 16px 26px;
  color: #80868b;
  font-size: 12.5px;
  border-top: 1px solid #e8eaed;
  background: rgba(255, 255, 255, 0.6);
}

/* ===== IMPRESIÓN ===== */
#print-area {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  #print-area,
  #print-area * {
    visibility: visible;
  }

  #print-area {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
  }

  #print-area h1 {
    font-size: 22px;
    margin-bottom: 12px;
  }

  #print-area table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
  }

  #print-area th,
  #print-area td {
    border: 1px solid #333;
    padding: 6px 8px;
    font-size: 13px;
    text-align: left;
  }
}

/* ===== GRILLA SEMANAL DE HORARIOS ===== */
.schedule-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.schedule-grid th,
.schedule-grid td {
  border: 1px solid #dadce0;
  padding: 6px 8px;
  text-align: center;
  font-size: 13px;
  vertical-align: top;
}

.schedule-grid th {
  background: #f8f9fa;
  font-weight: 600;
  color: #3c4043;
}

.schedule-grid td {
  min-height: 44px;
}

.schedule-grid .sg-hora {
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  width: 70px;
}

.sg-curso {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #e8f0fe;
  border: 1px solid #a8c7fa;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 12px;
  color: #1967d2;
}

.sg-curso .sg-codigo {
  font-weight: 700;
}

.sg-curso .sg-sub {
  color: #5f6368;
  font-size: 11px;
}

.sg-curso.clash {
  background: #fce8e6;
  border-color: #d93025;
  color: #c5221f;
}

.sg-empty {
  color: #dadce0;
}

/* ===== ENCABEZADO DE IMPRESIÓN CON LOGO ===== */
.print-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 2px solid #1a73e8;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.print-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e8eaed;
}

.print-titulos h1 {
  font-size: 20px;
  margin: 0;
  color: #202124;
}

.print-titulos .print-sub {
  margin: 2px 0 0;
  color: #5f6368;
  font-size: 13px;
}

.print-firmas td {
  border: none !important;
  text-align: center;
  font-size: 13px;
}

body.dark .schedule-grid th,
body.dark .schedule-grid td {
  border-color: #3c4043;
}

body.dark .schedule-grid th {
  background: #3c4043;
  color: #e8eaed;
}

body.dark .sg-curso {
  background: #3c4043;
  border-color: #5f6368;
  color: #8ab4f8;
}

body.dark .sg-curso .sg-sub {
  color: #9aa0a6;
}

body.dark .sg-curso.clash {
  background: #5c2a2a;
  border-color: #d93025;
  color: #f28b82;
}

body.dark .sg-empty {
  color: #5f6368;
}

body.dark .print-titulos h1 {
  color: #e8eaed;
}

/* ===== RESPONSIVE DE GRILLA ===== */
@media (max-width: 900px) {
  .print-header {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== MODO OSCURO ===== */
body.dark {
  background: #202124;
  color: #e8eaed;
}

body.dark .app-header,
body.dark .navbar {
  background: #292a2d;
  border-color: #3c4043;
}

body.dark .brand {
  color: #e8eaed;
}

body.dark .navbar button {
  color: #bdc1c6;
}

body.dark .navbar button:hover {
  background: #3c4043;
}

body.dark .navbar button.active {
  color: #8ab4f8;
  background: #3c4043;
}

body.dark .card,
body.dark .report-card,
body.dark .people-col,
body.dark .chart-box,
body.dark .stat-card,
body.dark .post,
body.dark .classwork-item,
body.dark .class-card .class-info,
body.dark .compose,
body.dark .modal {
  background: #292a2d;
  border-color: #3c4043;
}

body.dark .brand-name {
  color: #e8eaed;
}

body.dark .brand-sub {
  color: #9aa0a6;
}

body.dark .modal h3 {
  border-color: #3c4043;
}

body.dark .app-footer {
  color: #9aa0a6;
  background: rgba(41, 42, 45, 0.6);
  border-color: #3c4043;
}

body.dark .section-header h2::before {
  background: #8ab4f8;
}

body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark .card h3,
body.dark .report-card h4,
body.dark .people-col h4,
body.dark .post-author,
body.dark .post-title,
body.dark .cw-title,
body.dark .person-name,
body.dark .comentario-autor {
  color: #e8eaed;
}

body.dark p,
body.dark label,
body.dark .subtitle,
body.dark .report-card p,
body.dark .chart-cap,
body.dark .empty-state,
body.dark .post-body,
body.dark .cw-sub,
body.dark .person-role,
body.dark .comentario-texto {
  color: #bdc1c6;
}

body.dark table {
  color: #e8eaed;
}

body.dark th {
  background: #3c4043;
  color: #e8eaed;
  border-color: #5f6368;
}

body.dark td {
  border-color: #3c4043;
}

body.dark tr:hover td {
  background: #3c4043;
}

body.dark input,
body.dark select,
body.dark textarea,
body.dark .comentario-form input {
  background: #3c4043;
  color: #e8eaed;
  border-color: #5f6368;
}

body.dark .comentarios {
  border-color: #3c4043;
}

body.dark .att-estado {
  background: #3c4043;
  color: #e8eaed;
  border-color: #5f6368;
}

body.dark .tabs .tab {
  color: #bdc1c6;
}

body.dark .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

body.dark .badge {
  background: #3c4043;
  color: #e8eaed;
}

/* Responsive de gráficas */
@media (max-width: 760px) {
  .charts-wrap {
    grid-template-columns: 1fr;
  }
}

/* ===== RESPONSIVE MÓVIL / TABLETA ===== */
@media (max-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .stat-card .number {
    font-size: 30px;
  }

  .charts-wrap,
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }

  .people-grid,
  .people-grid-2col {
    grid-template-columns: 1fr 1fr;
  }

  .aulas-grid .aula-card {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  main {
    padding: 146px 12px 40px 14px;
  }

  /* Encabezados de sección: apilar acciones bajo el título */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-header .section-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* Filtros y búsquedas: apilados full-width */
  .search-box input,
  .search-box select,
  .search-box .form-group,
  .filter-row > div,
  .filters .form-group {
    min-width: 0;
    width: 100%;
  }

  .filter-row,
  .filters,
  .people-tools,
  .att-tools,
  .rep-tools,
  .courses-tools,
  .aula-tools {
    flex-wrap: wrap;
  }

  /* Grillas en 1 columna */
  .people-grid,
  .people-grid-2col,
  .cards-grid,
  .aulas-grid,
  .charts-wrap,
  .charts-grid,
  .horario-grid,
  .horario-grid-lite,
  .schedule-grid,
  .stats-grid,
  .cards-cover-grid {
    grid-template-columns: 1fr;
  }

  /* Tablas: mejor scroll horizontal ya cubierto por .table-wrap,
     pero asegurarnos del padding en móvil */
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* Botones de acciones de fila: apilar */
  .actions,
  .person-row .actions,
  .att-botones,
  .class-card .class-actions {
    flex-wrap: wrap;
    white-space: nowrap;
    gap: 6px;
  }

  .att-estado {
    flex: 1 1 calc(50% - 12px);
    margin-right: 0;
    text-align: center;
    justify-content: center;
  }

  /* Aula virtual: banner y header compactos */
  .aula-banner {
    padding: 16px 14px;
  }

  .aula-banner .aula-banner-top,
  .aula-head-actions {
    flex-wrap: wrap;
  }

  /* Charts reducidos */
  .chart-box canvas {
    height: 180px;
  }
}

@media (max-width: 520px) {
  .navbar button {
    padding: 10px 10px;
    font-size: 13px;
  }

  .navbar button i,
  .navbar button .menu-ico {
    display: none;
  }

  .brand-sub {
    font-size: 10.5px;
  }

  .stat-card .number {
    font-size: 26px;
  }

  .people-person,
  .person-row {
    padding: 9px 4px;
  }

  /* Tablas: tipo tarjeta apilada (horizonte claro para lectura en móvil).
     Convertimos filas en bloques con etiquetas. */
  .table-wrap table {
    font-size: 12.5px;
  }

  /* Modales: pantalla completa en el móvil */
  .modal-overlay {
    padding: 8px;
    align-items: stretch;
  }

  .modal {
    max-width: 100%;
    border-radius: 10px;
    padding: 18px 14px;
  }

  .modal .form-group input,
  .modal .form-group select,
  .modal .form-group textarea {
    font-size: 13.5px;
  }

  .form-group .form-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Botones de toolbars compactas en móvil */
  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .people-grid {
    gap: 12px;
  }

  .people-card {
    padding: 14px 12px;
  }
}

