:root {
  --bg: #eef0f2;
  --surface: #ffffff;
  --navy: #1a2332;
  --text: #2b3442;
  --muted: #6b7688;
  --border: #e2e5ea;
  --accent: #14b8a6;
  --accent-hover: #0f9c8c;
  --accent-soft: rgba(20, 184, 166, 0.12);
  --success: #0f9c8c;
  --error: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 35, 50, 0.04), 0 6px 20px rgba(26, 35, 50, 0.06);
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- Cabecera / marca ---------- */
.site-header {
  background: linear-gradient(180deg, #f4f5f7 0%, #e4e7ea 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 16px 30px;
  text-align: center;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  text-decoration: none;
}

.brand__name {
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.14em;
  color: var(--navy);
}

.brand__sub {
  margin-top: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--accent);
  text-transform: uppercase;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px 56px;
}

.wrap--wide {
  max-width: 960px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.92rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.field {
  margin-bottom: 18px;
}

input[type="text"],
input[type="password"],
select,
input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

input[type="file"] {
  padding: 10px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.readonly-value {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  color: var(--navy);
}

/* ---------- Botones ---------- */
button {
  width: 100%;
  padding: 13px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--muted);
}

/* ---------- Progreso ---------- */
.progress {
  height: 10px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
  display: none;
}

.progress.is-visible {
  display: block;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* ---------- Estados ---------- */
.status {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: none;
}

.status.is-visible {
  display: block;
}

.status--success {
  background: var(--accent-soft);
  color: var(--success);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.status--error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--error);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.status--info {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(20, 184, 166, 0.25);
}

/* ---------- Tabla ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 20px;
}

.media-cell {
  display: block;
  max-width: 240px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #000;
}

img.media-cell {
  background: var(--bg);
  object-fit: cover;
}

/* ---------- Enlaces ---------- */
a {
  color: var(--accent);
  font-weight: 600;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.link-list a {
  display: block;
  padding: 15px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.link-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.82rem;
  color: var(--navy);
}

.hidden {
  display: none !important;
}

/* ---------- Carpetas de profesores (nivel 1) ---------- */
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.folder-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}

.folder-item__icon {
  font-size: 1.3rem;
  line-height: 1;
}

.folder-item__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.folder-item__name {
  font-weight: 700;
  color: var(--navy);
}

.folder-item__count {
  font-size: 0.85rem;
  color: var(--muted);
}

.folder-item__chevron {
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

/* ---------- No leídos ---------- */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.news {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.news__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.news__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.news__item:hover {
  border-color: var(--accent);
}

.news__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  color: var(--navy);
}

.news__count {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Registros de un profesor (nivel 2) ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin-bottom: 16px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.back-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.level-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  }

.level-actions .back-link {
  margin-bottom: 0;
  }

.btn-danger {
  width: auto;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 600;
  }

.btn-danger:hover:not(:disabled) {
  background: var(--error);
  border-color: var(--error);
  color: var(--surface);
  }

.records-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.record {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.record__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.record__row {
  display: flex;
  gap: 8px;
}

.record__label {
  min-width: 66px;
  color: var(--muted);
  font-size: 0.85rem;
}

.record__value {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
}

.record__media {
  flex-shrink: 0;
}
