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

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f6fb;
  color: #1f2937;
}

a {
  text-decoration: none;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f0ff, #f8fafc);
}

.login-container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.10);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #1e40af;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.brand h1 {
  color: #1e3a8a;
  margin-bottom: 4px;
}

.descripcion {
  line-height: 1.6;
  margin-bottom: 26px;
  color: #4b5563;
}

.login-actions {
  display: grid;
  gap: 12px;
}

.btn {
  border: none;
  padding: 13px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #1e40af;
  color: white;
}

.btn-secondary {
  background: #e0e7ff;
  color: #1e3a8a;
}

.btn-success {
  background: #16a34a;
  color: white;
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #111827;
  color: white;
  padding: 24px;
}

.sidebar h2 {
  margin-bottom: 8px;
}

.sidebar p {
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 30px;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav a {
  color: #e5e7eb;
  padding: 12px;
  border-radius: 10px;
}

.nav a:hover,
.nav a.active {
  background: #1f2937;
}

.content {
  flex: 1;
  padding: 28px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header h1 {
  color: #1e3a8a;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: white;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
}

.stat h3 {
  font-size: 30px;
  color: #1e40af;
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 14px;
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
}

textarea {
  min-height: 80px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th,
.table td {
  text-align: left;
  padding: 13px;
  border-bottom: 1px solid #e5e7eb;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
}

.badge-alto {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-medio {
  background: #fef3c7;
  color: #92400e;
}

.badge-bajo {
  background: #dcfce7;
  color: #166534;
}

.badge-mejora {
  background: #dbeafe;
  color: #1d4ed8;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.alert-box {
  border-left: 6px solid #dc2626;
  background: #fff7f7;
}

.timeline {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.timeline-item {
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

@media (max-width: 800px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

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

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

.login-profesional {
  min-height: 100vh;
  background: #f4f4f5;
  position: relative;
  overflow: hidden;
}

.login-header {
  height: 42vh;
  background: linear-gradient(135deg, #003b70, #064b86);
  width: 100%;
}

.login-wrapper {
  position: absolute;
  top: 7vh;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.login-box {
  width: 440px;
  min-height: 560px;
  background: #ffffff;
  border-radius: 22px;
  padding: 42px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.logo-icon {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: #00477f;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
}

.login-logo h1 {
  color: #003b70;
  font-size: 32px;
  margin: 0;
}

.login-logo span {
  color: #64748b;
  font-size: 13px;
}

.login-box h2 {
  color: #666;
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 10px;
}

.login-subtitle {
  color: #777;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.input-group {
  display: flex;
  align-items: center;
  background: #eef8ff;
  border: 1px solid #0ea5e9;
  border-radius: 6px;
  margin-bottom: 18px;
  overflow: hidden;
}

.input-group span {
  width: 48px;
  background: #e0f2fe;
  padding: 13px 0;
  color: #0369a1;
}

.input-group input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px;
  outline: none;
  font-size: 15px;
}

.login-btn {
  width: 100%;
  margin-top: 10px;
  background: #003b70;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 7px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 59, 112, 0.35);
}

.login-btn:hover {
  background: #005293;
}

.login-error {
  margin-top: 12px;
  color: #dc2626;
  font-weight: bold;
}

.demo-users {
  margin-top: 24px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  color: #475569;
  font-size: 13px;
}

.login-footer {
  position: absolute;
  bottom: 24px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  color: #3b6d91;
  font-size: 16px;
}

.login-footer span {
  color: #e79a21;
  font-weight: bold;
}

@media (max-width: 600px) {
  .login-box {
    width: 92%;
    padding: 30px 22px;
  }

  .login-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

.seccion-docente {
  animation: fadeIn 0.25s ease-in-out;
}

.form-horizontal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: end;
}

.form-horizontal .full {
  grid-column: 1 / -1;
}

.form-horizontal button {
  height: 44px;
}

.nav a.active {
  background: #2563eb;
  color: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .form-horizontal {
    grid-template-columns: 1fr;
  }
}

.oculto {
  display: none !important;
}

.theme-toggle {
  margin-top: 25px;
  width: 100%;
  background: #f59e0b;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

body.dark-mode {
  background: #0f172a;
  color: #e5e7eb;
}

body.dark-mode .content {
  background: #0f172a;
}

body.dark-mode .card,
body.dark-mode .login-box {
  background: #1e293b;
  color: #e5e7eb;
}

body.dark-mode .header h1,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: #f8fafc;
}

body.dark-mode .sidebar {
  background: #020617;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #334155;
  color: white;
  border-color: #475569;
}

body.dark-mode .table th,
body.dark-mode .table td {
  border-color: #475569;
}

body.dark-mode .table {
  color: #e5e7eb;
}

/* =========================
   MODO OSCURO PROFESIONAL
========================= */

.theme-icon {
  position: fixed;
  top: 22px;
  right: 28px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: #1e3a8a;
  font-size: 22px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);

  transition:
    background 0.4s ease,
    color 0.4s ease,
    transform 0.5s ease,
    box-shadow 0.4s ease;
}

.theme-icon:hover {
  transform: rotate(20deg) scale(1.08);
  box-shadow: 0 15px 35px rgba(0,0,0,0.28);
}

body,
.content,
.card,
.sidebar,
input,
select,
textarea,
.table,
h1,
h2,
h3,
p,
a,
button {
  transition:
    background 0.45s ease,
    color 0.45s ease,
    border 0.45s ease,
    box-shadow 0.45s ease;
}

/* =========================
   DARK MODE
========================= */

body.dark-mode {
  background: #0f172a;
  color: #e5e7eb;
}

body.dark-mode .content {
  background:
    radial-gradient(circle at top,
    #1e293b,
    #0f172a 60%);
}

body.dark-mode .sidebar {
  background: #020617;
}

body.dark-mode .card {
  background: #1e293b;
  color: #e5e7eb;

  box-shadow:
    0 15px 35px rgba(0,0,0,0.35);
}

body.dark-mode .header h1,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: #f8fafc;
}

body.dark-mode p,
body.dark-mode label,
body.dark-mode td,
body.dark-mode th {
  color: #dbeafe;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #334155;
  color: white;
  border-color: #475569;
}

body.dark-mode .table th,
body.dark-mode .table td {
  border-color: #475569;
}

body.dark-mode .nav a.active {
  background: #2563eb;
}

body.dark-mode .theme-icon {
  background: rgba(15,23,42,0.95);
  color: #facc15;

  transform: rotate(360deg);
}

/* =========================
   SECCIONES DOCENTE
========================= */

.oculto {
  display: none !important;
}

.seccion-docente {
  animation: fadeIn 0.25s ease-in-out;
}

.form-horizontal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: end;
}

.form-horizontal .full {
  grid-column: 1 / -1;
}

.form-horizontal button {
  height: 46px;
}

.nav a.active {
  background: #2563eb;
  color: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .form-horizontal {
    grid-template-columns: 1fr;
  }
}

.profile-card {
  margin-top: 26px;
  background: linear-gradient(135deg, #334155, #1e293b);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 340px 1fr;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
  color: white;
}

.profile-left {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  padding: 28px;
  text-align: center;
}

.profile-left img {
  width: 240px;
  height: 240px;
  border-radius: 18px;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.profile-left h2 {
  margin-top: 18px;
  color: white;
  font-size: 26px;
}

.profile-left p {
  color: #f8fafc;
  margin-top: 6px;
}

.profile-right {
  padding: 30px;
}

.profile-right h3 {
  color: #e0f2fe;
  margin-bottom: 18px;
}

.profile-right p {
  margin-bottom: 12px;
  color: #f8fafc;
  line-height: 1.5;
}

.profile-right strong {
  color: #bfdbfe;
}

@media (max-width: 900px) {
  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-left img {
    width: 180px;
    height: 180px;
  }
}

.teacher-sidebar {
  background: linear-gradient(180deg, #075985, #0f172a);
  border-radius: 0 22px 22px 0;
}

.school-logo {
  margin-bottom: 26px;
}

.school-logo h2 {
  font-size: 26px;
  color: white;
}

.school-logo p {
  color: #dbeafe;
  font-size: 13px;
}

.teacher-mini-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: white;
}

.teacher-mini-profile img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.teacher-mini-profile h3 {
  font-size: 16px;
  color: white;
}

.teacher-mini-profile span,
.teacher-mini-profile p {
  font-size: 13px;
  color: #e0f2fe;
}

.teacher-nav a {
  font-weight: 600;
}

.teacher-content {
  background: #f8fafc;
  padding: 28px 34px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.topbar h1 {
  color: #111827;
  font-size: 30px;
}

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 22px;
}

.topbar-icons img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.dashboard-card {
  background: white;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.dashboard-card h2 {
  margin-bottom: 16px;
  color: #111827;
}

.summary-item,
.class-row {
  background: #e8f1f5;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.alert-student {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffedd5;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.alert-student img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
}

.alert-student span {
  margin-left: auto;
  background: #fb923c;
  color: white;
  padding: 7px 10px;
  border-radius: 8px;
  font-weight: bold;
}

.calendar-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-left: 4px solid #14b8a6;
  background: #ecfeff;
  margin-bottom: 12px;
  border-radius: 8px;
}

.calendar-item strong {
  font-size: 24px;
}

.teachers-section {
  margin-top: 28px;
}

.teachers-section h2 {
  margin-bottom: 16px;
  color: #111827;
}

.teachers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.teacher-card {
  background: white;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.teacher-card img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
}

.teacher-card h3 {
  color: #0f172a;
  margin-bottom: 6px;
}

.teacher-card p {
  font-size: 13px;
  margin: 3px 0;
}

body.dark-mode .teacher-content {
  background: #0f172a;
}

body.dark-mode .dashboard-card,
body.dark-mode .teacher-card {
  background: #1e293b;
  color: #e5e7eb;
}

body.dark-mode .dashboard-card h2,
body.dark-mode .teachers-section h2,
body.dark-mode .teacher-card h3,
body.dark-mode .topbar h1 {
  color: white;
}

body.dark-mode .summary-item,
body.dark-mode .class-row {
  background: #334155;
}

body.dark-mode .calendar-item {
  background: #164e63;
}

@media (max-width: 1000px) {
  .dashboard-grid,
  .teachers-grid {
    grid-template-columns: 1fr;
  }
}
/* ─── SECCIONES PSICOLOGA / ESTUDIANTE ────────────────────── */

.seccion-psicologa,
.seccion-estudiante {
  animation: fadeIn 0.25s ease-in-out;
}

/* ─── TOPBAR BOTÓN MENSAJE CON BADGE ──────────────────────── */

.topbar-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-notif {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: bold;
  border-radius: 999px;
  min-width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
  border: 2px solid white;
  animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ─── MODALES ──────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  margin: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  border-radius: 20px 20px 0 0;
}

.modal-header h2 {
  color: #111827;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-body {
  padding: 20px 24px 24px;
}

.incident-card {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 5px solid #f97316;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
}

.incident-card h3 {
  color: #92400e;
  margin-bottom: 10px;
  font-size: 16px;
}

.incident-card p {
  color: #78350f;
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.6;
}

.incident-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.incident-list-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.incident-list-item .info h4 {
  color: #111827;
  margin-bottom: 4px;
  font-size: 15px;
}

.incident-list-item .info p {
  color: #6b7280;
  font-size: 13px;
  margin: 2px 0;
}

.incident-list-item .chevron {
  color: #9ca3af;
  font-size: 20px;
  flex-shrink: 0;
}

/* ─── CÁMARA / FOTO ────────────────────────────────────────── */

.camara-controles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

#videoCamara {
  width: 100%;
  border-radius: 12px;
  margin-top: 12px;
  max-height: 280px;
  object-fit: cover;
  background: #000;
  display: none;
}

.foto-preview-container {
  margin-top: 12px;
  margin-bottom: 16px;
}

.foto-preview-container img {
  max-width: 100%;
  border-radius: 12px;
  max-height: 240px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
}

/* ─── DARK MODE MODALES ────────────────────────────────────── */

body.dark-mode .modal-box {
  background: #1e293b;
}

body.dark-mode .modal-header {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .modal-header h2 {
  color: #f8fafc;
}

body.dark-mode .modal-close {
  color: #94a3b8;
}

body.dark-mode .modal-close:hover {
  background: #334155;
}

body.dark-mode .incident-card {
  background: #1c1100;
  border-color: #92400e;
}

body.dark-mode .incident-card h3 {
  color: #fbbf24;
}

body.dark-mode .incident-card p {
  color: #fde68a;
}

body.dark-mode .incident-list-item {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .incident-list-item:hover {
  background: #1e3a5f;
  border-color: #2563eb;
}

body.dark-mode .incident-list-item .info h4 {
  color: #f8fafc;
}

body.dark-mode .incident-list-item .info p {
  color: #94a3b8;
}

body.dark-mode .badge-notif {
  border-color: #1e293b;
}
