/* ====================================================================
   PlanQca · Estilos base
   ==================================================================== */
:root {
    --bg:        #f4f6f8;
    --surface:   #ffffff;
    --primary:   #0b6b5e;
    --primary-d: #095245;
    --primary-l: #e6f4f1;
    --accent:    #f0a830;
    --text:      #1a2330;
    --muted:     #6b7785;
    --border:    #e2e8f0;
    --danger:    #d64545;
    --radius:    14px;
    --shadow:    0 4px 18px rgba(16, 42, 67, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* ---------- Topbar ---------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topnav { margin-left: 22px; }
.user-menu { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px;
    background: var(--primary); color: #fff; border-radius: 9px; font-size: 18px;
}
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.topnav a {
    padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: 14px;
}
.topnav a:hover { background: var(--primary-l); color: var(--primary-d); text-decoration: none; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
    border: 1px solid transparent; cursor: pointer; transition: .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-d); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c9c9; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-small { padding: 7px 13px; font-size: 13px; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover, .btn[disabled]:hover { transform: none; background: var(--primary); }
.btn-ghost:disabled:hover { background: var(--surface); }

/* ---------- Paneles y tarjetas ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 18px; }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 20px; text-align: center; }

/* ---------- Tablas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
.table tbody tr:hover { background: var(--primary-l); }

.chip {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: var(--primary-l); color: var(--primary-d); font-weight: 600; font-size: 12px;
}
.chip-time { background: #fdf0d9; color: #a96b13; }
.chip-manual { background: #e7f0ff; color: #245bbf; }
.chip-ia { background: #ece3fb; color: #6b3fb0; }

.link { font-weight: 600; }

.badge { display: inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.badge-ok { background: #d9f3ec; color: var(--primary-d); }
.badge-warn { background: #fdeccf; color: #a96b13; }

/* ---------- Avisos ---------- */
.notice { border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; font-size: 14px; }
.notice-warn { background: #fdf3e1; border: 1px solid #f3d9a8; color: #8a5a12; }
.notice code { background: #fff; padding: 1px 6px; border-radius: 5px; }

/* ---------- Formularios ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.step-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; gap: 16px; }
.step-num {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.step-body { flex: 1; }
.step-body label { display: block; font-weight: 600; margin-bottom: 7px; }
select, textarea,
input[type="number"], input[type="text"], input[type="password"], input[type="email"] {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
    font-family: inherit; font-size: 14px; background: #fff; color: var(--text);
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--primary-l); border-color: var(--primary); }
select:disabled { background: #f1f4f7; color: var(--muted); }
.oa-desc { margin-top: 8px; font-size: 13px; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.loading { margin-top: 18px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.spinner {
    width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ---------- Resultado / clases ---------- */
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.oa-banner { background: var(--primary-l); border-left: 4px solid var(--primary); padding: 14px 16px; border-radius: 10px; margin-bottom: 22px; font-size: 14px; }

/* Indicadores de evaluación */
.ind-banner { background: #fbf7ee; border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 10px; margin-bottom: 22px; font-size: 13.5px; }
.ind-lista { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }
.ind-lista li { margin-bottom: 3px; }
.ind-checklist { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-top: 4px; max-height: 240px; overflow-y: auto; }
.ind-todos { display: block; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--border); font-size: 13.5px; cursor: pointer; }
.ind-item { display: flex; gap: 9px; align-items: flex-start; padding: 6px 4px; font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.ind-item:hover { background: var(--primary-l); }
.ind-item input { margin-top: 3px; flex: 0 0 auto; width: auto; }

.clase-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow); scroll-margin-top: 80px; }
/* Notas al pie de recursos (marcadores [n] en las actividades) */
.ref-sup { font-size: 0.7em; line-height: 0; vertical-align: super; margin-left: 1px; }
.ref-sup a { display: inline-block; min-width: 14px; text-align: center; color: var(--primary-d); text-decoration: none; font-weight: 700; }
.ref-sup a:hover { text-decoration: underline; }
.referencias { margin-top: 16px; padding: 12px 16px; background: #f6f8fc; border: 1px solid var(--border); border-radius: 10px; }
.referencias h4 { margin: 0 0 8px; font-size: 14px; color: var(--primary-d); }
.ref-lista { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
.ref-lista li { margin-bottom: 4px; scroll-margin-top: 90px; }
.ref-lista li:target { background: #fff6d6; border-radius: 4px; }

/* Panel plegable de vista previa del prompt (modo prueba) */
.prompt-previa { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 24px 0; }
.prompt-previa summary { cursor: pointer; font-weight: 600; color: var(--primary-d); }
.prompt-previa h4 { margin: 16px 0 6px; }
.prompt-bloque { background: #1e1e2e; color: #e4e4ef; padding: 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }

/* Resalta brevemente la clase a la que se vuelve tras regenerar */
.clase-card:target { animation: destacar 1.6s ease-out; }
@keyframes destacar { 0% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: var(--shadow); } }
.clase-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.clase-head h2 { margin: 0; font-size: 20px; color: var(--primary-d); }
.clase-acciones { margin-left: auto; display: flex; gap: 8px; }

.clase-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.campo h4, .momento h4, .secuencia h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

/* Encabezado de campo con botón de regenerar */
.campo-head, .secuencia-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.campo-head h4, .secuencia-head h3 { margin: 0 0 6px; }
.btn-regen {
    flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--muted);
    border: 1px solid var(--border); border-radius: 8px; padding: 3px 9px; line-height: 1.4;
    text-decoration: none; white-space: nowrap; transition: .12s;
}
.btn-regen:hover { border-color: var(--primary); color: var(--primary-d); background: var(--primary-l); text-decoration: none; }

/* En modo edición se ocultan las acciones que recargan la página */
.modo-edicion .btn-regen,
.modo-edicion .clase-acciones { display: none; }
.campo-view { font-size: 14px; }
.campo-edit { min-height: 90px; resize: vertical; }

.secuencia { background: #f8fafb; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 6px 0 16px; }
.secuencia h3 { color: var(--primary-d); font-size: 14px; margin-bottom: 12px; }
.momento { margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--border); }
.momento-inicio { border-left-color: #5aa9e6; }
.momento-desarrollo { border-left-color: var(--primary); }
.momento-cierre { border-left-color: var(--accent); }

.result-footer { display: flex; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; gap: 10px; }

/* Barra de confirmación (planificación generada aún sin guardar) */
.confirmar-acciones {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 18px; margin-top: 10px; box-shadow: 0 -4px 18px rgba(16, 42, 67, .08);
}

/* ---------- Errores ---------- */
.error-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 50px 30px; text-align: center; box-shadow: var(--shadow); }
.error-icon { font-size: 42px; color: var(--accent); margin-bottom: 8px; }
.error-box h1 { margin: 0 0 8px; }
.error-box .form-actions { justify-content: center; }

/* ---------- Menú de usuario ---------- */
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.user-info { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-weight: 600; font-size: 13.5px; }
.user-rol { font-size: 11.5px; color: var(--muted); }

.chip-admin { background: #ede3fb; color: #6b3fb0; }

.dot-ok, .dot-off { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.dot-ok { background: #16a085; }
.dot-off { background: #c5ccd4; }

.acciones { display: flex; gap: 12px; }
.link-danger { color: var(--danger); }

.errores-lista { margin: 8px 0 0; padding-left: 18px; }
.campo-form { margin-bottom: 16px; }
.campo-form label { display: block; font-weight: 600; margin-bottom: 7px; }
.campo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }

/* ---------- Configuración ---------- */
.notice-ok { background: #d9f3ec; border: 1px solid #aadfd2; color: #0a5a4d; }
.notice-error { background: #fdecec; border: 1px solid #f3b8b8; color: #8a1212; }
.small { font-size: 12.5px; }

.estado-ia {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-radius: 12px; margin-bottom: 22px; font-size: 14px;
}
.estado-ok { background: #d9f3ec; border: 1px solid #aadfd2; color: #0a5a4d; }
.estado-demo { background: #fdf3e1; border: 1px solid #f3d9a8; color: #8a5a12; }
.estado-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.estado-ok .estado-dot { background: #16a085; box-shadow: 0 0 0 4px rgba(22,160,133,.18); }
.estado-demo .estado-dot { background: #e0922f; box-shadow: 0 0 0 4px rgba(224,146,47,.18); }

.config-block { padding: 18px 0; border-bottom: 1px solid var(--border); }
.config-block:last-of-type { border-bottom: 0; }
.config-block h2 { font-size: 17px; margin: 0 0 6px; }

.key-actual { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.key-actual code { background: #f1f4f7; padding: 4px 10px; border-radius: 7px; font-size: 13px; }
.key-input { display: flex; gap: 8px; margin-top: 6px; }
.key-input input { flex: 1; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }

/* Tarjeta por proveedor (modelos + API key juntos) */
.proveedor-card {
    border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px;
    background: var(--surface); box-shadow: var(--shadow); border-left: 4px solid var(--border); transition: .15s;
}
.proveedor-card.proveedor-activo { border-left-color: var(--primary); }
.prov-anthropic.proveedor-card { border-left-color: #0b6b5e; }
.prov-google.proveedor-card    { border-left-color: #1a73e8; }
.prov-openai.proveedor-card    { border-left-color: #0a8f6e; }

.proveedor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.proveedor-head h2 { margin: 0; font-size: 18px; }

/* Opción de modelo (fila seleccionable) */
.proveedor-modelos { display: flex; flex-direction: column; gap: 10px; }
.modelo-opcion {
    position: relative; display: flex; align-items: center; gap: 12px;
    border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: .12s;
}
.modelo-opcion:hover { border-color: #b9d9d2; background: #fafdfc; }
.modelo-opcion.modelo-activo { border-color: var(--primary); background: var(--primary-l); }
.modelo-opcion input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.modelo-radio {
    flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c5ccd4;
    display: inline-block; position: relative; transition: .12s;
}
.modelo-opcion.modelo-activo .modelo-radio { border-color: var(--primary); }
.modelo-opcion.modelo-activo .modelo-radio::after {
    content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary);
}
.modelo-cuerpo { flex: 1; min-width: 0; }
.modelo-linea { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modelo-nombre { font-weight: 700; font-size: 15px; }
.modelo-tag {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 999px;
}
.modelo-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modelo-lado { flex: 0 0 auto; text-align: right; }
.modelo-costo { font-weight: 800; letter-spacing: 1px; font-size: 14px; }
.modelo-costo span { color: #d3dae1; }
.modelo-costo span.on { color: #16a085; }
.modelo-precio { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* Bloque de API key dentro de la tarjeta del proveedor */
.proveedor-key { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.key-titulo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-weight: 600; font-size: 13.5px; }
.key-guardada { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.key-guardada code { background: #f1f4f7; padding: 3px 8px; border-radius: 6px; }

.prueba-resultado { margin-top: 14px; font-size: 14px; font-weight: 500; }
.prueba-resultado:empty { display: none; }
.prueba-cargando { color: var(--muted); }
.prueba-ok { color: #0a5a4d; }
.prueba-error { color: var(--danger); }

/* ---------- Selector de modo (IA / pegar JSON) ---------- */
.modo-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.modo-tab {
    display: flex; align-items: center; gap: 12px; text-align: left;
    padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px;
    background: var(--surface); cursor: pointer; transition: .15s; box-shadow: var(--shadow-sm);
}
.modo-tab:hover { border-color: #b9d9d2; }
.modo-tab-activo { border-color: var(--primary); background: var(--primary-l); }
.modo-tab-ic { font-size: 24px; flex: 0 0 auto; }
.modo-tab span span, .modo-tab > span { display: flex; flex-direction: column; line-height: 1.25; }
.modo-tab strong { font-size: 15px; }
.modo-tab small { color: var(--muted); font-size: 12px; }

.modo-bloque { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 18px; }
.manual-pasos { background: #f6f8fc; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }
.manual-pasos h3 { margin: 0 0 8px; font-size: 15px; color: var(--primary-d); }
.manual-pasos ol { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.manual-prompt-acciones { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.manual-label { display: block; font-weight: 600; margin: 6px 0 7px; }
.prompt-area {
    width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
    line-height: 1.5; border-radius: 10px; resize: vertical;
}
#prompt-texto { background: #1e1e2e; color: #e4e4ef; margin-top: 10px; }
.manual-aviso { font-size: 13px; line-height: 1.55; }
.manual-prev-acciones { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.manual-preview { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 16px; }
.manual-preview .clase-card { box-shadow: none; }

/* ---------- Mis planificaciones (filtros) ---------- */
.hist-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Buscador tipo "pill" con icono y botón de limpiar */
.hist-buscar { position: relative; flex: 1 1 280px; min-width: 220px; display: flex; align-items: center; }
.hist-buscar-icon { position: absolute; left: 15px; font-size: 15px; opacity: .55; pointer-events: none; }
.hist-buscar input[type="search"] {
    width: 100%; padding: 12px 40px 12px 42px; border-radius: 999px;
    border: 1.5px solid var(--border); background: #fff; font-size: 14.5px;
    box-shadow: 0 1px 2px rgba(16, 42, 67, .05); transition: border-color .15s, box-shadow .18s;
    -webkit-appearance: none; appearance: none;
}
.hist-buscar input[type="search"]::-webkit-search-cancel-button { display: none; }
.hist-buscar input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11, 107, 94, .15); outline: none; }
.hist-buscar-x {
    position: absolute; right: 10px; width: 24px; height: 24px; border: 0; border-radius: 50%;
    background: #eef1f5; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1;
    display: grid; place-items: center; transition: .12s;
}
.hist-buscar-x:hover { background: var(--danger); color: #fff; }

.hist-filtros { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hist-select {
    flex: 0 1 auto; min-width: 160px; max-width: 260px; padding: 10px 12px;
    border-radius: 10px; font-size: 13.5px; background: #fff;
}
.hist-reporte { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oa-mini { font-size: 11.5px; margin-top: 3px; max-width: 240px; line-height: 1.35; }
@media (max-width: 720px) {
    .hist-reporte { margin-left: 0; }
    .hist-select { min-width: 0; flex: 1 1 140px; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 18px 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .clase-grid { grid-template-columns: 1fr; }
    .topbar-inner { height: auto; padding: 10px 20px; flex-direction: column; gap: 8px; align-items: flex-start; }
    .topnav { margin-left: 0; }
    .user-menu { margin-left: 0; }
    .result-head { flex-direction: column; }
}

/* ===== Evaluaciones ===== */
.eval-instrucciones { margin-bottom: 14px; }
.eval-cuerpo { padding: 18px 22px; }
.eval-items { margin: 0; padding-left: 22px; }
.eval-item { margin-bottom: 16px; }
.eval-enunciado { font-weight: 600; }
.eval-pts { color: var(--brand, #0b6b5e); font-weight: 700; font-size: .85em; margin-left: 6px; }
.eval-opciones { margin: 6px 0 0 6px; white-space: pre-line; color: #333; }
.eval-lineas { border-bottom: 1px dashed #bbb; height: 40px; margin-top: 6px; }
.eval-pauta { margin-top: 6px; background: #fff7e6; border-left: 3px solid #e0a800; padding: 5px 10px; border-radius: 4px; }
.eval-ind { font-size: .8em; font-style: italic; margin-top: 3px; }
.eval-tabla { width: 100%; border-collapse: collapse; margin: 6px 0; }
.eval-tabla th, .eval-tabla td { border: 1px solid #d8dee6; padding: 8px 10px; vertical-align: top; text-align: left; }
.eval-tabla th { background: #e6f4f1; }
.eval-tabla td { white-space: pre-line; }
.eval-chk { text-align: center; font-size: 1.1em; width: 70px; }
.eval-pts-col { text-align: center; width: 52px; }
.eval-total { margin-top: 14px; font-size: 1.05em; }
.eval-kpsi-leyenda { margin-bottom: 10px; }
.chip-instr { background: #eef2ff; color: #3b4ba8; }
.eval-prev-head { margin-bottom: 10px; font-size: 1.05em; }
.eval-prev-item { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #eef0f3; }

/* ===== Menú con submenús desplegables ===== */
.nav-drop { position: relative; }
.nav-drop-btn {
    padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 500;
    font-size: 14px; background: none; border: 0; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 5px;
}
.nav-drop-btn:hover { background: var(--primary-l); color: var(--primary-d); }
.caret { font-size: 10px; opacity: .7; }
.nav-drop-menu {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px;
    background: #fff; border: 1px solid #e3e8ee; border-radius: 12px;
    box-shadow: 0 14px 36px rgba(16, 33, 60, .14); padding: 6px; z-index: 60;
}
.nav-drop-menu::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.nav-drop:hover > .nav-drop-menu, .nav-drop:focus-within > .nav-drop-menu { display: block; }
.nav-drop-menu a {
    display: block; padding: 9px 12px; border-radius: 8px; color: #2a3340;
    font-size: 14px; font-weight: 500;
}
.nav-drop-menu a:hover { background: var(--primary-l); color: var(--primary-d); text-decoration: none; }
.user-drop .user-chip { background: none; border: 0; cursor: pointer; font-family: inherit; }
.user-drop-menu { left: auto; right: 0; }
.drop-sep { border-top: 1px solid #eaeef3; margin-top: 4px; padding-top: 11px !important; }

/* ===== Perfil ===== */
.perfil-datos { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.perfil-avatar {
    width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 22px; font-weight: 700; color: #fff;
    background: var(--grad-primary, var(--primary, #0b6b5e));
}
.perfil-nombre { font-weight: 700; font-size: 17px; }
.form-sub { font-size: 16px; margin: 0 0 14px; color: var(--primary-d, #0b6b5e); }

/* ===== Evaluaciones: secciones por tipo de ítem ===== */
.eval-seccion { margin-bottom: 18px; }
.eval-seccion-tit {
    font-size: 15px; margin: 0 0 8px; padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-l);
    color: var(--primary-d);
}
.eval-completa { margin-top: 6px; letter-spacing: 1px; color: #999; }
/* Selector de planificación base */
.eval-base-plan { margin-top: 6px; }
.clases-checklist { margin-top: 8px; border: 1px solid var(--border, #e3e8ee); border-radius: 10px; padding: 10px 12px; background: #fafcff; }
.clase-check { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 13.5px; }
.clase-check input { margin-top: 3px; }

/* ===== Contenidos: checklist ordenable ===== */
.cont-checklist { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-top: 4px; max-height: 280px; overflow-y: auto; }
.cont-items { list-style: none; margin: 0; padding: 0; counter-reset: cont; }
.cont-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; border-radius: 6px; }
.cont-item:hover { background: var(--primary-l); }
.cont-item label { display: flex; gap: 9px; align-items: flex-start; flex: 1; font-size: 13.5px; cursor: pointer; margin: 0; }
.cont-item label input { margin-top: 3px; flex: 0 0 auto; width: auto; }
.cont-orden { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.cont-mv { border: 1px solid var(--border); background: #fff; border-radius: 5px; width: 24px; height: 18px; line-height: 1; font-size: 10px; cursor: pointer; padding: 0; color: var(--muted); }
.cont-mv:hover { border-color: var(--primary); color: var(--primary-d); }

/* ===== Modal (confirmaciones y avisos) ===== */
.modal-ov {
    position: fixed; inset: 0; background: rgba(16, 33, 60, .5);
    display: flex; align-items: center; justify-content: center; z-index: 100;
    opacity: 0; pointer-events: none; transition: opacity .18s;
}
.modal-ov.abierto { opacity: 1; pointer-events: auto; }
.modal {
    background: #fff; border-radius: 16px; width: min(440px, 92vw);
    box-shadow: 0 24px 60px rgba(16, 33, 60, .3); padding: 24px 24px 20px;
    transform: translateY(8px) scale(.98); transition: transform .18s;
}
.modal-ov.abierto .modal { transform: none; }
.modal-titulo { font-size: 17px; font-weight: 700; margin: 0 0 8px; display: flex; align-items: center; gap: 9px; }
.modal-msg { color: var(--text); font-size: 14.5px; margin: 0 0 20px; line-height: 1.5; }
.modal-acciones { display: flex; justify-content: flex-end; gap: 10px; }

/* Subtítulo de plan al unir varias planificaciones en una evaluación */
.clases-plan-tit { font-weight: 700; font-size: 12.5px; color: var(--primary-d); margin: 8px 0 2px; padding-top: 6px; border-top: 1px dashed var(--border); }
.clases-plan-tit:first-child { border-top: 0; padding-top: 0; }

/* Edición manual de evaluación */
.edit-label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
.edit-item-tit { margin: 0 0 6px; font-size: 14px; color: var(--primary-d); }
.edit-item { border-left: 3px solid var(--primary-l); }

/* Regenerar clase sin IA (pegar JSON) */
.regenman { border: 1px dashed var(--primary); border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; background: #f6fbfa; }
.regenman-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.regenman-acc { display: flex; gap: 8px; margin-top: 10px; }

/* Botón ✎ por ítem (vista de evaluación) */
.item-edit {
    border: 1px solid var(--border); background: #fff; color: var(--primary);
    border-radius: 6px; width: 24px; height: 22px; line-height: 1; font-size: 12px;
    cursor: pointer; padding: 0; vertical-align: middle;
}
.item-edit:hover { border-color: var(--primary); background: var(--primary-l); }
/* Barra de guardado fija al editar */
.edit-actions, #eval-edit .form-actions {
    position: sticky; bottom: 0; z-index: 5;
    background: rgba(255,255,255,.96); backdrop-filter: blur(4px);
    padding: 12px; margin-top: 12px; border-top: 1px solid var(--border);
    border-radius: 12px 12px 0 0; box-shadow: 0 -6px 18px rgba(16,42,67,.06);
}
/* En modo edición, el botón "Editar" por clase es redundante */
body.modo-edicion .btn-editar-clase { display: none; }

/* Ícono de información (abre modal) */
.info-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%; padding: 0; margin-left: 4px;
    border: 1px solid var(--primary); background: #fff; color: var(--primary);
    font-size: 11px; font-weight: 700; cursor: pointer; vertical-align: middle; line-height: 1;
}
.info-ico:hover { background: var(--primary); color: #fff; }
.modal-msg ul { text-align: left; }
