/* ======================================================================
   Global styles for "Incidencias de alumnado"
   Archivo: static/styles.css
   Diseñado para convivir con Tailwind (sin pipeline)
   Paleta: azul turquesa institucional
   ====================================================================== */

/* ----------------------------------------------------------------------
   Variables de color (branding)
   ---------------------------------------------------------------------- */
:root {
  /* Marca */
  --brand-600: #0ea5a8;   /* turquesa principal */
  --brand-700: #0f766e;   /* turquesa oscuro */
  --brand-200: #99f6e4;   /* turquesa claro */

  /* Texto */
  --ink-900:   #0f172a;
  --ink-700:   #334155;
  --ink-600:   #475569;
  --ink-500:   #64748b;

  /* Neutros */
  --muted-50:  #f8fafc;
  --muted-100: #f1f5f9;
  --muted-200: #e2e8f0;
  --muted-300: #cbd5e1;

  /* Estados */
  --ok:    #16a34a;
  --warn:  #f59e0b;
  --error: #dc2626;

  --white: #ffffff;
}

/* ----------------------------------------------------------------------
   Reset base (muy ligero, no pisa Tailwind)
   ---------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--muted-50);
  color: var(--ink-900);
  font: 400 0.95rem/1.5 system-ui, -apple-system, Segoe UI, Roboto,
        Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Enlaces */
a {
  color: var(--brand-700);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  color: var(--brand-600);
}


/* Helpers */
.hide    { display: none !important; }
.nowrap { white-space: nowrap; }

/* ----------------------------------------------------------------------
   Cards / paneles
   ---------------------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--muted-200);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* ----------------------------------------------------------------------
   Formularios (coherentes con Tailwind)
   ---------------------------------------------------------------------- */
.label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--ink-700);
}

.input,
select,
textarea {
  width: 100%;
  background: var(--white);
  color: var(--ink-900);
  border: 1px solid var(--muted-300);
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.15s ease,
              box-shadow 0.15s ease;
}

.input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(14, 165, 168, 0.18);
}

/* Safari date input */
input[type="date"] {
  appearance: none;
}

/* ----------------------------------------------------------------------
   Botones
   ---------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  background: var(--brand-600);
  color: var(--white);
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: background 0.15s ease,
              opacity 0.15s ease;
}

.btn-primary:hover {
  background: var(--brand-700);
  text-decoration: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-muted {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--muted-200);
  color: var(--ink-700);
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
}

.btn-muted:hover {
  background: var(--muted-300);
}

/* ----------------------------------------------------------------------
   Tablas
   ---------------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--muted-200);
  border-radius: 0.6rem;
  overflow: hidden;
}

.table th,
.table td {
  border-bottom: 1px solid var(--muted-200);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

/* Horarios (listados + admin): centrar en vertical; el resto de tablas sigue con top */
.table.schedule-table th,
.table.schedule-table td {
  vertical-align: middle;
}

.table th {
  background: var(--muted-100);
  font-weight: 600;
  font-size: 0.9rem;
}

.table tbody tr:hover {
  background: #fafafa;
}

/* ----------------------------------------------------------------------
   Alertas / mensajes
   ---------------------------------------------------------------------- */
.alert {
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.alert.ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: var(--ok);
}

.alert.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: var(--warn);
}

.alert.err {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--error);
}

/* ----------------------------------------------------------------------
   Impresión (solo HTML, no PDFs ReportLab)
   ---------------------------------------------------------------------- */
@media print {
  header,
  nav,
  footer,
  .btn-primary,
  .btn-muted {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border-color: #999;
  }

  a {
    text-decoration: none;
    color: black;
  }
}

/* ----------------------------------------------------------------------
   Enlaces de navegación (navbar)
   ---------------------------------------------------------------------- */
.app-link {
  color: var(--brand-700);
  font-weight: 500;
  text-decoration: none; /* anula el comportamiento global */
  padding: 0.25rem 0.4rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease,
              color 0.15s ease;
}

.app-link:hover {
  background-color: var(--brand-200);
  color: var(--ink-900);
  text-decoration: none; /* nunca subrayado en navbar */
}

/* ======================================================================
   Extensiones monolito (clases form-* en plantillas · zebra · botón peligro)
   ====================================================================== */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--white);
  color: var(--ink-900);
  border: 1px solid var(--muted-300);
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  font: inherit;
  transition: border-color 0.15s ease,
              box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(14, 165, 168, 0.18);
}

textarea.form-input,
textarea.form-textarea {
  min-height: 5rem;
  resize: vertical;
}

.table.table-zebra tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.55);
}

a.btn-muted,
a.btn-primary {
  text-decoration: none;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--error);
  color: var(--white);
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
}

.btn-danger:hover {
  filter: brightness(0.95);
  text-decoration: none;
}
