@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap');

:root{
  --bg:#f0f0ed;
  --surface:#ffffff;
  --surface-soft:#f7f7f5;
  --sidebar-bg:#ffffff;
  --text-primary:#111111;
  --text-secondary:#666666;
  --text-muted:#999999;
  --text:#111111;
  --text-soft:#666666;
  --border:rgba(0,0,0,.07);
  --border-soft:rgba(0,0,0,.04);
  --accent:#111111;
  --accent-hover:#333333;
  --accent-active-bg:#f2f2f0;
  --accent-2:#4f46e5;
  --accent-2-soft:#ede9fe;
  --success:#22a06b;
  --success-soft:#e3f5ec;
  --warning:#e07b00;
  --warning-soft:#fff0d9;
  --danger:#d93025;
  --danger-soft:#fde8e7;
  --shadow-xs:0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:0 1px 4px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  --shadow-md:0 4px 16px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  --radius-sm:6px;
  --radius-md:10px;
  --radius-lg:14px;
  --radius-xl:18px;
  --sidebar-width:220px;
  --topbar-height:auto;
  --footer-height:48px;
  --t:.15s ease;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Geist','Helvetica Neue',sans-serif;
  background:var(--bg);
  color:var(--text-primary);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}
[hidden]{display:none !important}
button{font:inherit;border:none;background:none;cursor:pointer}
table{width:100%;border-collapse:collapse}
.app{
  display:grid;
  grid-template-columns:var(--sidebar-width) 1fr;
  height:100vh;
  overflow:hidden;
}
.sidebar{
  width:var(--sidebar-width);
  background:var(--sidebar-bg);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  flex-shrink:0;
  overflow-y:auto;
  overflow-x:hidden;
}
.sidebar-logo{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 14px 12px;border-bottom:1px solid var(--border-soft)
}
.logo-mark{display:flex;align-items:center;gap:8px}
.logo-icon{
  width:28px;height:28px;border-radius:var(--radius-sm);background:var(--accent);
  color:#fff;display:grid;place-items:center;font-weight:700;font-size:.72rem;letter-spacing:-.02em
}
.logo-name{font-size:.92rem;font-weight:600;letter-spacing:-.02em;color:var(--text-primary)}
.logo-subtitle{font-size:.68rem;color:var(--text-muted)}
.sidebar-search{padding:10px 10px 6px}
.search-input-wrap{
  display:flex;align-items:center;gap:8px;
  padding:7px 10px;border:1px solid var(--border);background:var(--surface-soft);
  border-radius:var(--radius-sm);color:var(--text-muted);font-size:.78rem
}
.search-shortcut{
  margin-left:auto;font-size:.65rem;padding:1px 5px;border-radius:4px;
  background:var(--bg);border:1px solid var(--border);color:var(--text-muted);letter-spacing:.02em
}
.sidebar-nav{
  padding:6px 8px 12px;
  flex:1;
  min-height:0;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.nav-block{margin-bottom:0}
.nav-section-label{
  font-size:.6rem;color:var(--text-muted);text-transform:uppercase;
  letter-spacing:.1em;padding:0 6px;margin-bottom:2px;font-weight:600
}
.nav-item,.nav-sub-item{
  display:flex;align-items:center;gap:10px;
  padding:6px 8px;border-radius:var(--radius-sm);color:var(--text-secondary);
  font-weight:450;transition:background var(--t), color var(--t);
  cursor:pointer;
  width:100%;
  margin:0;
  border:0;
  background:transparent;
  text-align:left;
  appearance:none;
  -webkit-appearance:none;
  user-select:none;
  -webkit-user-select:none;
  font-size:.82rem
}
.nav-item:hover,.nav-sub-item:hover{background:var(--accent-active-bg);color:var(--text-primary)}
.nav-item:focus-visible,.nav-sub-item:focus-visible{outline:2px solid rgba(79,70,229,.35);outline-offset:1px}
.nav-item.active{background:var(--accent-active-bg);color:var(--text-primary);font-weight:500}
.nav-item.open .nav-arrow{transform:rotate(180deg)}
.nav-item-icon{width:16px;text-align:center;color:var(--text-muted)}
.nav-arrow{margin-left:auto;color:var(--text-muted);transition:transform var(--t)}
.nav-sub{display:none;padding-left:28px;padding-top:2px}
.nav-sub.open{display:block}
.nav-sub-item{font-size:.8rem;color:var(--text-secondary);padding:5px 8px;gap:6px}
.nav-sub-item::before{
  content:'';
  width:1px;
  height:14px;
  background:var(--border);
  margin-right:4px;
  flex-shrink:0;
}
.nav-sub-item.active{background:var(--accent-active-bg);color:var(--text-primary);font-weight:500}
.sidebar-footer-profile{
  margin-top:auto;padding:10px;border-top:1px solid var(--border-soft)
}
.user-pill{display:flex;gap:10px;align-items:center}
.avatar{
  width:32px;height:32px;border-radius:999px;background:var(--accent);color:#fff;
  display:grid;place-items:center;font-size:.72rem;font-weight:600
}
.user-name{font-size:.8rem;font-weight:500;color:var(--text-primary)}
.user-email{font-size:.68rem;color:var(--text-muted)}

.main-shell{
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  height:100vh;
  overflow:hidden;
}
.topbar{
  display:flex;justify-content:space-between;gap:20px;align-items:flex-start;
  padding:22px 22px 12px;border-bottom:1px solid var(--border-soft)
}
.breadcrumbs{font-size:.8rem;color:var(--text-muted);margin-bottom:8px}
.breadcrumbs span{margin:0 6px}
.topbar h1{font-size:2rem;line-height:1.1;letter-spacing:-.04em;margin-bottom:4px}
.subtitle{color:var(--text-soft);max-width:820px}
.topbar-right{display:flex;align-items:center;gap:10px}

.ghost-btn,.primary-btn,.icon-btn{
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  border-radius:12px;
  box-shadow:var(--shadow-sm);
  transition:transform var(--t), background var(--t), border-color var(--t);
}
.ghost-btn:hover,.primary-btn:hover,.icon-btn:hover{transform:translateY(-1px)}
.ghost-btn{padding:10px 12px}
.ghost-btn.small{padding:8px 10px;border-radius:10px;font-size:.86rem}
.primary-btn{
  padding:10px 14px;background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600
}
.icon-btn{width:38px;height:38px;display:grid;place-items:center}
.icon-btn.small{width:30px;height:30px;border-radius:10px}

.kpi-strip{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:12px;padding:14px 22px 16px;
}
.kpi-card{
  background:var(--surface);border:1px solid var(--border);border-radius:18px;
  box-shadow:var(--shadow-sm);padding:16px 16px 14px;min-width:0
}
.kpi-label{font-size:.82rem;color:var(--text-soft);margin-bottom:10px;font-weight:600}
.kpi-value{font-size:1.55rem;font-weight:800;letter-spacing:-.04em}
.kpi-value.warning{color:var(--warning)}
.kpi-meta{margin-top:6px;font-size:.82rem;color:var(--text-soft)}
.kpi-meta.positive{color:var(--success)}

.workbench{
  display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;
  padding:0 22px 16px;min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
}
.syllabus-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
}
.study-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.weekly-plan-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.tests-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.simulacros-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.progress-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.profile-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.opposition-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.preferences-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.help-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.system-status-workbench{
  padding:20px 22px 16px;
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.profile-form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.profile-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.profile-field span{
  font-size:.82rem;
  color:var(--text-soft);
  font-weight:600;
}
.profile-field input{
  border:1px solid var(--border);
  background:var(--surface-soft);
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
}
.profile-field select{
  border:1px solid var(--border);
  background:var(--surface-soft);
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
}
.progress-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.progress-table td:last-child,
.progress-table th:last-child{
  text-align:center;
  white-space:nowrap;
}
.simulacro-block-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.simulacro-block-list .ghost-btn.small{
  border-radius:999px;
}
.simulacro-table td:last-child,
.simulacro-table th:last-child{
  text-align:center;
  white-space:nowrap;
}
.tests-table td:last-child,
.tests-table th:last-child{
  text-align:center;
  white-space:nowrap;
}
.weekly-board{
  display:grid;
  grid-template-columns:repeat(7,minmax(220px,1fr));
  gap:10px;
  overflow-x:auto;
  padding-bottom:6px;
}
.weekly-day{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
  min-height:280px;
  display:flex;
  flex-direction:column;
}
.weekly-day-head{
  padding:10px 10px 8px;
  border-bottom:1px solid var(--border-soft);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.weekly-day-head strong{
  font-size:.86rem;
  letter-spacing:.02em;
}
.weekly-day-head span{
  font-size:.75rem;
  color:var(--text-soft);
  font-weight:600;
}
.weekly-day-list{
  flex:1 1 auto;
  min-height:90px;
  padding:8px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.weekly-day-list.drag-over{
  background:#f8fafc;
  outline:2px dashed rgba(79,70,229,.4);
  outline-offset:-4px;
  border-radius:10px;
}
.weekly-item{
  border:1px solid var(--border);
  background:var(--surface-soft);
  border-radius:10px;
  padding:8px;
  cursor:grab;
}
.weekly-item:active{
  cursor:grabbing;
}
.weekly-item-title{
  font-size:.82rem;
  font-weight:700;
  line-height:1.35;
  margin-bottom:4px;
}
.weekly-item-meta{
  font-size:.74rem;
  color:var(--text-soft);
  margin-bottom:6px;
}
.weekly-item-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.weekly-status-select{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:8px;
  padding:4px 6px;
  font:inherit;
  font-size:.74rem;
}
.weekly-empty{
  border:1px dashed var(--border);
  border-radius:10px;
  padding:10px;
  text-align:center;
  color:var(--text-soft);
  font-size:.8rem;
}
.study-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.study-meta{
  color:var(--text-soft);
  font-size:.92rem;
  line-height:1.5;
}
.study-actions-row{
  margin-top:14px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.study-checklist{
  margin:2px 0 0;
  padding-left:20px;
  display:flex;
  flex-direction:column;
  gap:10px;
  color:var(--text);
}
.study-checklist li{
  line-height:1.45;
  font-size:.94rem;
}
.construye-toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:12px;
}
.construye-select{
  flex:1;
  min-width:280px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:10px;
  padding:8px 10px;
  font:inherit;
}
.construye-card-preview{
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-soft);
  padding:12px;
  margin-bottom:12px;
}
.construye-route{
  font-size:.78rem;
  color:var(--text-muted);
  margin-bottom:6px;
  font-weight:600;
}
.construye-enunciado{
  font-size:.98rem;
  color:var(--text);
  line-height:1.45;
}
.construye-answer-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.construye-answer-input{
  flex:1;
  min-width:260px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
}
.construye-result{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  font-size:.88rem;
}
.construye-result strong{
  margin-right:8px;
}
.construye-result--ok{
  background:var(--success-soft);
  border-color:rgba(34,160,107,.3);
  color:var(--success);
}
.construye-result--partial{
  background:var(--warning-soft);
  border-color:rgba(224,123,0,.28);
  color:var(--warning);
}
.construye-result--bad{
  background:var(--danger-soft);
  border-color:rgba(217,48,37,.24);
  color:var(--danger);
}
.content-column{display:flex;flex-direction:column;gap:14px;min-width:0}
.right-rail{min-width:0}
.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:var(--shadow-sm);
  padding:18px;
}
.hero-panel{padding:20px}
.panel-head{
  display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:16px
}
.panel-head.compact{align-items:center}
.panel-head h2{font-size:1.35rem;letter-spacing:-.03em}
.panel-head h3{font-size:1.08rem;letter-spacing:-.02em}
.eyebrow{font-size:.76rem;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);font-weight:700;margin-bottom:6px}
.head-actions{display:flex;gap:8px;align-items:center}

.task-list{display:flex;flex-direction:column;gap:12px}
.task-item{
  display:flex;justify-content:space-between;gap:14px;align-items:center;
  border:1px solid var(--border);border-radius:16px;padding:14px;background:var(--surface-soft)
}
.task-main h3{font-size:1rem;margin:8px 0 4px}
.task-main p{font-size:.88rem;color:var(--text-soft)}
.task-side{display:flex;align-items:center;gap:10px}
.badge,.status-pill{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 10px;border-radius:999px;font-size:.76rem;font-weight:700
}
.badge.neutral{background:#efefeb;color:#3d414b}
.badge.info{background:var(--accent-2-soft);color:var(--accent-2)}
.badge.warning{background:var(--warning-soft);color:var(--warning)}
.badge.subtle{background:#f4f4f1;color:var(--text-soft)}
.status-pill.planned{background:#eef2ff;color:#4338ca}
.status-pill.progress{background:var(--success-soft);color:var(--success)}
.status-pill.alert{background:var(--danger-soft);color:var(--danger)}

.grid-two{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.bars-demo{display:flex;flex-direction:column;gap:12px}
.bar-row{display:grid;grid-template-columns:34px 1fr 42px;gap:10px;align-items:center}
.bar-row span,.bar-row strong{font-size:.86rem}
.bar-row span{color:var(--text-soft)}
.bar-track{height:10px;background:#efefeb;border-radius:999px;overflow:hidden}
.bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--accent-2),#7c3aed)}
.insight-box{
  background:var(--surface-soft);border:1px solid var(--border);border-radius:16px;padding:14px
}
.insight-title{font-weight:700;margin-bottom:10px}
.insight-box ul{padding-left:18px;color:var(--text-soft)}
.insight-box li+li{margin-top:8px}

.table-wrap{overflow:auto}
.data-table th,.data-table td{
  padding:14px 12px;border-bottom:1px solid var(--border-soft);text-align:left;white-space:nowrap
}
.data-table th{font-size:.78rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em}
.data-table td{font-size:.92rem}
.data-table tbody tr:hover{background:var(--surface-soft)}

.syllabus-panel{
  border-radius:20px;
}
.syllabus-toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:14px;
}
.syllabus-search-input{
  flex:1;
  border:1px solid var(--border);
  background:var(--surface-soft);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  font:inherit;
}
.syllabus-groups{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.syllabus-group{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface-soft);
  overflow:hidden;
}
.syllabus-group > summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  font-weight:700;
  color:var(--text);
}
.syllabus-group > summary::-webkit-details-marker{
  display:none;
}
.syllabus-group-meta{
  font-size:.82rem;
  color:var(--text-soft);
  font-weight:600;
}
.syllabus-group-body{
  padding:0 8px 8px;
  overflow-x:auto;
}
.syllabus-empty{
  border:1px dashed var(--border);
  border-radius:12px;
  padding:14px;
  color:var(--text-soft);
  background:var(--surface-soft);
}
.syllabus-topic-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.syllabus-block-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.syllabus-topic-card{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
.syllabus-topic-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--border-soft);
  background:var(--surface-soft);
}
.syllabus-topic-card-head h4{
  font-size:.96rem;
  letter-spacing:-.01em;
}
.syllabus-topic-card-head p{
  font-size:.78rem;
  color:var(--text-soft);
  font-weight:600;
  white-space:nowrap;
}
.syllabus-subtopic-table{
  min-width:0;
  width:100%;
  table-layout:fixed;
}
.syllabus-subtopic-table th,
.syllabus-subtopic-table td{
  padding:10px 12px;
}
.syllabus-subtopic-table th{
  white-space:nowrap;
}
.syllabus-subtopic-table td:nth-child(1),
.syllabus-subtopic-table td:nth-child(2){
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
}
.syllabus-subtopic-table th:nth-child(3),
.syllabus-subtopic-table td:nth-child(3),
.syllabus-subtopic-table th:nth-child(4),
.syllabus-subtopic-table td:nth-child(4){
  white-space:nowrap;
  text-align:center;
}
.syllabus-subtopic-table th:nth-child(5),
.syllabus-subtopic-table td:nth-child(5){
  white-space:nowrap;
  text-align:center;
}
.syllabus-normative-table th{
  white-space:nowrap;
}
.syllabus-normative-table{
  width:100%;
  table-layout:fixed;
}
.syllabus-normative-table td:nth-child(1){
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
}
.syllabus-normative-table th:nth-child(4),
.syllabus-normative-table td:nth-child(4),
.syllabus-normative-table th:nth-child(5),
.syllabus-normative-table td:nth-child(5){
  white-space:nowrap;
  text-align:center;
}
.syllabus-table{
  min-width:1080px;
  width:100%;
  table-layout:fixed;
}
.syllabus-table th,
.syllabus-table td{
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
  vertical-align:middle;
}
.syllabus-table th{
  white-space:nowrap;
  overflow-wrap:normal;
  word-break:normal;
}
.syllabus-table th:nth-child(3),
.syllabus-table td:nth-child(3){
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
  line-height:1.35;
}
.syllabus-table th:nth-child(1),
.syllabus-table th:nth-child(6),
.syllabus-table th:nth-child(7),
.syllabus-table th:nth-child(8),
.syllabus-table th:nth-child(9),
.syllabus-table td:nth-child(1),
.syllabus-table td:nth-child(6),
.syllabus-table td:nth-child(7),
.syllabus-table td:nth-child(8),
.syllabus-table td:nth-child(9){
  white-space:nowrap;
  text-align:center;
}
.syllabus-table th:nth-child(10),
.syllabus-table td:nth-child(10),
.syllabus-table th:nth-child(11),
.syllabus-table td:nth-child(11){
  white-space:nowrap;
}
.syllabus-table td:nth-child(10),
.syllabus-table td:nth-child(11){
  text-align:center;
}
.syllabus-table .status-pill{
  font-size:.68rem;
  padding:4px 8px;
  font-weight:600;
}
.syllabus-state-cell{
  min-width:130px;
}
.syllabus-action-cell{
  min-width:128px;
}
.syllabus-action-cell .ghost-btn.small{
  padding:4px 8px;
  font-size:.72rem;
  white-space:nowrap;
}

/* Regla fija para alinear Estado/Accion en todas las tablas de temario */
.syllabus-table th:nth-last-child(2),
.syllabus-table td:nth-last-child(2),
.syllabus-subtopic-table th:nth-last-child(2),
.syllabus-subtopic-table td:nth-last-child(2),
.syllabus-normative-table th:nth-last-child(2),
.syllabus-normative-table td:nth-last-child(2){
  width:140px;
  min-width:140px;
  max-width:140px;
  text-align:center;
  white-space:nowrap;
}
.syllabus-table th:nth-last-child(1),
.syllabus-table td:nth-last-child(1),
.syllabus-subtopic-table th:nth-last-child(1),
.syllabus-subtopic-table td:nth-last-child(1),
.syllabus-normative-table th:nth-last-child(1),
.syllabus-normative-table td:nth-last-child(1){
  width:120px;
  min-width:120px;
  max-width:120px;
  text-align:center;
  white-space:nowrap;
}

.opo-syllabus-reader{
  position:fixed;
  inset:0;
  z-index:130;
  display:none;
}
.opo-syllabus-reader.open{
  display:block;
}
.opo-syllabus-reader-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.42);
}
.opo-syllabus-reader-panel{
  position:absolute;
  top:16px;
  right:16px;
  width:min(920px,calc(100vw - 32px));
  height:calc(100vh - 32px);
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow-md);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.opo-syllabus-reader-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:14px 16px 12px;
  border-bottom:1px solid var(--border-soft);
}
.opo-syllabus-reader-head h3{
  font-size:1.1rem;
  letter-spacing:-.02em;
}
.opo-syllabus-reader-meta{
  margin-top:4px;
  color:var(--text-soft);
  font-size:.84rem;
}
.opo-syllabus-highlight-tools{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.opo-syllabus-highlight-colors{
  display:flex;
  align-items:center;
  gap:8px;
}
.opo-syllabus-highlight-color{
  width:22px;
  height:22px;
  border-radius:999px;
  border:2px solid rgba(15,23,42,.18);
  box-shadow:var(--shadow-sm);
}
.opo-syllabus-highlight-color[data-highlight-color="yellow"]{
  background:#fde047;
}
.opo-syllabus-highlight-color[data-highlight-color="green"]{
  background:#86efac;
}
.opo-syllabus-highlight-color[data-highlight-color="blue"]{
  background:#93c5fd;
}
.opo-syllabus-highlight-color[data-highlight-color="pink"]{
  background:#f9a8d4;
}
.opo-syllabus-highlight-color.active{
  border-color:var(--accent);
  transform:translateY(-1px) scale(1.03);
}
.opo-syllabus-highlight-toggle{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--text-soft);
  font-size:.84rem;
  user-select:none;
}
.opo-syllabus-highlight-toggle input{
  accent-color:var(--accent-2);
}
.opo-syllabus-reader-body{
  flex:1 1 auto;
  overflow:auto;
  padding:14px 16px;
}
.opo-syllabus-reader-summary{
  margin-bottom:14px;
  border:1px solid var(--border);
  background:var(--surface-soft);
  border-radius:12px;
  padding:10px 12px;
  color:var(--text-soft);
  font-size:.9rem;
  line-height:1.45;
}
.opo-syllabus-reader-content{display:flex;flex-direction:column;gap:10px}
.opo-syllabus-reader-empty{
  border:1px dashed var(--border);
  border-radius:12px;
  padding:12px;
  background:var(--surface-soft);
  color:var(--text-soft);
}
.syllabus-reader-section{
  margin:4px 0 2px;
  font-size:.92rem;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--text-muted);
}
.syllabus-reader-article{
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-soft);
  padding:12px;
}
.syllabus-reader-article-title{
  font-size:.98rem;
  line-height:1.35;
  letter-spacing:-.01em;
  margin-bottom:8px;
}
.syllabus-reader-article-body{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.syllabus-reader-paragraph{
  font-size:.9rem;
  line-height:1.56;
  color:var(--text);
}
.syllabus-reader-list{
  margin:0;
  padding-left:18px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.syllabus-reader-list li{
  font-size:.9rem;
  line-height:1.52;
  color:var(--text);
}
.syllabus-highlight{
  display:inline;
  line-height:inherit;
  padding:0;
  border-radius:2px;
  background-clip:padding-box;
  -webkit-background-clip:padding-box;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
}
.syllabus-highlight--yellow{
  background:rgba(253,224,71,.72) !important;
}
.syllabus-highlight--green{
  background:rgba(134,239,172,.72) !important;
}
.syllabus-highlight--blue{
  background:rgba(147,197,253,.72) !important;
}
.syllabus-highlight--pink{
  background:rgba(249,168,212,.72) !important;
}
.opo-syllabus-reader-foot{
  border-top:1px solid var(--border-soft);
  padding:10px 16px;
  display:flex;
  justify-content:flex-end;
}

.rail-panel{position:sticky;top:14px}
.segmented{
  display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:var(--surface-soft);
  border:1px solid var(--border);padding:5px;border-radius:12px;margin-bottom:12px
}
.segmented-btn{
  padding:8px 10px;border-radius:9px;font-size:.84rem;color:var(--text-soft)
}
.segmented-btn.active{background:#fff;color:var(--text);box-shadow:var(--shadow-sm);font-weight:700}
.mini-search{
  padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);
  color:var(--text-muted);font-size:.9rem;margin-bottom:12px
}
.rail-list{display:flex;flex-direction:column;gap:10px}
.rail-item{
  display:grid;grid-template-columns:34px 1fr;gap:10px;align-items:flex-start;
  padding:10px;border:1px solid var(--border);border-radius:14px;background:var(--surface-soft)
}
.rail-icon{
  width:34px;height:34px;border-radius:10px;background:#fff;border:1px solid var(--border);
  display:grid;place-items:center;color:var(--text-soft);font-weight:700
}
.rail-item strong{display:block;margin-bottom:2px}
.rail-item p{font-size:.84rem;color:var(--text-soft)}

.footer-bar{
  height:var(--footer-height);display:flex;justify-content:space-between;align-items:center;gap:20px;
  padding:0 22px;border-top:1px solid var(--border-soft);background:rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  flex-shrink:0;
  font-size:.84rem;color:var(--text-soft)
}
.footer-left,.footer-center,.footer-right{display:flex;gap:16px;align-items:center}
.sync-ok{color:var(--success);font-weight:700}

@media (max-width: 1320px){
  .kpi-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
  .workbench{grid-template-columns:1fr}
  .study-grid{grid-template-columns:1fr}
  .construye-answer-row .primary-btn{width:100%}
  .rail-panel{position:static}
  .weekly-board{grid-template-columns:repeat(4,minmax(220px,1fr))}
}
@media (max-width: 980px){
  .app{grid-template-columns:1fr}
  .sidebar{display:none}
  .grid-two{grid-template-columns:1fr}
  .topbar{flex-direction:column}
  .footer-bar{height:auto;padding:10px 16px;flex-direction:column;align-items:flex-start}
}
@media (max-width: 720px){
  .kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px 16px}
  .workbench{padding:0 16px 16px}
  .syllabus-workbench{padding:20px 16px 16px}
  .study-workbench{padding:20px 16px 16px}
  .weekly-plan-workbench{padding:20px 16px 16px}
  .tests-workbench{padding:20px 16px 16px}
  .simulacros-workbench{padding:20px 16px 16px}
  .progress-workbench{padding:20px 16px 16px}
  .profile-workbench{padding:20px 16px 16px}
  .opposition-workbench{padding:20px 16px 16px}
  .preferences-workbench{padding:20px 16px 16px}
  .help-workbench{padding:20px 16px 16px}
  .system-status-workbench{padding:20px 16px 16px}
  .topbar{padding:18px 16px 10px}
  .task-item{flex-direction:column;align-items:flex-start}
  .task-side{width:100%;justify-content:space-between}
  .syllabus-toolbar{flex-direction:column;align-items:stretch}
  .opo-syllabus-highlight-tools{
    align-items:flex-start;
  }
  .opo-syllabus-reader-panel{
    top:8px;
    right:8px;
    width:calc(100vw - 16px);
    height:calc(100vh - 16px);
  }
  .weekly-board{grid-template-columns:repeat(2,minmax(220px,1fr))}
  .progress-kpis{grid-template-columns:1fr}
  .profile-form-grid{grid-template-columns:1fr}
}
