/* =============================================
   GODABI Campus — app.css
   Aula virtual: claro, sobrio, con la marca GODABI
   ============================================= */

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

:root {
  --navy:       #0A1C33;
  --navy-2:     #0D2C54;
  --navy-3:     #16365F;
  --teal:       #008C99;
  --teal-600:   #00707A;
  --teal-300:   #66B9BF;
  --teal-50:    #E8F5F6;
  --bg:         #F4F6F9;
  --surface:    #FFFFFF;
  --surface-2:  #F8FAFC;
  --border:     #E2E8F0;
  --border-2:   #CBD5E1;
  --text:       #0F172A;
  --text-2:     #334155;
  --muted:      #64748B;
  --success:    #12805C;
  --success-50: #E7F6EF;
  --warning:    #B26A00;
  --warning-50: #FFF5E0;
  --danger:     #C23A3A;
  --danger-50:  #FDECEC;
  --radius:     10px;
  --radius-lg:  14px;
  --shadow-sm:  0 1px 2px rgba(15, 23, 42, .06);
  --shadow:     0 1px 3px rgba(15, 23, 42, .06), 0 6px 16px rgba(15, 23, 42, .06);
  --shadow-lg:  0 20px 50px rgba(15, 23, 42, .18);
  --sidebar-w:  256px;
  --focus:      0 0 0 3px rgba(0, 140, 153, .28);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid transparent; background: none;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--teal-600); text-decoration: none; }
.btn-dark { background: var(--navy-2); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--navy); }
.btn-outline { border-color: var(--border-2); background: var(--surface); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-2); text-decoration: none; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #A82F2F; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: none;
  display: inline-grid; place-items: center; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 32px; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.input:focus { border-color: var(--teal); box-shadow: var(--focus); outline: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--border-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand {
  position: relative; overflow: hidden; color: #fff;
  padding: 48px 56px; display: flex; flex-direction: column;
}
.auth-brand .logo { width: 200px; }
.auth-brand .pitch { margin-top: auto; max-width: 460px; }
.auth-brand h1 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.auth-brand h1 span { color: var(--teal-300); }
.auth-brand p { color: rgba(255,255,255,.75); margin-top: 14px; font-size: 16px; }
.auth-brand ul { list-style: none; margin-top: 28px; display: grid; gap: 12px; }
.auth-brand li { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.88); }
.auth-brand li i { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: var(--teal-300); font-size: 14px; }
.auth-brand footer { margin-top: 48px; font-size: 13px; color: rgba(255,255,255,.5); }
.auth-form { display: grid; place-items: center; padding: 48px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .eyebrow { color: var(--teal-600); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.auth-card h2 { font-size: 28px; font-weight: 800; margin: 8px 0 8px; }
.auth-card .lead { color: var(--muted); margin-bottom: 28px; }
.code-input { text-align: center; font-size: 26px; letter-spacing: 12px; font-weight: 700; height: 58px; font-variant-numeric: tabular-nums; }
.auth-card .back { margin-top: 16px; display: flex; justify-content: space-between; font-size: 14px; }
.auth-card .back button { background: none; border: 0; color: var(--teal-600); font-weight: 600; cursor: pointer; padding: 0; }
.auth-card .back button:disabled { color: var(--muted); cursor: default; }
.dev-note {
  margin-top: 20px; padding: 12px 14px; border-radius: 8px; font-size: 13px;
  background: var(--warning-50); color: #7A4A00; border: 1px dashed #E9B65C;
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.dev-note strong { font-size: 16px; letter-spacing: 3px; }
.no-access-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--warning-50); color: var(--warning); font-size: 22px; margin-bottom: 18px; }
.auth-card h2:focus { outline: none; }
.access-help { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: -8px 0 24px; font-size: 14px; }
.access-help ul { list-style: none; display: grid; gap: 10px; margin-top: 10px; color: var(--text-2); }
.access-help li { display: flex; gap: 10px; align-items: flex-start; }
.access-help li i { color: var(--teal-600); margin-top: 3px; width: 16px; text-align: center; }
.access-actions { display: grid; gap: 10px; }
.form-error { color: var(--danger); font-size: 13.5px; margin: -6px 0 14px; min-height: 0; }
.secure-note { margin-top: 28px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }

/* ---------- Estructura con barra lateral ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  color: rgba(255,255,255,.78);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 14px; z-index: 40;
}
.sidebar .brand { display: flex; align-items: center; padding: 4px 10px 22px; }
.sidebar .brand img { width: 150px; }
.sidebar .role-tag {
  margin: 0 10px 18px; padding: 8px 10px; border-radius: 8px; font-size: 12px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 8px;
}
.sidebar .role-tag b { color: #fff; font-weight: 600; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.4); padding: 8px 12px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,.78); font-weight: 500; font-size: 14.5px; margin-bottom: 2px;
}
.nav a i { width: 18px; text-align: center; color: rgba(255,255,255,.5); }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(0,140,153,.22); color: #fff; }
.nav a.active i { color: var(--teal-300); }
.sidebar .bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.sidebar .site-link { font-size: 13px; color: rgba(255,255,255,.55); display: flex; gap: 8px; align-items: center; padding: 8px 12px; }
.sidebar .site-link:hover { color: #fff; text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn { display: none; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 99px; }
.user-btn:hover { background: var(--surface-2); }
.user-btn .who { text-align: right; line-height: 1.2; }
.user-btn .who b { display: block; font-size: 13.5px; }
.user-btn .who span { font-size: 12px; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--navy-2));
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.dropdown .head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px;
  border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--text);
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown i { width: 16px; color: var(--muted); }

.page { padding: 32px 28px 64px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 4px; }
.section-title { font-size: 18px; font-weight: 700; margin: 32px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title .count { color: var(--muted); font-weight: 500; font-size: 14px; }

/* ---------- Tarjetas y paneles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 15px; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; }
.kpi .k-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .k-label i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-600); font-size: 13px; }
.kpi .k-value { font-size: 28px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); }

.hero {
  border-radius: var(--radius-lg); color: #fff; padding: 28px 30px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.hero h1 { font-size: 26px; font-weight: 800; }
.hero p { color: rgba(255,255,255,.78); margin-top: 6px; }
.hero .stats { display: flex; gap: 28px; margin-top: 20px; flex-wrap: wrap; }
.hero .stats div b { display: block; font-size: 22px; font-weight: 800; }
.hero .stats div span { font-size: 12.5px; color: rgba(255,255,255,.65); }

.resume {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; padding: 16px; align-items: center; margin-top: 20px;
}
.resume .cover { border-radius: 10px; }
.resume .eyebrow { font-size: 12px; color: var(--teal-600); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.resume h3 { font-size: 19px; margin: 4px 0 2px; }
.resume .lesson { color: var(--muted); font-size: 14px; }
.resume .actions { margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Portada de curso (imagen o generada) */
.cover {
  aspect-ratio: 16 / 9; position: relative; overflow: hidden; background: var(--navy-2);
  display: grid; place-items: center;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.gen { background: var(--g, radial-gradient(circle at 15% 0%, #13233A, #0B0D17 60%)); }
.cover.gen::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.18) 1.2px, transparent 1.2px);
  background-size: 18px 18px; mask-image: linear-gradient(120deg, transparent 20%, #000 90%);
}
.cover.gen .glyph { position: relative; color: rgba(255,255,255,.92); font-size: 34px; }
.cover.gen .tag { position: absolute; left: 14px; bottom: 12px; color: rgba(255,255,255,.85); font-size: 12px; font-weight: 600; letter-spacing: .04em; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.course-card { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; color: inherit; }
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.course-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-card .cat { font-size: 12px; color: var(--teal-600); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.course-card h3 { font-size: 16.5px; font-weight: 700; }
.course-card .teacher { font-size: 13.5px; color: var(--muted); }
.course-card .foot { margin-top: auto; padding-top: 12px; }
.progress { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: inherit; transition: width .4s; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.progress-meta b { color: var(--text); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.badge.success { background: var(--success-50); color: var(--success); border-color: transparent; }
.badge.warning { background: var(--warning-50); color: var(--warning); border-color: transparent; }
.badge.teal { background: var(--teal-50); color: var(--teal-600); border-color: transparent; }
.badge.navy { background: #E8EEF7; color: var(--navy-2); border-color: transparent; }
.badge.muted { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Tablas ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.toolbar .search .input { padding-left: 34px; height: 38px; }
.toolbar select.input { width: auto; height: 38px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 12px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FBFCFE; }
.table .person { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.table .person b { display: block; font-weight: 600; }
.table .person span { font-size: 13px; color: var(--muted); }
.table .actions { text-align: right; white-space: nowrap; }
.table .num { font-variant-numeric: tabular-nums; }
.mini-progress { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.mini-progress .progress { flex: 1; }
.mini-progress span { font-size: 12.5px; color: var(--muted); width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty i { font-size: 30px; color: var(--teal-300); margin-bottom: 12px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs button, .tabs a {
  border: 0; background: none; padding: 12px 14px; font-weight: 600; font-size: 14.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.tabs .active { color: var(--text); border-bottom-color: var(--teal); }

/* ---------- Editor de curso ---------- */
.editor-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.editor-head .cover { width: 160px; border-radius: 10px; flex: none; }
.editor-head .cover .glyph { font-size: 24px; }
.editor-head .cover .tag { display: none; }
.editor-head .info { flex: 1; min-width: 240px; }
.editor-head h1 { font-size: 24px; font-weight: 800; }
.editor-head .meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.editor-head .acts { display: flex; gap: 10px; flex-wrap: wrap; }

.sec { margin-bottom: 16px; overflow: hidden; }
.sec-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.sec-head .n { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.sec-head h3 { font-size: 15.5px; flex: 1; min-width: 0; }
.sec-head .tools { display: flex; gap: 2px; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--border); }
.lesson-row:last-of-type { border-bottom: 0; }
.lesson-row .ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 13px; }
.lesson-row .ico.ok { background: var(--teal-50); color: var(--teal-600); }
.lesson-row .ico.no { background: var(--warning-50); color: var(--warning); }
.lesson-row .txt { flex: 1; min-width: 0; }
.lesson-row .txt b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-row .txt span { font-size: 13px; color: var(--muted); }
.lesson-row .tools { display: flex; gap: 2px; }
.sec-foot { padding: 10px 14px; }
.add-section { width: 100%; border: 1.5px dashed var(--border-2); background: transparent; border-radius: var(--radius-lg); padding: 18px; font-weight: 600; color: var(--text-2); cursor: pointer; display: flex; gap: 10px; align-items: center; justify-content: center; }
.add-section:hover { border-color: var(--teal); color: var(--teal-600); background: var(--teal-50); }

.dropzone {
  border: 1.5px dashed var(--border-2); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: border-color .15s, background .15s; color: var(--muted); font-size: 14px;
}
.dropzone:hover, .dropzone.over { border-color: var(--teal); background: var(--teal-50); }
.dropzone i { font-size: 22px; color: var(--teal); display: block; margin-bottom: 8px; }
.dropzone b { color: var(--text); }
.file-chip { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.file-chip i.f { color: var(--teal-600); }
.file-chip .t { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .s { font-size: 12.5px; color: var(--muted); }
.file-list { display: grid; gap: 8px; margin-bottom: 10px; }
.upload-bar { margin-top: 10px; }
.upload-bar .progress { height: 8px; }
.upload-bar .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 28, 51, .55); display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: center; padding: 20px; z-index: 100; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; min-width: 0; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal.wide { max-width: 720px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal p.text { color: var(--text-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-bottom: 18px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 10px; z-index: 200; }
.toast {
  background: #0B0D17; border: 1px solid rgba(255,255,255,.08); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; font-size: 14px; max-width: 380px; animation: rise .2s ease-out;
}
.toast.ok i { color: #5DD3A6; }
.toast.err { background: #5E1E1E; }
.toast.err i { color: #FF9B9B; }

/* ---------- Reproductor ---------- */
.player-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.player-top {
  height: 60px; background: #0B0D17; border-bottom: 1px solid rgba(255,255,255,.06); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.player-top img { width: 104px; }
.player-top .divider { width: 1px; height: 26px; background: rgba(255,255,255,.18); }
.player-top h1 { font-size: 15px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-top a.exit { color: rgba(255,255,255,.8); font-size: 14px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.player-top a.exit:hover { color: #fff; text-decoration: none; }
.ring { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,.8); white-space: nowrap; }
.ring svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring .bg { stroke: rgba(255,255,255,.15); }
.ring .fg { stroke: var(--teal-300); transition: stroke-dashoffset .4s; }
.player-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; flex: 1; min-height: 0; }
.stage { min-width: 0; }
.video-box { background: #000; position: relative; }
.video-box iframe { width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 160px); display: block; border: 0; background: #000; }
.video-wait { aspect-ratio: 16 / 9; max-height: calc(100vh - 160px); display: grid; place-items: center; background: #000; }
.video-wait .spinner { border-color: rgba(255,255,255,.15); border-top-color: var(--teal-300); }
.video-box video { width: 100%; max-height: calc(100vh - 160px); aspect-ratio: 16 / 9; display: block; background: #000; }
.no-video {
  aspect-ratio: 16 / 9; max-height: calc(100vh - 160px); width: 100%; display: grid; place-items: center; text-align: center; color: rgba(255,255,255,.85); padding: 24px;
}
.no-video i { font-size: 34px; color: var(--teal-300); margin-bottom: 14px; }
.no-video h2 { font-size: 20px; }
.no-video p { color: rgba(255,255,255,.65); margin-top: 6px; }
.next-overlay { position: absolute; inset: 0; background: rgba(11,13,23,.9); display: grid; place-items: center; text-align: center; color: #fff; padding: 20px; }
.next-overlay .small { font-size: 13px; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .08em; }
.next-overlay h3 { font-size: 22px; margin: 8px 0 20px; max-width: 520px; }
.next-overlay .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.next-overlay .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

.lesson-bar { display: flex; align-items: center; gap: 12px; padding: 16px 28px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lesson-bar h2 { font-size: 20px; font-weight: 700; flex: 1; min-width: 220px; }
.lesson-bar .nav-btns { display: flex; gap: 8px; }
.lesson-content { padding: 0 28px 48px; max-width: 900px; }
.lesson-content .tabs { margin-bottom: 20px; }
.prose { color: var(--text-2); white-space: pre-line; }
.prose.muted { color: var(--muted); }
.res-list { display: grid; gap: 10px; }
.res-list a.file-chip { color: inherit; }
.res-list a.file-chip:hover { border-color: var(--teal); text-decoration: none; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.about-grid div { padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.about-grid span { font-size: 12.5px; color: var(--muted); display: block; }
.about-grid b { font-size: 15px; }

.curriculum { border-left: 1px solid var(--border); background: var(--surface); position: sticky; top: 60px; height: calc(100vh - 60px); display: flex; flex-direction: column; }
.curriculum .c-head { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.curriculum .c-head h3 { font-size: 15px; }
.curriculum .c-head .progress { margin-top: 10px; }
.curriculum .c-head .hint { margin-top: 6px; display: block; }
.curriculum .c-list { overflow-y: auto; flex: 1; }
.c-sec > button {
  width: 100%; border: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); padding: 14px 18px; text-align: left; cursor: pointer;
  display: flex; gap: 10px; align-items: flex-start;
}
.c-sec > button .t { flex: 1; }
.c-sec > button b { font-size: 14px; display: block; }
.c-sec > button span { font-size: 12px; color: var(--muted); }
.c-sec > button i { color: var(--muted); margin-top: 4px; transition: transform .2s; }
.c-sec.closed > button i { transform: rotate(-90deg); }
.c-sec.closed .c-items { display: none; }
.c-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.c-item:hover { background: var(--surface-2); }
.c-item.current { background: var(--teal-50); box-shadow: inset 3px 0 0 var(--teal); }
.c-item .check { margin-top: 2px; width: 18px; height: 18px; flex: none; border-radius: 4px; border: 1.5px solid var(--border-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; }
.c-item .check.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.c-item .check i { font-size: 10px; opacity: 0; }
.c-item .check.on i { opacity: 1; }
.c-item .t { flex: 1; min-width: 0; }
.c-item .t b { font-weight: 500; font-size: 14px; display: block; }
.c-item .t span { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 2px; }

.preview-banner { background: var(--warning-50); color: #7A4A00; padding: 8px 20px; font-size: 13px; display: flex; gap: 8px; align-items: center; justify-content: center; }

/* ---------- Carga ---------- */
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #EDF1F6 25%, #F6F8FB 50%, #EDF1F6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.scrim { display: none; }

/* ---------- Fondo GODABI (como FibraBot) en las zonas de color: ver lines.js ---------- */
.lines-bg { position: relative; isolation: isolate; background: radial-gradient(circle at 15% 0%, #13233A, #0B0D17 60%) #0B0D17; }
.lines-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }
.sidebar.lines-bg { border-right: 1px solid rgba(255,255,255,.06); }
.hero.lines-bg { border: 1px solid rgba(102,185,191,.14); }
.no-video.lines-bg { background: radial-gradient(circle at 50% 30%, #13233A, #0B0D17 70%) #0B0D17; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-body { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px 32px; }
  .auth-brand .pitch { margin-top: 28px; }
  .auth-brand ul, .auth-brand footer { display: none; }
  .auth-brand .logo { width: 150px; }
  .auth-form { padding: 32px 16px 48px; place-items: start center; }

  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,28,51,.5); z-index: 35; }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: inline-grid; }
  .user-btn .who { display: none; }
  .page { padding: 24px 16px 48px; }
  .resume { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 0; }

  .player-body { grid-template-columns: 1fr; }
  .curriculum { position: static; height: auto; border-left: 0; border-top: 1px solid var(--border); }
  .curriculum .c-list { overflow: visible; }
  .player-top { padding: 0 14px; gap: 12px; }
  .player-top img, .player-top .divider, .ring .ring-suffix { display: none; }
  .ring { font-weight: 600; color: #fff; }
  .lesson-bar, .lesson-content { padding-left: 16px; padding-right: 16px; }
  .about-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  /* Tablas como tarjetas apiladas */
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0; border: 0; }
  .table td:first-child { flex: 1 1 100%; }
  .table td:first-child a { min-width: 0 !important; }
  .table td[data-label]:not(:first-child)::before {
    content: attr(data-label); display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 3px;
  }
  .table td.actions { margin-left: auto; }
  .table .person { min-width: 0; }
  .table tbody tr:hover td { background: none; }
  .mini-progress { min-width: 150px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .auth-brand { padding: 22px 20px 24px; }
  .auth-brand .pitch { margin-top: 18px; }
  .auth-brand h1 { font-size: 24px; }
  .auth-brand p { display: none; }
  .hero .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .hero .stats div b { font-size: 20px; }
  .tabs button, .tabs a { padding: 12px 10px; font-size: 14px; }
  .tabs a i { display: none; }
  .sec-head { flex-wrap: wrap; gap: 4px 12px; }
  .sec-head .tools { margin-left: auto; }
  .sec-head h3 { order: 3; flex: 1 1 100%; }
  .lesson-row { flex-wrap: wrap; row-gap: 6px; }
  .lesson-row .txt { flex: 1 1 100%; }
  .lesson-row .txt b { white-space: normal; }
  .lesson-row .tools { margin-left: auto; }
  .c-item .check { position: relative; }
  .c-item .check::after { content: ''; position: absolute; inset: -12px; }
  .auth-card .back button { padding: 8px 0; }
  .kpi { padding: 14px; }
  .kpi .k-value { font-size: 22px; }
  .page-head h1 { font-size: 22px; }
  .hero { padding: 22px 20px; }
  .lesson-row { padding-left: 14px; gap: 10px; }
  .lesson-row .ico { display: none; }
  .sec-head { padding-left: 14px; flex-wrap: wrap; }
  .modal-back { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .toasts { left: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
