/* ============================================================
   ProfeAcademī · Talleres
   Diseño basado en el handoff de Claude Design (claude.ai/design).
   Acento teal #2f9e9e · mobile-first, fluido hasta tablet/desktop.
   Todo scopeado bajo .tl-app para no chocar con otras hojas.
   ============================================================ */

/* ---------- tokens (default = oscuro, como el resto de la plataforma) ---------- */
.tl-app{
  --tl-accent:      #2f9e9e;
  --tl-accent-2:    #2a8d8d;
  --tl-accent-deep: #1f6e6e;
  --tl-accent-soft: #5bbcbc;
  --tl-accent-bg:   rgba(47,158,158,0.10);
  --tl-accent-bg-2: rgba(47,158,158,0.16);
  --tl-accent-line: rgba(47,158,158,0.35);
  --tl-on-accent:   #ffffff;

  --tl-green:    #10b981;
  --tl-green-bg: rgba(16,185,129,0.12);
  --tl-red:      #ef4444;
  --tl-red-bg:   rgba(239,68,68,0.10);

  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:22px; --r-pill:999px;
  --pad: clamp(14px, 3.2vw, 26px);
  --gap: clamp(12px, 2.4vw, 20px);
  --maxw: 1180px;

  /* superficie oscura */
  --surface:#1a2734; --surface-2:#16212c; --surface-3:#1f2f3c;
  --glass:rgba(22,34,46,0.66);
  --border:rgba(255,255,255,0.10); --border-2:rgba(255,255,255,0.18);
  --fg-1:rgba(255,255,255,0.93); --fg-2:rgba(255,255,255,0.74);
  --fg-3:rgba(255,255,255,0.56); --fg-muted:rgba(255,255,255,0.40);
  --input-bg:rgba(255,255,255,0.06); --input-border:rgba(255,255,255,0.14);
  --shadow-sm:0 2px 8px rgba(0,0,0,0.35);
  --shadow-md:0 8px 24px rgba(0,0,0,0.40);
  --shadow-lg:0 18px 48px rgba(0,0,0,0.50);

  font-family:'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color:var(--fg-1);
}

/* el padding/borde nunca debe sumar al ancho (evita que inputs/cards se desborden) */
.tl-app, .tl-app *, .tl-app *::before, .tl-app *::after{ box-sizing:border-box; }

/* ---------- superficie clara ---------- */
body.theme-light .tl-app{
  --surface:#ffffff; --surface-2:#f3f8f8; --surface-3:#eaf3f3;
  --glass:rgba(255,255,255,0.74);
  --border:rgba(18,52,52,0.10); --border-2:rgba(18,52,52,0.16);
  --fg-1:#143235; --fg-2:#3f5b5d; --fg-3:#6d8688; --fg-muted:#9bb0b1;
  --input-bg:#ffffff; --input-border:rgba(18,52,52,0.14);
  --shadow-sm:0 2px 8px rgba(20,60,60,0.07);
  --shadow-md:0 8px 24px rgba(20,60,60,0.10);
  --shadow-lg:0 18px 48px rgba(20,60,60,0.16);
}

/* ============================================================
   PICKER DE TALLER ACTIVO (en el header de la plataforma)
   ============================================================ */
.tl-taller-picker{
  margin-left:auto;
  display:flex; flex-direction:column; gap:5px;
  min-width:min(260px, 100%);
}
.tl-pick-lbl{
  font-size:11px; font-weight:700; letter-spacing:.05em;
  text-transform:uppercase; color:var(--fg-3);
}
.tl-pick-row{ display:flex; gap:8px; align-items:center; }

/* ============================================================
   INPUTS / SELECTS
   ============================================================ */
.tl-input, .tl-select{
  width:100%;
  font-family:inherit; font-size:14px; color:var(--fg-1);
  background:var(--input-bg);
  border:1px solid var(--input-border);
  border-radius:var(--r-md);
  padding:12px 14px;
  outline:none;
  transition:border-color .2s, box-shadow .2s, background .2s;
}
.tl-input::placeholder{ color:var(--fg-muted); }
.tl-input:focus, .tl-select:focus{
  border-color:var(--tl-accent);
  box-shadow:0 0 0 3px var(--tl-accent-bg-2);
}
.tl-select{
  cursor:pointer; appearance:none; -webkit-appearance:none;
  padding-right:38px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%232f9e9e' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center;
}
.tl-select option{ color:#143235; }
/* el picker del header es tipo pastilla */
.tl-pick-row .tl-select{ border-radius:var(--r-pill); padding-left:16px; }

/* ============================================================
   TABS (pastilla deslizante, mobile-first)
   ============================================================ */
.tl-tabs-wrap{ max-width:var(--maxw); margin:0 auto; padding:0 clamp(12px,3vw,24px); }
.tl-tabs{
  display:flex; gap:4px;
  margin-top:var(--gap);
  background:var(--glass);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border:1px solid var(--border);
  border-radius:var(--r-pill);
  padding:5px;
  box-shadow:var(--shadow-sm);
  overflow-x:auto; scrollbar-width:none;
}
.tl-tabs::-webkit-scrollbar{ display:none; }
.tl-tab{
  flex:1 1 auto; white-space:nowrap; min-width:max-content;
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  font-family:inherit; font-size:clamp(0.8rem,1.7vw,0.92rem); font-weight:600;
  color:var(--fg-3); background:transparent; border:none; cursor:pointer;
  padding:11px 18px; border-radius:var(--r-pill);
  transition:color .2s, background .2s, box-shadow .2s;
}
.tl-tab:hover{ color:var(--fg-1); }
.tl-tab.is-active{
  color:var(--tl-on-accent);
  background:linear-gradient(135deg,var(--tl-accent),var(--tl-accent-2));
  box-shadow:0 4px 12px rgba(47,158,158,0.30);
}
.tl-tab .tab-ic{ flex-shrink:0; display:none; }
.tl-tab .t-short{ display:none; }

/* ============================================================
   MAIN / PANELES
   ============================================================ */
.tl-main{
  position:relative; z-index:1;
  max-width:var(--maxw); margin:0 auto;
  padding:var(--gap) clamp(12px,3vw,24px) 96px;
}
.tl-panel{ display:none; animation:tlFade .3s ease; }
.tl-panel.is-active{ display:block; }
@keyframes tlFade{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

/* ============================================================
   TARJETAS
   ============================================================ */
.tl-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-xl);
  box-shadow:var(--shadow-md);
  padding:var(--pad);
  margin-bottom:var(--gap);
}
.tl-card-head{ margin-bottom:16px; }
.tl-card-head h2{
  margin:0 0 4px; font-size:1.05rem; font-weight:800; color:var(--fg-1);
  letter-spacing:-0.01em;
}
.tl-card-head p{ margin:0; font-size:0.84rem; color:var(--fg-3); font-weight:500; line-height:1.45; }

/* ============================================================
   FORMULARIO
   ============================================================ */
.tl-grid{ display:grid; grid-template-columns:1fr 1fr; gap:var(--gap); }
.tl-field{ display:flex; flex-direction:column; gap:7px; min-width:0; }
.tl-field.span2{ grid-column:1 / -1; }
.tl-lbl{
  font-size:0.72rem; font-weight:700; letter-spacing:0.04em;
  text-transform:uppercase; color:var(--fg-3);
}

.tl-form-actions{
  display:flex; align-items:center; justify-content:flex-end;
  gap:14px; margin-top:18px; flex-wrap:wrap;
}
.tl-hint{ font-size:0.82rem; color:var(--fg-3); font-weight:500; margin-right:auto; }
.tl-hint:empty{ display:none; }

/* ============================================================
   BOTONES
   ============================================================ */
.tl-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:inherit; font-size:0.9rem; font-weight:700; white-space:nowrap;
  padding:12px 20px; border-radius:var(--r-pill);
  border:1px solid var(--border); cursor:pointer;
  color:var(--fg-2); background:var(--surface-2);
  transition:transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s, opacity .2s;
}
.tl-btn:hover{ transform:translateY(-2px); }
.tl-btn:active{ transform:translateY(0) scale(0.98); }
.tl-btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; box-shadow:none; }
.tl-btn svg{ flex-shrink:0; }

.tl-btn-primary{
  color:var(--tl-on-accent);
  background:linear-gradient(135deg,var(--tl-accent),var(--tl-accent-2));
  border-color:transparent;
  box-shadow:0 5px 16px rgba(47,158,158,0.32);
}
.tl-btn-primary:hover{ box-shadow:0 9px 22px rgba(47,158,158,0.42); }
.tl-btn-primary:disabled{ box-shadow:none; }

.tl-btn-ghost{ color:var(--fg-2); background:var(--surface-2); border:1px solid var(--border); }
.tl-btn-ghost:hover{ color:var(--tl-accent); border-color:var(--tl-accent-line); }
.tl-btn-block{ width:100%; margin-top:14px; }

/* ============================================================
   NÓMINA TRANSVERSAL
   ============================================================ */
.tl-roster-wrap{
  display:grid; grid-template-columns:1fr 340px;
  gap:var(--gap); align-items:start;
}
.tl-roster-col{ display:flex; flex-direction:column; gap:14px; min-width:0; }
.tl-filters{ display:flex; flex-direction:column; gap:12px; }

.tl-search{ position:relative; }
.tl-search svg{
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  color:var(--fg-3); pointer-events:none;
}
.tl-search .tl-input{ border-radius:var(--r-pill); padding-left:42px; }

.tl-curso-chips{ display:flex; flex-wrap:wrap; gap:7px; }
.tl-chip{
  font-family:inherit; font-size:0.78rem; font-weight:600; cursor:pointer; white-space:nowrap;
  color:var(--fg-2); background:var(--surface-2);
  border:1px solid var(--border); border-radius:var(--r-pill);
  padding:7px 13px; transition:all .18s;
}
.tl-chip:hover{ border-color:var(--tl-accent-line); color:var(--tl-accent); }
.tl-chip.is-active{
  color:var(--tl-on-accent); background:var(--tl-accent);
  border-color:var(--tl-accent); box-shadow:0 3px 9px rgba(47,158,158,0.28);
}
.tl-chip.is-loading{ opacity:.6; cursor:default; }

.tl-roster{
  display:flex; flex-direction:column; gap:5px;
  max-height:460px; overflow-y:auto; padding:4px; margin:-4px;
  scrollbar-width:thin; scrollbar-color:var(--border-2) transparent;
}
.tl-roster::-webkit-scrollbar{ width:8px; }
.tl-roster::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:99px; }
.tl-roster-item{
  display:flex; align-items:center; gap:11px; cursor:pointer; user-select:none;
  padding:9px 12px; border-radius:var(--r-md);
  border:1px solid transparent; background:var(--surface-2);
  transition:background .15s, border-color .15s;
}
.tl-roster-item:hover{ border-color:var(--tl-accent-line); }
.tl-roster-item.is-checked{ background:var(--tl-accent-bg-2); border-color:var(--tl-accent-line); }
.tl-roster-check{
  width:22px; height:22px; flex:0 0 22px; border-radius:6px;
  border:2px solid var(--border-2); background:var(--surface);
  display:grid; place-items:center; transition:all .15s;
}
.tl-roster-check svg{ color:#fff; opacity:0; transform:scale(0.5); transition:all .15s; }
.tl-roster-item.is-checked .tl-roster-check{ background:var(--tl-accent); border-color:var(--tl-accent); }
.tl-roster-item.is-checked .tl-roster-check svg{ opacity:1; transform:scale(1); }
.tl-roster-name{
  font-size:0.9rem; font-weight:500; color:var(--fg-1);
  flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tl-roster-curso{
  margin-left:auto; flex-shrink:0; white-space:nowrap;
  font-size:0.68rem; font-weight:700; color:var(--fg-3);
  background:var(--surface-3); border-radius:var(--r-pill); padding:3px 9px;
}

/* columna de seleccionados (sticky) */
.tl-selected-col{
  position:sticky; top:84px; align-self:start;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--r-lg); padding:14px;
  display:flex; flex-direction:column; gap:12px;
}
.tl-selected-head{ display:flex; align-items:center; gap:9px; }
.tl-selected-head svg{ color:var(--tl-accent); flex-shrink:0; }
.tl-selected-head .ttl{ font-size:0.82rem; font-weight:700; color:var(--fg-1); }
.tl-count{
  font-size:0.74rem; font-weight:800; color:var(--tl-on-accent);
  background:var(--tl-accent); border-radius:var(--r-pill);
  padding:3px 10px; min-width:26px; text-align:center;
}
.tl-mini-clear{
  margin-left:auto; width:34px; height:34px; border-radius:9px; cursor:pointer;
  background:var(--tl-red-bg); border:1px solid transparent; color:var(--tl-red);
  display:grid; place-items:center; transition:all .15s;
}
.tl-mini-clear:hover{ background:var(--tl-red); color:#fff; }
.tl-selected-body{
  display:flex; flex-direction:column; gap:6px;
  max-height:360px; overflow-y:auto; min-height:60px;
  scrollbar-width:thin; scrollbar-color:var(--border-2) transparent;
}
.tl-selected-body::-webkit-scrollbar{ width:7px; }
.tl-selected-body::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:99px; }
.tl-pill{
  display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-pill); padding:6px 8px 6px 13px;
  animation:tlPop .2s ease;
}
@keyframes tlPop{ from{opacity:0; transform:scale(0.9);} to{opacity:1; transform:scale(1);} }
.tl-pill .nm{
  font-size:0.82rem; font-weight:600; color:var(--fg-1);
  flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tl-pill .cs{ font-size:0.66rem; font-weight:700; color:var(--fg-3); flex-shrink:0; }
.tl-pill button{
  width:24px; height:24px; flex:0 0 24px; border-radius:50%; cursor:pointer; border:none;
  background:var(--surface-3); color:var(--fg-3);
  display:grid; place-items:center; transition:all .15s;
}
.tl-pill button:hover{ background:var(--tl-red); color:#fff; }

/* ============================================================
   ASISTENCIA
   ============================================================ */
.tl-asis-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; }
.tl-asis-controls{ display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.tl-asis-controls .tl-field{ min-width:160px; }

.tl-asis-summary{
  display:flex; gap:16px; flex-wrap:wrap;
  margin-bottom:14px; font-size:0.86rem; font-weight:700;
}
.tl-asis-summary .s-pres{ color:var(--tl-green); }
.tl-asis-summary .s-aus{ color:var(--tl-red); }

.tl-asis-list{ display:flex; flex-direction:column; gap:8px; }
.tl-asis-row{
  display:flex; align-items:center; gap:13px;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--r-md); padding:10px 14px;
  transition:background .25s, border-color .25s;
}
.tl-asis-row.is-absent{ background:var(--tl-red-bg); border-color:rgba(239,68,68,0.25); }
.tl-asis-avatar{
  width:42px; height:42px; flex:0 0 42px; border-radius:50%;
  display:grid; place-items:center; font-weight:800; font-size:0.8rem; letter-spacing:0.02em;
  background:linear-gradient(135deg,var(--tl-accent),var(--tl-accent-deep)); color:#fff;
}
.tl-asis-info{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.tl-asis-info .nm{ font-size:0.92rem; font-weight:600; color:var(--fg-1); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tl-asis-info .cs{
  align-self:flex-start; font-size:0.68rem; font-weight:700; color:var(--fg-3);
  background:var(--surface-3); border-radius:var(--r-pill); padding:3px 9px;
}

/* toggle grande Presente / Ausente */
.tl-toggle{
  margin-left:auto; position:relative; flex:0 0 auto;
  width:168px; height:44px; border-radius:var(--r-pill);
  border:1px solid var(--border-2); background:var(--surface-3);
  cursor:pointer; overflow:hidden; padding:0;
  display:flex; align-items:center;
  font:800 0.82rem/1 'Poppins', sans-serif;
  transition:background .25s, border-color .25s;
}
.tl-toggle .knob{
  position:absolute; top:3px; left:3px;
  width:calc(50% - 3px); height:calc(100% - 6px);
  border-radius:var(--r-pill); background:var(--tl-green);
  box-shadow:0 2px 6px rgba(0,0,0,0.25); z-index:2;
  transition:transform .26s cubic-bezier(.5,1.4,.5,1), background .25s;
}
.tl-toggle .opt{ flex:1; z-index:3; text-align:center; padding:0 4px; color:var(--fg-2); transition:color .2s; }
.tl-toggle[data-present="true"]  .opt-p{ color:#fff; }
.tl-toggle[data-present="false"] .opt-a{ color:#fff; }
.tl-toggle[data-present="false"]{ background:var(--tl-red); border-color:var(--tl-red); }
.tl-toggle[data-present="false"] .knob{ transform:translateX(100%); background:#fff; }

/* acciones fijas */
.tl-sticky-actions{
  display:flex; justify-content:flex-end;
  margin-top:18px; padding-top:16px; border-top:1px solid var(--border);
}

/* ============================================================
   CALIFICACIONES
   ============================================================ */
.tl-notas-wrap{
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  border-radius:var(--r-md);
  scrollbar-width:thin; scrollbar-color:var(--border-2) transparent;
}
.tl-notas-wrap::-webkit-scrollbar{ height:9px; }
.tl-notas-wrap::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:99px; }
.tl-notas-table{ border-collapse:separate; border-spacing:0; width:100%; min-width:max-content; }
.tl-notas-table th, .tl-notas-table td{
  padding:11px 12px; text-align:center; border-bottom:1px solid var(--border);
}
.tl-notas-table thead th{
  position:sticky; top:0; z-index:2;
  font-size:0.74rem; font-weight:700; color:var(--fg-2);
  text-transform:uppercase; letter-spacing:0.03em; white-space:nowrap;
  background:var(--surface-2);
}
.tl-notas-table th.tl-col-name, .tl-notas-table td.tl-cell-name{
  position:sticky; left:0; z-index:1; text-align:left;
  background:var(--surface); min-width:160px; max-width:220px;
  box-shadow:6px 0 10px -8px rgba(0,0,0,0.25);
}
.tl-notas-table thead th.tl-col-name{ background:var(--surface-2); z-index:3; }
.tl-notas-table td.tl-cell-name{
  font-size:0.88rem; font-weight:600; color:var(--fg-1);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.tl-eval-col{ position:relative; min-width:110px; }
.tl-del-col{
  width:20px; height:20px; border-radius:50%; border:none; cursor:pointer;
  margin-left:6px; vertical-align:middle;
  background:var(--surface-3); color:var(--fg-3);
  display:inline-grid; place-items:center; transition:all .15s;
}
.tl-del-col:hover{ background:var(--tl-red); color:#fff; }
.tl-nota-input{
  width:66px; padding:8px 4px; border-radius:8px;
  font-family:inherit; font-size:0.92rem; font-weight:600; text-align:center;
  color:var(--fg-1); background:var(--input-bg); border:1px solid var(--input-border);
  outline:none; transition:border-color .15s, box-shadow .15s, background .4s, color .2s;
}
.tl-nota-input:focus{ border-color:var(--tl-accent); box-shadow:0 0 0 3px var(--tl-accent-bg-2); }
.tl-nota-input.is-low{ color:var(--tl-red); border-color:rgba(239,68,68,0.4); background:var(--tl-red-bg); }
.tl-nota-input.is-saved{ animation:tlGlow .8s ease; }
@keyframes tlGlow{
  0%{ box-shadow:0 0 0 0 rgba(16,185,129,0); }
  30%{ box-shadow:0 0 0 4px rgba(16,185,129,0.45); background:var(--tl-green-bg); }
  100%{ box-shadow:0 0 0 0 rgba(16,185,129,0); }
}
.tl-nota-prom{ font-size:0.96rem; font-weight:800; color:var(--tl-accent); }

/* ============================================================
   MIS TALLERES · grilla de tarjetas
   ============================================================ */
.tl-talleres-bar{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; flex-wrap:wrap; margin-bottom:var(--gap);
}
.tl-talleres-bar-text h2{ margin:0; font-size:1.2rem; font-weight:800; color:var(--fg-1); letter-spacing:-0.01em; }
.tl-talleres-bar-text p{ margin:2px 0 0; font-size:0.84rem; color:var(--fg-3); font-weight:500; }
.tl-talleres-bar .tl-btn{ flex-shrink:0; }
.tl-talleres-bar-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* modal: pie de acciones + vista previa de importación */
.tl-modal-foot{
  display:flex; align-items:center; justify-content:flex-end; gap:10px;
  padding:14px var(--pad); border-top:1px solid var(--border); flex-shrink:0;
}
.tl-import-intro{ font-size:0.86rem; color:var(--fg-2); font-weight:500; margin-bottom:14px; line-height:1.5; }
.tl-import-list{ display:flex; flex-direction:column; gap:8px; }
.tl-import-item{
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--r-md); padding:12px 14px;
}
.tl-import-item.is-dupe{ opacity:.7; }
.tl-import-item-main{ display:flex; align-items:center; gap:10px; }
.tl-import-name{ font-size:0.92rem; font-weight:700; color:var(--fg-1); flex:1; min-width:0; }
.tl-import-badge{
  font-size:0.74rem; font-weight:800; color:var(--tl-on-accent);
  background:var(--tl-accent); border-radius:var(--r-pill); padding:3px 10px; white-space:nowrap;
}
.tl-import-badge.warn{ background:var(--tl-amber, #f59e0b); }
.tl-import-badge.zero{ background:var(--fg-muted); }
.tl-import-warn{ font-size:0.76rem; color:var(--fg-3); font-weight:500; margin-top:6px; line-height:1.4; }
.tl-import-dupe{ font-size:0.76rem; color:var(--tl-amber, #f59e0b); font-weight:700; margin-top:6px; }

.tl-talleres-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
  gap:var(--gap);
}
.tl-talleres-grid .tl-empty{ grid-column:1 / -1; }

/* secciones internas del modal editor */
.tl-editor-divider{ height:1px; background:var(--border); margin:22px 0 18px; }
.tl-editor-subhead{ margin-bottom:16px; }
.tl-editor-subhead h3{ margin:0 0 3px; font-size:1rem; font-weight:800; color:var(--fg-1); }
.tl-editor-subhead p{ margin:0; font-size:0.82rem; color:var(--fg-3); font-weight:500; line-height:1.45; }
#tl-editor-modal .tl-selected-col{ top:0; }
#tl-editor-modal .tl-form-actions{ margin-top:16px; }
.tl-taller-card{
  display:flex; flex-direction:column; gap:6px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-xl); box-shadow:var(--shadow-md); padding:18px;
  transition:transform .2s, box-shadow .2s, border-color .2s;
}
.tl-taller-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:var(--tl-accent-line); }
.tl-tc-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:2px; }
.tl-tc-icon{
  width:42px; height:42px; border-radius:13px; display:grid; place-items:center; color:#fff;
  background:linear-gradient(135deg,var(--tl-accent),var(--tl-accent-deep));
  box-shadow:0 4px 12px rgba(47,158,158,0.3);
}
.tl-tc-edit{
  width:34px; height:34px; border-radius:9px; cursor:pointer;
  border:1px solid var(--border); background:var(--surface-2); color:var(--fg-3);
  display:grid; place-items:center; transition:all .15s;
}
.tl-tc-edit:hover{ color:var(--tl-accent); border-color:var(--tl-accent-line); }
.tl-tc-name{ margin:0; font-size:1.02rem; font-weight:800; color:var(--fg-1); line-height:1.25; }
.tl-tc-doc{ font-size:0.82rem; font-weight:600; color:var(--fg-2); }
.tl-tc-meta{ font-size:0.78rem; color:var(--fg-3); font-weight:500; }
.tl-tc-students{
  display:inline-flex; align-items:center; gap:6px; margin-top:2px;
  font-size:0.78rem; font-weight:700; color:var(--tl-accent);
}
.tl-tc-actions{ display:flex; gap:8px; margin-top:12px; }
.tl-tc-actions .tl-btn{ flex:1; padding:10px; font-size:0.83rem; }

/* ============================================================
   MODAL · asistencia / notas del taller
   ============================================================ */
.tl-modal[hidden]{ display:none; }
.tl-modal{
  position:fixed; inset:0; z-index:300;
  display:flex; align-items:flex-end; justify-content:center; padding:0;
}
.tl-modal-backdrop{
  position:absolute; inset:0; background:rgba(8,16,20,0.55);
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  animation:tlFade .2s ease;
}
body.tl-modal-open{ overflow:hidden; }
.tl-modal-card{
  position:relative; z-index:1;
  width:100%; max-width:840px; max-height:92vh;
  display:flex; flex-direction:column;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-xl) var(--r-xl) 0 0; box-shadow:var(--shadow-lg);
  overflow:hidden; animation:tlSheet .28s cubic-bezier(.25,1,.5,1);
}
@keyframes tlSheet{ from{opacity:0; transform:translateY(24px);} to{opacity:1; transform:none;} }
.tl-modal-head{
  display:flex; align-items:flex-start; gap:12px;
  padding:var(--pad); border-bottom:1px solid var(--border); flex-shrink:0;
}
.tl-modal-titlewrap{ min-width:0; flex:1; }
.tl-modal-head h2{ margin:0; font-size:1.15rem; font-weight:800; color:var(--fg-1); line-height:1.2; }
.tl-modal-sub{ margin:3px 0 0; font-size:0.8rem; color:var(--fg-3); font-weight:500; }
.tl-modal-sub:empty{ display:none; }
.tl-modal-close{
  flex-shrink:0; width:38px; height:38px; border-radius:50%; cursor:pointer;
  border:1px solid var(--border); background:var(--surface-2); color:var(--fg-2);
  display:grid; place-items:center; transition:all .15s;
}
.tl-modal-close:hover{ background:var(--tl-red); border-color:transparent; color:#fff; }
.tl-modal-switch{ display:flex; gap:5px; padding:14px var(--pad) 0; flex-shrink:0; }
.tl-mswitch{
  flex:1; display:inline-flex; align-items:center; justify-content:center; gap:7px;
  font-family:inherit; font-size:0.85rem; font-weight:700; color:var(--fg-3);
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--r-pill);
  padding:9px 14px; cursor:pointer; transition:all .18s;
}
.tl-mswitch:hover{ color:var(--fg-1); }
.tl-mswitch.is-active{
  color:var(--tl-on-accent); border-color:transparent;
  background:linear-gradient(135deg,var(--tl-accent),var(--tl-accent-2));
  box-shadow:0 4px 12px rgba(47,158,158,0.3);
}
.tl-modal-body{ flex:1; overflow-y:auto; padding:var(--pad); }
.tl-modal-view{ display:none; }
.tl-modal[data-view="asistencia"] #tl-view-asistencia{ display:block; }
.tl-modal[data-view="notas"] #tl-view-notas{ display:block; }
@media (min-width: 640px){
  .tl-modal{ align-items:center; padding:24px; }
  .tl-modal-card{ border-radius:var(--r-xl); }
}

/* ============================================================
   ESTADOS VACÍOS
   ============================================================ */
.tl-empty{ text-align:center; padding:40px 16px; color:var(--fg-muted); font-size:0.9rem; line-height:1.6; }

/* ============================================================
   TOASTS
   ============================================================ */
.tl-toast-wrap{
  position:fixed; left:50%; bottom:22px; transform:translateX(-50%);
  z-index:9999; display:flex; flex-direction:column; gap:9px; align-items:center;
  width:max-content; max-width:92vw; pointer-events:none;
}
.tl-toast{
  display:flex; align-items:center; gap:11px; pointer-events:auto;
  background:var(--surface); color:var(--fg-1);
  border:1px solid var(--border); border-left:4px solid var(--tl-green);
  border-radius:var(--r-md); padding:13px 18px;
  box-shadow:var(--shadow-lg); font-size:0.88rem; font-weight:600;
  max-width:min(420px,92vw);
  animation:tlToastIn .3s cubic-bezier(.25,1.2,.5,1);
  transition:opacity .3s ease, transform .3s ease;
}
.tl-toast.ok{ border-left-color:var(--tl-green); }
.tl-toast.err{ border-left-color:var(--tl-red); }
@keyframes tlToastIn{ from{opacity:0; transform:translateY(16px) scale(0.96);} to{opacity:1; transform:translateY(0) scale(1);} }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px){
  .tl-roster-wrap{ grid-template-columns:1fr; }
  .tl-selected-col{ position:static; }
  .tl-selected-body{ max-height:260px; }
  .tl-taller-picker{ width:100%; min-width:0; margin:10px 0 0; }
}

@media (max-width: 680px){
  .tl-tabs{ padding:4px; gap:3px; }
  .tl-tab{ flex:1 1 0; min-width:0; padding:10px 6px; gap:5px; }
  .tl-tab .t-full{ display:none; }
  .tl-tab .t-short{ display:inline; }
  .tl-tab .tab-ic{ display:inline-block; }

  .tl-grid{ grid-template-columns:1fr; }
  .tl-field.span2{ grid-column:auto; }

  .tl-asis-head{ align-items:stretch; }
  .tl-asis-controls{ width:100%; }
  .tl-asis-controls .tl-btn{ flex:1; }
}

@media (max-width: 600px){
  /* asistencia: toggle a lo ancho debajo del nombre */
  .tl-asis-row{ flex-wrap:wrap; }
  .tl-toggle{ width:100%; margin-left:0; margin-top:6px; height:48px; }

  /* planilla de notas → tarjetas verticales (una por alumno) */
  .tl-notas-table, .tl-notas-table thead, .tl-notas-table tbody,
  .tl-notas-table th, .tl-notas-table td, .tl-notas-table tr{ display:block; }
  .tl-notas-table{ min-width:0; }
  .tl-notas-table thead{ display:none; }
  .tl-notas-table tbody tr{
    margin-bottom:14px; border:1px solid var(--border);
    border-radius:var(--r-lg); padding:6px 4px; background:var(--surface-2);
  }
  .tl-notas-table td{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    border-bottom:1px solid var(--border); text-align:right; padding:11px 14px;
  }
  .tl-notas-table td:last-child{ border-bottom:none; }
  .tl-notas-table td.tl-cell-name{
    position:static; font-size:1rem; font-weight:800; box-shadow:none;
    background:transparent; justify-content:flex-start; max-width:none;
  }
  .tl-notas-table td::before{
    content:attr(data-label);
    font-size:0.72rem; font-weight:700; letter-spacing:0.03em;
    text-transform:uppercase; color:var(--fg-3); margin-right:12px;
  }
  .tl-notas-table td.tl-cell-name::before{ content:none; }
  .tl-nota-input{ width:84px; }
}

@media (max-width: 440px){
  .tl-tab{ font-size:0.76rem; }
  .tl-asis-row{ padding:9px 11px; gap:10px; }
  .tl-asis-avatar{ width:38px; height:38px; flex-basis:38px; }
}

@media (prefers-reduced-motion: reduce){
  .tl-panel, .tl-pill, .tl-toast, .tl-nota-input.is-saved{ animation:none; }
  .tl-btn, .tl-toggle .knob{ transition:none; }
}
