* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background-color: #f4f6f9;
}

/* ===== HEADER ===== */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .title {
    font-size: 18px;
    font-weight: bold;
}

header .user {
    font-size: 14px;
}

/* ===== LAYOUT ===== */
.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    background-color: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 14px 20px;
}

.sidebar a {
    text-decoration: none;
    color: #333;
    display: block;
}

.sidebar li.active {
    background-color: #2c3e50;
}

.sidebar li.active a {
    color: white;
    font-weight: bold;
}

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    padding: 30px;
}

h1 {
    margin-bottom: 20px;
}

/* ===== CARDS ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card h3 {
    font-size: 14px;
    color: #555;
}

.card p {
    font-size: 28px;
    margin-top: 10px;
}

/* ===== TABLE ===== */
.table-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: #f0f0f0;
}

/* ===== LOGIN ===== */
.login-container {
    min-height: 100vh;
    background-color: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background-color: white;
    padding: 40px;
    width: 360px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    text-align: center;
}

.login-box .logo {
    background-color: #2c3e50;
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
}

.login-box h2 {
    margin-bottom: 10px;
}

.login-box p {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background-color: #1f2e3d;
}

/* ===== DOCENTES ===== */

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

.btn-primary {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #218838;
}

/* FORMULARIO */
.form-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    display: none; /* OCULTO POR DEFECTO */
}

.form-container h3 {
    margin-bottom: 15px;
}

.form-container input {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* TABLA DOCENTES */
.table-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ===== APROBADOS / DESAPROBADOS ===== */

.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background-color: #bdc3c7;
    cursor: pointer;
    font-weight: bold;
}

.tab-btn.active {
    background-color: #2c3e50;
    color: white;
}

.hidden {
    display: none;
}

/* ===== CURSOS Y HORARIOS ===== */

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

.course-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 15px;
}

.course-item strong {
    font-size: 16px;
}

.course-item span {
    color: #555;
    font-size: 14px;
}

.course-item button {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.course-item button:hover {
    background-color: #1f2d3a;
}

/* ===== REPORTES ===== */

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

.actions {
    display: flex;
    gap: 12px;
}

.btn-light {
    background: white;
    border: 1px solid #ccc;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-green {
    background: #22c55e;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-dark {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
}

.report-types {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.report-card p {
    font-size: 28px;
    margin-bottom: 10px;
}

.report-card.active {
    background: #2c3e50;
    color: white;
}

.form-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.form-row select {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ===== CONFIGURACIÓN ===== */

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.two-columns {
    display: flex;
    gap: 20px;
}

.btn-green {
    margin-top: 15px;
    background: #22c55e;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-green:hover {
    background: #16a34a;
}

.hidden {
    display: none;
}

.estado.aprobado {
    color: green;
    font-weight: bold;
}

.estado.desaprobado {
    color: red;
    font-weight: bold;
}















/* =========================================
   RESPONSIVE MEJORADO (PÉGALO AL FINAL)
========================================= */

/* Variables útiles */
:root {
  --color-oscuro: #2c3e50;
  --gris-fondo: #f4f6f9;
  --blanco: #fff;
}

/* Evita desbordes horizontales */
html, body {
  width: 100%;
  overflow-x: hidden;
}

/* Layout más flexible */
.container {
  display: flex;
  gap: 0;
}

/* Sidebar sticky en desktop (opcional) */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

/* Main flexible */
.main {
  min-width: 0; /* IMPORTANTE para que tablas no rompan el layout */
}

/* Tablas: scroll horizontal en móvil */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 650px; /* hace que se vea bien y en móvil haga scroll */
}

/* Botones: mejor alineación */
.btn-primary, .btn-dark, .btn-green, .btn-light {
  transition: transform 0.05s ease, opacity 0.2s ease;
}

.btn-primary:active, .btn-dark:active, .btn-green:active, .btn-light:active {
  transform: scale(0.98);
}

/* Cards: grid más fluido */
.cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Formularios: inputs consistentes */
.form-container input,
.form-group input,
.form-group select,
.form-row select {
  width: 100%;
}

/* Filas de formulario: se vuelven columna cuando no hay espacio */
.form-row {
  flex-wrap: wrap;
}

.form-row > * {
  min-width: 220px;
  flex: 1;
}

/* Reportes: cards adaptables */
.report-types {
  flex-wrap: wrap;
}

.report-card {
  min-width: 220px;
}

/* =========================================
   BREAKPOINT: TABLET (<= 992px)
========================================= */
@media (max-width: 992px) {

  header {
    padding: 12px 18px;
    gap: 10px;
  }

  header .title {
    font-size: 16px;
    line-height: 1.2;
  }

  .sidebar {
    width: 210px;
  }

  .main {
    padding: 20px;
  }

  h1 {
    font-size: 24px;
  }

  .header-section {
    gap: 12px;
  }
}

/* =========================================
   BREAKPOINT: MÓVIL (<= 768px)
========================================= */
@media (max-width: 768px) {

  /* header en 2 líneas */
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header .user {
    opacity: 0.9;
  }

  /* Layout: sidebar arriba y contenido abajo */
  .container {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    box-shadow: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .sidebar ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .sidebar li {
    padding: 0;
    flex: 0 0 auto;
  }

  .sidebar a {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0f0f0;
  }

  .sidebar li.active a {
    background: var(--color-oscuro);
    color: white;
  }

  .main {
    padding: 16px;
  }

  /* Encabezado + botón: uno debajo del otro */
  .header-section {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    width: 100%;
  }

  /* Cards */
  .cards {
    grid-template-columns: 1fr;
  }

  /* Reportes: botones y acciones en columna */
  .reports-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .actions {
    flex-wrap: wrap;
  }

  .btn-light, .btn-dark, .btn-green {
    flex: 1;
    min-width: 140px;
  }

  /* Login box */
  .login-box {
    width: 92%;
    padding: 28px;
  }

  /* Tablas: ancho completo + scroll */
  table {
    min-width: 600px;
  }
}

/* =========================================
   BREAKPOINT: MÓVIL CHICO (<= 480px)
========================================= */
@media (max-width: 480px) {

  header .title {
    font-size: 15px;
  }

  h1 {
    font-size: 22px;
  }

  .table-container {
    padding: 14px;
  }

  th, td {
    padding: 10px;
  }

  .form-container {
    padding: 16px;
  }

  .login-box .logo {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
}
