/* The Water Ganache Course — identidad Damian Allsop
   Berenjena #5D245B · crema #F9F8F4 · gris cálido #CECDC4 · negro #161616
   Texto y etiquetas: Libre Baskerville · Botones/pestañas: Roboto Condensed · Cifras: Fira Sans */
:root {
  --plum: #5d245b;
  --plum-dark: #45193f;
  --plum-soft: #efe6ee;
  --plum-tint: #f6f0f5;
  --cream: #f9f8f4;
  --stone: #cecdc4;
  --stone-soft: #e8e7e0;
  --black: #161616;
  --charcoal: #33373d;

  --bg: var(--cream);
  --panel: #ffffff;
  --ink: #333333;
  --ink-strong: #161616;
  --ink-soft: #77736b;
  --line: #e4e2da;
  --accent: var(--plum);
  --accent-hover: var(--plum-dark);
  --accent-ink: var(--cream);
  --accent-soft: var(--plum-tint);
  --good: #3f6b46;
  --bad: #a3392b;
  --radius: 3px;

  --f-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --f-label: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --f-body: var(--f-serif);
  --f-data: 'Fira Sans', -apple-system, 'Segoe UI', Roboto, sans-serif; /* cifras de tablas */
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-serif); font-weight: 400; color: var(--ink-strong); line-height: 1.25; }
em { font-style: italic; }
a { color: var(--plum); }
::selection { background: var(--plum); color: var(--cream); }

#app { display: flex; flex-direction: column; min-height: 100vh; }
/* Pantalla del curso: ocupa justo la ventana y cada panel (listas, detalle, tablas) hace su propio scroll */
@media (min-width: 901px) {
  .app-shell { height: 100vh; height: 100dvh; overflow: hidden; }
  .app-shell .view.active, .app-shell .lessons-layout, .app-shell .recipes-layout { min-height: 0; overflow: hidden; }
  .app-shell #view-ingredients .table-wrap { min-height: 0; }
}

.muted { color: var(--ink-soft); }
.pad { padding: 24px; }
.label, .eyebrow {
  font-family: var(--f-serif); font-weight: 400; text-transform: uppercase;
  letter-spacing: .18em; font-size: 11.5px; color: var(--ink);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  min-height: 76px;
  background: var(--plum);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; padding: 10px 0; }
.brand-logo { height: 52px; width: auto; display: block; flex-shrink: 0; }
.brand-title { font-family: var(--f-serif); font-size: 18px; color: var(--cream); }
.brand-title em { color: var(--stone); }
.brand-sub { font-family: var(--f-serif); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(249, 248, 244, .65); }

.tabs { display: flex; gap: 4px; align-self: stretch; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center;
  border: 0; border-bottom: 3px solid transparent;
  background: transparent;
  color: rgba(249, 248, 244, .78);
  padding: 0 14px;
  cursor: pointer;
  font-family: var(--f-label);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--cream); border-bottom-color: rgba(249, 248, 244, .35); }
.tab.active { color: var(--cream); border-bottom-color: var(--cream); }
.logout-link { margin-left: 10px; color: rgba(249, 248, 244, .55); }
.logout-link:hover { color: var(--cream); }
/* Acciones que cambian de zona (Admin panel / Back to course) y salir: separadas de las pestañas */
.topbar .tabs { margin-left: auto; }
.nav-actions { display: flex; align-items: center; gap: 16px; padding-left: 20px; border-left: 1px solid rgba(249, 248, 244, .22); align-self: center; min-height: 36px; }
.nav-btn, .nav-logout {
  font-family: var(--f-label); font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.nav-btn { color: var(--cream); border: 1px solid rgba(249, 248, 244, .6); border-radius: var(--radius); padding: 8px 14px; transition: background .15s, color .15s; }
.nav-btn:hover { background: var(--cream); color: var(--plum); border-color: var(--cream); }
.nav-logout { color: rgba(249, 248, 244, .6); }
.nav-logout:hover { color: var(--cream); }

/* ---------- Views ---------- */
.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; flex-direction: column; }

/* ---------- Lessons ---------- */
.lessons-layout { display: flex; flex: 1; min-height: 0; }
.lessons-list {
  width: 300px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--cream);
  overflow-y: auto;
  padding: 18px 0;
}
.lessons-list::before {
  content: 'Course lessons';
  display: block; padding: 0 24px 10px;
  font-family: var(--f-serif); font-weight: 400; text-transform: uppercase;
  letter-spacing: .18em; font-size: 11.5px; color: var(--ink-soft);
}
.lesson-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 24px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s;
}
.lesson-item:hover { background: var(--stone-soft); }
.lesson-item.active { background: var(--panel); border-left-color: var(--plum); }
.lesson-badge {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--stone); color: var(--plum);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-serif); font-size: 14px; flex-shrink: 0;
}
.lesson-item.active .lesson-badge { background: var(--plum); border-color: var(--plum); color: var(--cream); }
.lesson-title { font-family: var(--f-serif); font-size: 15px; color: var(--ink-strong); }

.lesson-main { flex: 1; overflow-y: auto; background: var(--bg); }
.lesson-stage { background: var(--black); padding: 28px 28px 24px; }
.lesson-stage video {
  display: block;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: calc(100vh - 190px);
  margin: 0 auto;
  background: #000;
}
.lesson-body { max-width: 1200px; margin: 0 auto; padding: 26px 28px 40px; }
.lesson-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.lesson-head h2 { font-size: 30px; margin: 4px 0 0; }
.lesson-nav { display: flex; gap: 8px; }
.lesson-notes { margin-top: 26px; }
.lesson-notes textarea {
  width: 100%; min-height: 140px; padding: 14px 16px; margin-top: 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  font-family: var(--f-body); font-size: 14.5px; color: var(--ink); resize: vertical;
}
.lesson-notes textarea:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); }
.lesson-notes .save-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Panels shared ---------- */
.panel-head {
  display: flex; gap: 10px; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap;
}
input[type=search], input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  font-family: var(--f-body); color: var(--ink);
}
.panel-head input[type=search], .panel-head select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; background: var(--cream);
}
.panel-head input[type=search] { flex: 1; min-width: 180px; }
.panel-head input:focus, .panel-head select:focus { outline: none; border-color: var(--plum); background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--ink-strong); background: transparent; color: var(--ink-strong);
  padding: 9px 18px; border-radius: var(--radius); cursor: pointer;
  font-family: var(--f-label); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink-strong); color: var(--cream); }
.btn:disabled { opacity: .35; cursor: default; background: transparent; color: var(--ink-strong); }
.btn-primary { background: var(--plum); color: var(--cream); border-color: var(--plum); }
.btn-primary:hover { background: var(--plum-dark); border-color: var(--plum-dark); color: var(--cream); }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---------- Recipes ---------- */
.recipes-layout { display: flex; flex: 1; min-height: 0; }
.recipes-list { width: 320px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--cream); display: flex; flex-direction: column; }
.recipes-list .panel-head { background: var(--cream); }
#recipes-groups { overflow-y: auto; flex: 1; padding-bottom: 16px; }
.recipe-group-label {
  padding: 18px 20px 6px; font-family: var(--f-serif); font-size: 11.5px; font-weight: 400; letter-spacing: .16em;
  text-transform: uppercase; color: var(--plum);
}
.recipe-item {
  padding: 8px 20px; cursor: pointer; font-size: 14px; border-left: 3px solid transparent;
}
.recipe-item:hover { background: var(--stone-soft); }
.recipe-item.active { background: var(--panel); border-left-color: var(--plum); color: var(--ink-strong); font-weight: 700; }

.recipe-main { flex: 1; padding: 28px 32px; overflow-y: auto; }
.recipe-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.recipe-header h2 { margin: 8px 0 4px; font-size: 28px; }
.recipe-header .tag {
  display: inline-block; border: 1px solid var(--stone); color: var(--plum); padding: 2px 10px; border-radius: 999px;
  font-family: var(--f-serif); font-size: 10.5px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; margin-right: 6px;
}
.recipe-header input[type=text] { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.recipe-actions { display: flex; gap: 8px; }

.weight-row { display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; flex-wrap: wrap; }
.weight-row label { font-family: var(--f-serif); font-size: 11.5px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.weight-row input[type=number] { width: 120px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; background: #fff; }
.weight-row input:focus { outline: none; border-color: var(--plum); }

.stat-row { display: flex; flex-wrap: wrap; gap: 1px; margin: 16px 0 24px; background: var(--line); border: 1px solid var(--line); }
.stat-card { flex: 1 1 120px; background: var(--panel); padding: 14px 16px; }
.stat-card .v { font-family: var(--f-serif); font-size: 22px; color: var(--plum); }
.stat-card .l { font-family: var(--f-serif); font-size: 10.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .14em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 14px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th {
  font-family: var(--f-serif); font-size: 10.5px; font-weight: 400; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-soft); background: var(--cream); position: sticky; top: 0;
}
tbody tr:hover td { background: #fcfbf8; }
tr.total-row td { font-weight: 600; background: var(--plum-tint); color: var(--ink-strong); }
td.cell-num { text-align: right; font-family: var(--f-data); font-variant-numeric: tabular-nums; }
td[contenteditable="true"] { cursor: text; }
td[contenteditable="true"]:focus { outline: 2px solid var(--plum); outline-offset: -2px; background: #fffdf9; }
.icon-btn { border: 0; background: transparent; cursor: pointer; color: var(--ink-soft); font-size: 14px; }
.icon-btn.danger:hover { color: var(--bad); }

.item-row .rm-btn { color: var(--bad); cursor: pointer; font-size: 13px; }
.recipe-notes { margin-top: 22px; }
.recipe-notes label { font-family: var(--f-serif); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.recipe-notes textarea { width: 100%; min-height: 80px; padding: 12px; margin-top: 6px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }

.add-item-row { display: flex; gap: 8px; margin: 16px 0; align-items: center; flex-wrap: wrap; }
.add-item-row input { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.autocomplete { position: relative; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  max-height: 240px; overflow-y: auto; z-index: 30; box-shadow: 0 10px 24px rgba(22, 22, 22, .1);
}
.autocomplete-list div { padding: 9px 12px; cursor: pointer; font-size: 14px; }
.autocomplete-list div:hover { background: var(--plum-tint); }
.autocomplete-list .ac-type { font-family: var(--f-serif); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-left: 8px; }

/* Ingredient database */
#view-ingredients .table-wrap { margin: 20px; flex: 1; overflow: auto; }
.cell-cat { font-family: var(--f-serif); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

.msg { padding: 11px 14px; border-radius: var(--radius); font-size: 14px; margin: 10px 0; }
.msg.err { background: #fbeeeb; color: var(--bad); border: 1px solid #efcdc5; }
.msg.ok { background: #edf3ec; color: var(--good); border: 1px solid #cfe0cd; }

.field-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.field-row .fg { display: flex; flex-direction: column; gap: 4px; }
.field-row label { font-family: var(--f-serif); font-size: 12px; text-transform: uppercase; color: var(--ink-soft); letter-spacing: .08em; }
.field-row input, .field-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }

/* ---------- Auth pages (login / setup) ---------- */
.auth-body { display: flex; min-height: 100vh; background: var(--cream); }
.auth-brand {
  flex: 1 1 48%; background: var(--plum); color: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 48px 32px;
}
.auth-brand img { width: min(260px, 60%); height: auto; }
.auth-brand p { font-family: var(--f-serif); font-size: 21px; line-height: 1.5; max-width: 420px; margin: 36px 0 0; color: var(--cream); }
.auth-brand p em { color: var(--stone); }
.auth-panel { flex: 1 1 52%; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 30px; margin: 8px 0 6px; }
.auth-card .sub { color: var(--ink-soft); margin: 0 0 28px; font-size: 14.5px; line-height: 1.6; }
.auth-card label { display: block; margin: 0 0 8px; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text] {
  width: 100%; padding: 12px 14px; margin-bottom: 18px;
  border: 1px solid var(--stone); border-radius: var(--radius); background: #fff; font-size: 15px;
}
.auth-card input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); }
.auth-card .btn { width: 100%; padding: 13px 18px; font-size: 14px; margin-top: 6px; }
.auth-foot { margin-top: 28px; font-size: 13px; font-style: italic; color: var(--ink-soft); }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1180px; width: 100%; margin: 0 auto; padding: 32px 28px 60px; }
.admin-wrap h2 { font-size: 24px; margin: 28px 0 14px; }
.admin-wrap form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; flex-wrap: wrap; }
.admin-wrap input[type=text], .admin-wrap input[type=email], .admin-wrap input[type=password], .admin-wrap input[type=date] {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 14px;
}
.admin-wrap td { vertical-align: middle; }
.new-user { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 18px; }
.expired { color: var(--bad); font-weight: 600; }
.role-tag { font-family: var(--f-serif); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .brand-sub { display: none; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; min-height: 44px; scrollbar-width: none; }
  .topbar .tabs { order: 3; margin-left: 0; }
  .nav-actions { order: 2; margin-left: auto; padding-left: 0; border-left: 0; gap: 12px; }
  .nav-btn { padding: 6px 10px; font-size: 11.5px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding: 0 10px; }
  .lessons-layout, .recipes-layout { flex-direction: column; }
  .lessons-list, .recipes-list { width: 100%; max-height: 240px; border-right: none; border-bottom: 1px solid var(--line); }
  .lesson-main { order: -1; flex: none; }
  .lessons-list { max-height: none; border-top: 1px solid var(--line); }
  .lesson-stage { padding: 0; }
  .lesson-body, .recipe-main { padding: 20px 16px 32px; }
  .lesson-head h2 { font-size: 24px; }
  #view-ingredients .table-wrap { margin: 12px; }
  .auth-body { flex-direction: column; }
  .auth-brand { padding: 36px 24px; flex: none; }
  .auth-brand img { width: 150px; }
  .auth-brand p { font-size: 17px; margin-top: 20px; }
}

/* ---------- Buy page ---------- */
.buy-brand p { margin-top: 28px; }
.buy-includes { list-style: none; padding: 0; margin: 28px 0 0; font-family: var(--f-serif); font-size: 15px; line-height: 1.5; color: rgba(249, 248, 244, .9); }
.buy-includes li { padding: 9px 0; border-top: 1px solid rgba(249, 248, 244, .18); }
.buy-includes li:last-child { border-bottom: 1px solid rgba(249, 248, 244, .18); }
.buy-includes strong { font-weight: 700; color: var(--cream); }
.buy-card { max-width: 420px; }
.buy-price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 16px 0; margin: 0 0 22px; border-top: 1px solid var(--stone); border-bottom: 1px solid var(--stone); }
.buy-amount { font-family: var(--f-serif); font-size: 34px; color: var(--plum); }
.buy-hint { font-size: 13px; color: var(--ink-soft); margin: -8px 0 20px; line-height: 1.55; }
#paypal-buttons { margin-top: 4px; min-height: 50px; }
.auth-foot a { color: var(--plum); }

/* ---------- Admin settings ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.admin-card { background: var(--panel); border: 1px solid var(--line); padding: 20px 22px; }
.admin-card h3 { font-size: 18px; margin: 0 0 14px; }
.admin-card .fg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.admin-card .fg input[type=text], .admin-card .fg input[type=email], .admin-card .fg input[type=password],
.admin-card .fg input[type=number], .admin-card .fg input[type=date], .admin-card .fg select, .admin-card .fg textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 14px; width: 100%;
}
.admin-card .fg textarea { min-height: 96px; resize: vertical; }
.admin-card .row { display: flex; gap: 10px; }
.admin-card .row > * { flex: 1; }
.admin-card .opt { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14.5px; }
.admin-card .help { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin: 4px 0 0; }
.admin-actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: var(--f-label); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.status-pill.on { background: #edf3ec; color: var(--good); }
.status-pill.off { background: #fbeeeb; color: var(--bad); }
.status-pill.test { background: #fff4dc; color: #8a5a00; }
.welcome-bar { background: var(--plum-tint); color: var(--plum-dark); border-bottom: 1px solid var(--plum-soft); padding: 12px 28px; font-size: 14.5px; }

/* ---------- Legal pages ---------- */
.legal-page { max-width: 780px; width: 100%; margin: 0 auto; padding: 40px 28px 72px; font-size: 15.5px; line-height: 1.7; }
.legal-page h1 { font-size: 34px; margin: 8px 0 24px; }
.legal-page h2 { font-size: 19px; margin: 32px 0 10px; }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin: 6px 0; }
.legal-page .legal-owner { list-style: none; padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); }
.legal-page code { font-family: var(--f-data); font-size: 14px; background: var(--stone-soft); padding: 1px 5px; }
.legal-back { margin-top: 40px; }
.legal-missing { background: #fff4dc; color: #8a5a00; padding: 0 4px; }
.legal-links { font-size: 12.5px; color: var(--ink-soft); line-height: 1.8; }
.legal-links a { color: var(--ink-soft); }
.legal-links a:hover { color: var(--plum); }
.auth-card .legal-links { margin-top: 18px; }
.lessons-list .legal-links { padding: 18px 24px 4px; border-top: 1px solid var(--line); margin-top: 18px; }

/* Checkboxes legales de la compra */
.buy-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.55; margin: 0 0 12px; cursor: pointer; }
.buy-consent input { margin-top: 4px; flex-shrink: 0; accent-color: var(--plum); width: 16px; height: 16px; }
.buy-consent a { color: var(--plum); }

/* Progreso de lecciones (alumno) */
.lessons-progress { padding: 0 24px 14px; font-size: 13px; color: var(--ink-soft); }
.lessons-progress .bar, .progress-bar { height: 4px; background: var(--stone-soft); margin-top: 6px; overflow: hidden; }
.lessons-progress .bar i, .progress-bar i { display: block; height: 100%; background: var(--plum); }
.lesson-item.done .lesson-badge { background: var(--plum-soft); border-color: var(--plum-soft); color: var(--plum); }
.lesson-item.done.active .lesson-badge { background: var(--plum); color: var(--cream); }
.lesson-pct { margin-left: auto; font-family: var(--f-data); font-size: 12px; color: var(--ink-soft); }

/* ---------- Dashboard ---------- */
.kpi-row { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 6px 0 22px; }
.kpi { flex: 1 1 160px; background: var(--panel); padding: 16px 18px; }
.kpi .v { font-family: var(--f-serif); font-size: 26px; color: var(--plum); line-height: 1.2; }
.kpi .l { font-family: var(--f-serif); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-top: 4px; }
.kpi .s { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.dash-grid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart rect { fill: var(--plum); }
.bar-chart rect:hover { fill: var(--plum-dark); }
.bar-chart .axis { stroke: var(--line); }
.bar-chart text { font-family: var(--f-data); font-size: 11px; fill: var(--ink-soft); }
.attention h3 .count { font-family: var(--f-data); font-size: 13px; background: var(--plum-tint); color: var(--plum); padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.attention ul, .plain-list { list-style: none; padding: 0; margin: 8px 0; }
.attention li, .plain-list li { padding: 7px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.plain-list li { display: block; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { font-size: 13.5px; text-decoration: none; color: var(--ink); border: 1px solid var(--stone); padding: 5px 12px; border-radius: 999px; background: var(--panel); }
.chip span { font-family: var(--f-data); font-size: 12px; color: var(--ink-soft); margin-left: 4px; }
.chip:hover { border-color: var(--plum); }
.chip.active { background: var(--plum); border-color: var(--plum); color: var(--cream); }
.chip.active span { color: var(--stone); }
.admin-wrap td a { color: var(--plum); }
.coverage-strip { display: flex; height: 12px; background: var(--stone-soft); }
.coverage-strip i { flex: 1; background: var(--plum); }
.coverage-strip.empty { opacity: .6; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* Login: acceso a la compra */
.auth-alt { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--stone); text-align: center; }
.auth-alt .eyebrow { display: block; margin-bottom: 10px; }
.auth-alt .btn { width: 100%; padding: 12px 18px; }
.auth-alt .auth-foot { margin-top: 12px; }
