/* ==========================================================================
   conecta2 · Sistema de diseño "calm clinical warmth"
   Interfaz de coordinación NEAE. Cálido, sobrio, profesional, muy responsive.
   Los nombres de color siguen la paleta "Mapa NEAE" ya remapeada en Tailwind.
   ========================================================================== */

:root {
  /* --- Lienzo y superficies --- */
  --c-canvas:      #F4F3EF;   /* fondo de la app (papel cálido) */
  --c-surface:     #FFFFFF;   /* tarjetas / paneles */
  --c-surface-2:   #FAFAF8;   /* superficies sutiles (thead, insets) */
  --c-surface-3:   #F1F0EC;   /* hover suave */
  --c-hairline:    #E6E4DE;   /* bordes finos */
  --c-hairline-2:  #EFEDE8;

  /* --- Tinta / texto --- */
  --c-ink:         #2A2D2C;   /* texto principal */
  --c-ink-2:       #61665F;   /* secundario */
  --c-ink-3:       #949A92;   /* apagado / placeholders */

  /* --- Marca (verde bosque "indigo" remapeado) --- */
  --c-brand:       #427F66;
  --c-brand-600:   #427F66;
  --c-brand-700:   #356652;
  --c-brand-800:   #2B5242;
  --c-brand-050:   #EAF0EE;
  --c-brand-ring:  rgba(66,127,102,.22);

  /* --- Acentos semánticos (roles / perfiles) --- */
  --c-blue:   #567B9E;  --c-blue-050:   #EAEEF2;
  --c-pink:   #9D5876;  --c-pink-050:   #F2EAED;
  --c-green:  #358C85;  --c-green-050:  #E7F1F0;
  --c-yellow: #A07421;  --c-yellow-050: #F3ECDE;
  --c-purple: #5D467C;  --c-purple-050: #ECE7F0;
  --c-orange: #9F4E22;  --c-orange-050: #F2E7DF;

  /* --- Feedback --- */
  --c-ok:      #358C85;  --c-ok-050:   #E7F1F0;
  --c-warn:    #A07421;  --c-warn-050: #F3ECDE;
  --c-danger:  #95352C;  --c-danger-050:#F2E9E8;
  --c-danger-600:#BD4338;

  /* --- Radios (más ceñidos = más "SaaS", menos "app infantil") --- */
  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 13px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* --- Sombras (bajas, en capas, discretas) --- */
  --sh-sm: 0 1px 2px rgba(24,28,26,.05);
  --sh-md: 0 1px 2px rgba(24,28,26,.05), 0 6px 18px rgba(24,28,26,.05);
  --sh-lg: 0 2px 6px rgba(24,28,26,.06), 0 18px 40px rgba(24,28,26,.09);
  --sh-pop: 0 8px 30px rgba(24,28,26,.14);

  /* --- Layout --- */
  --sidebar-w: 244px;
  --topbar-h: 62px;
  --content-max: 1360px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .22s;
}

/* Modo oscuro: verdes profundos, tinta clara */
html.dark {
  --c-canvas:     #10130F;
  --c-surface:    #191D17;
  --c-surface-2:  #1F241D;
  --c-surface-3:  #232A20;
  --c-hairline:   #313A2E;
  --c-hairline-2: #2A3227;
  --c-ink:        #E7EAE4;
  --c-ink-2:      #A9B0A4;
  --c-ink-3:      #7E857A;
  --c-brand:      #6FB394;
  --c-brand-050:  #1C2A22;
  --c-blue-050:#1B2530; --c-pink-050:#2A1E25; --c-green-050:#12241F;
  --c-yellow-050:#2A2312; --c-purple-050:#211A2C; --c-orange-050:#2A1B12;
  --c-ok-050:#12241F; --c-warn-050:#2A2312; --c-danger-050:#2A1815;
  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh-md: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --sh-lg: 0 2px 8px rgba(0,0,0,.5), 0 22px 48px rgba(0,0,0,.5);
  --sh-pop: 0 10px 34px rgba(0,0,0,.6);
}

/* ---------- Base ---------- */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-canvas);
  color: var(--c-ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .font-display { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; letter-spacing: -.015em; }

/* Scrollbars discretas */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.custom-dashboard-scroll::-webkit-scrollbar,
.c2-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.custom-dashboard-scroll::-webkit-scrollbar-thumb,
.c2-scroll::-webkit-scrollbar-thumb { background: var(--c-hairline); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.custom-dashboard-scroll::-webkit-scrollbar-thumb:hover,
.c2-scroll::-webkit-scrollbar-thumb:hover { background: var(--c-ink-3); }

/* Foco visible accesible */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ==========================================================================
   ESTRUCTURA / APP SHELL
   ========================================================================== */
.c2-app { min-height: 100vh; }

/* --- Sidebar (escritorio) --- */
.c2-sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-hairline);
  display: flex; flex-direction: column;
  z-index: 60;
  transition: transform var(--dur) var(--ease);
}
.c2-sidebar__brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--c-hairline);
  flex-shrink: 0;
}
.c2-brandmark { width: 26px; height: 26px; flex-shrink: 0; }
.c2-brandmark--spin { animation: c2-spin 9s linear infinite; }
.c2-wordmark { font-weight: 900; font-size: 20px; letter-spacing: -.03em; display: flex; align-items: baseline; }
.c2-wordmark .a { color: var(--c-ink); }
.c2-wordmark .b { color: var(--c-blue); }
.c2-wordmark .c { color: var(--c-pink); }
.c2-wordmark .d { color: var(--c-yellow); }
.c2-wordmark .e { color: var(--c-green); font-size: .93em; }

.c2-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.c2-nav__label { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--c-ink-3); padding: 14px 12px 6px; }
.c2-navitem {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 9px 12px; margin: 2px 0;
  border-radius: var(--r-sm);
  color: var(--c-ink-2); font-weight: 600; font-size: 14px;
  cursor: pointer; border: 1px solid transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  position: relative;
}
.c2-navitem svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.c2-navitem:hover { background: var(--c-surface-3); color: var(--c-ink); }
.c2-navitem.is-active { background: var(--c-brand-050); color: var(--c-brand-700); border-color: color-mix(in srgb, var(--c-brand) 22%, transparent); }
html.dark .c2-navitem.is-active { color: var(--c-brand); }
.c2-navitem.is-active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--c-brand);
}
.c2-navitem__badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--c-pink); color: #fff;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.c2-sidebar__foot { padding: 10px; border-top: 1px solid var(--c-hairline); display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

/* --- Topbar --- */
.c2-topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--c-surface) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--c-hairline);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
}
.c2-topbar__spacer { flex: 1; }
.c2-iconbtn {
  position: relative;
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-ink-2); background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: background var(--dur), color var(--dur);
}
.c2-iconbtn:hover { background: var(--c-surface-3); color: var(--c-ink); }
.c2-iconbtn svg { width: 20px; height: 20px; }
.c2-dot {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px;
  background: var(--c-pink); border-radius: 999px; border: 2px solid var(--c-surface);
}

/* Selector de alumno en la topbar */
.c2-studentpick {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 6px; border-radius: var(--r-pill);
  border: 1px solid var(--c-hairline); background: var(--c-surface);
  cursor: pointer; max-width: 240px; transition: border-color var(--dur), background var(--dur);
}
.c2-studentpick:hover { border-color: var(--c-brand); background: var(--c-surface-2); }
.c2-studentpick__name { font-weight: 700; font-size: 13px; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c2-crumb { color: var(--c-ink-3); font-size: 13px; font-weight: 600; display: none; }
@media (min-width: 900px){ .c2-crumb { display: inline; } }

/* --- Área de contenido --- */
.c2-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.c2-content { flex: 1; padding: 26px clamp(16px, 3vw, 34px) 96px; max-width: var(--content-max); width: 100%; margin: 0 auto; }

/* Avatares / iniciales */
.c2-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-weight: 800; flex-shrink: 0;
  border: 2px solid; line-height: 1;
}
.c2-avatar--sm { width: 30px; height: 30px; font-size: 13px; }
.c2-avatar--md { width: 40px; height: 40px; font-size: 16px; }
.c2-avatar--lg { width: 64px; height: 64px; font-size: 26px; }

/* ==========================================================================
   COMPONENTES
   ========================================================================== */
.c2-card {
  background: var(--c-surface);
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.c2-card--pad { padding: clamp(16px, 2.4vw, 26px); }
.c2-card--hover { transition: box-shadow var(--dur), transform var(--dur), border-color var(--dur); }
.c2-card--hover:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: var(--c-hairline-2); }

.c2-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.c2-page-title { font-size: clamp(22px, 3vw, 30px); font-weight: 600; color: var(--c-ink); }
.c2-page-sub { color: var(--c-ink-2); font-size: 14px; margin-top: 4px; }
.c2-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--c-ink-3); }

.c2-section-title { font-size: 18px; font-weight: 600; color: var(--c-ink); display: flex; align-items: center; gap: 9px; }
.c2-section-title svg { width: 20px; height: 20px; color: var(--c-brand); }

/* Botones */
.c2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 700; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: background var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur), transform .1s;
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.c2-btn:active { transform: translateY(1px); }
.c2-btn svg { width: 18px; height: 18px; }
.c2-btn--primary { background: var(--c-brand-600); color: #fff; box-shadow: var(--sh-sm); }
.c2-btn--primary:hover { background: var(--c-brand-700); }
.c2-btn--ghost { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-hairline); }
.c2-btn--ghost:hover { background: var(--c-surface-3); border-color: var(--c-ink-3); }
.c2-btn--soft { background: var(--c-brand-050); color: var(--c-brand-700); }
.c2-btn--soft:hover { background: color-mix(in srgb, var(--c-brand) 16%, transparent); }
.c2-btn--danger { background: var(--c-danger-050); color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 22%, transparent); }
.c2-btn--danger:hover { background: var(--c-danger-600); color: #fff; border-color: transparent; }
.c2-btn--sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-xs); }
.c2-btn--block { width: 100%; }
.c2-btn[disabled], .c2-btn.is-loading { opacity: .55; pointer-events: none; }

/* Chips / etiquetas */
.c2-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  border: 1px solid transparent; line-height: 1.4;
}
.c2-chip__dot { width: 7px; height: 7px; border-radius: 999px; }

/* Campos de formulario */
.c2-field { display: block; }
.c2-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-2); margin-bottom: 7px; }
.c2-input, .c2-select, .c2-textarea {
  width: 100%; padding: 11px 13px;
  background: var(--c-surface); color: var(--c-ink);
  border: 1px solid var(--c-hairline); border-radius: var(--r-sm);
  font-size: 14px; font-family: inherit; transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.c2-input::placeholder, .c2-textarea::placeholder { color: var(--c-ink-3); }
.c2-input:focus, .c2-select:focus, .c2-textarea:focus {
  outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-ring); background: var(--c-surface);
}
.c2-textarea { resize: vertical; min-height: 74px; }
.c2-select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2361665F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* Tablas */
.c2-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.c2-table th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-2); background: var(--c-surface-2); padding: 13px 16px; border-bottom: 1px solid var(--c-hairline); }
.c2-table td { padding: 13px 16px; border-bottom: 1px solid var(--c-hairline-2); color: var(--c-ink); vertical-align: middle; }
.c2-table tbody tr:last-child td { border-bottom: none; }
.c2-table tbody tr { transition: background var(--dur); }
.c2-table tbody tr:hover { background: var(--c-surface-2); }
.c2-table-wrap { border: 1px solid var(--c-hairline); border-radius: var(--r-md); overflow: hidden; }

/* Estado vacío */
.c2-empty { text-align: center; padding: 46px 24px; border: 1px dashed var(--c-hairline); border-radius: var(--r-lg); background: var(--c-surface-2); color: var(--c-ink-2); }
.c2-empty svg { width: 40px; height: 40px; color: var(--c-ink-3); margin: 0 auto 12px; }
.c2-empty__title { font-weight: 700; color: var(--c-ink); font-size: 16px; }

/* Avisos */
.c2-alert { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-radius: var(--r-md); font-weight: 600; font-size: 14px; border: 1px solid; }
.c2-alert svg { width: 20px; height: 20px; flex-shrink: 0; }
.c2-alert--ok { background: var(--c-ok-050); color: var(--c-ok); border-color: color-mix(in srgb, var(--c-ok) 25%, transparent); }
.c2-alert--warn { background: var(--c-warn-050); color: var(--c-warn); border-color: color-mix(in srgb, var(--c-warn) 25%, transparent); }
.c2-alert--danger { background: var(--c-danger-050); color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 25%, transparent); }

/* Popover (perfil / chat / selector alumno) */
.c2-pop {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--c-surface); border: 1px solid var(--c-hairline);
  border-radius: var(--r-lg); box-shadow: var(--sh-pop); z-index: 100;
  overflow: hidden;
}
#bocadillo-notas:not(.hidden) {
  display: flex;
  flex-direction: column;
}
.c2-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--c-hairline); }
.c2-pop__title { font-weight: 700; font-size: 15px; }

/* Overlay + modales */
.c2-overlay { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(20,24,22,.55); backdrop-filter: blur(3px); }
.c2-overlay.is-open { display: flex; }
.c2-modal { background: var(--c-surface); border: 1px solid var(--c-hairline); border-radius: var(--r-xl); box-shadow: var(--sh-lg); width: 100%; max-width: 460px; overflow: hidden; }
.c2-modal--wide { max-width: min(1180px, 96vw); height: min(94vh, 920px); display: flex; flex-direction: column; }
.c2-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-hairline); }
.c2-modal__body { padding: 20px; overflow-y: auto; }

/* Toast (autoguardado) */
#auto-save-toast, .c2-toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 220;
  padding: 12px 18px; border-radius: var(--r-md); box-shadow: var(--sh-pop);
  font-weight: 700; font-size: 14px; color: #fff; display: flex; align-items: center; gap: 9px;
}

/* ==========================================================================
   NAV MÓVIL (drawer + barra inferior)
   ========================================================================== */
.c2-scrim { position: fixed; inset: 0; background: rgba(20,24,22,.5); z-index: 55; opacity: 0; visibility: hidden; transition: opacity var(--dur); }
.c2-scrim.is-open { opacity: 1; visibility: visible; }

.c2-bottomnav { display: none; }
.c2-mobile-only { display: none; }

@media (max-width: 1023px) {
  .c2-sidebar { transform: translateX(-100%); box-shadow: var(--sh-lg); }
  .c2-sidebar.is-open { transform: translateX(0); }
  .c2-main { margin-left: 0; }
  .c2-content { padding-bottom: 108px; }
  .c2-mobile-only { display: inline-flex; }
  .c2-desktop-only { display: none !important; }

  .c2-bottomnav {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 58;
    background: color-mix(in srgb, var(--c-surface) 92%, transparent);
    backdrop-filter: saturate(140%) blur(12px);
    border-top: 1px solid var(--c-hairline);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
  }
  .c2-bottomnav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border-radius: var(--r-sm); border: none; background: transparent;
    color: var(--c-ink-3); font-size: 10px; font-weight: 700; cursor: pointer; position: relative;
  }
  .c2-bottomnav__item svg { width: 22px; height: 22px; }
  .c2-bottomnav__item.is-active { color: var(--c-brand); }
  .c2-bottomnav__item .c2-dot { top: 2px; right: calc(50% - 16px); }
}

/* ==========================================================================
   VISTAS (paneles conmutables por pestañas, sin recargar)
   ========================================================================== */
.c2-view { display: none; animation: c2-fade .28s var(--ease); }
.c2-view.is-active { display: block; }

@keyframes c2-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes c2-spin { to { transform: rotate(360deg); } }
@keyframes c2-fade-out { to { opacity: 0; } }
.fade-out { animation: c2-fade-out 1s var(--ease) forwards; }

/* ==========================================================================
   ACCESIBILIDAD / MOVIMIENTO REDUCIDO
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   IMPRESIÓN (export PDF nativo con window.print)
   ========================================================================== */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .c2-sidebar, .c2-topbar, .c2-bottomnav, .c2-scrim, .c2-overlay, #btnSubir,
  .c2-no-print, .c2-navitem__badge { display: none !important; }
  .c2-main { margin: 0 !important; }
  .c2-content { padding: 0 !important; max-width: none !important; }
  .c2-print-block { display: block !important; }
}

/* ==========================================================================
   COMPONENTES DE VISTA (login, tarjetas de rol, chat, almacén, calificaciones)
   ========================================================================== */

/* ---- Login ---- */
.c2-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.c2-login__card { width: 100%; max-width: 420px; background: var(--c-surface); border: 1px solid var(--c-hairline); border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: 40px 34px; }
.c2-login__brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.c2-login__brand .c2-brandmark { width: 34px; height: 34px; }
.c2-login__tag { text-align: center; color: var(--c-ink-3); font-size: 13px; font-weight: 600; margin-bottom: 28px; }
.c2-login__profiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 24px; }
.c2-login__profile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: var(--r-md); border: 1px solid var(--c-hairline); background: var(--c-surface-2); }
.c2-login__profile b { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--c-ink-2); }
.c2-login__pdot { width: 12px; height: 12px; border-radius: 999px; }
@media (max-width: 460px){ .c2-login__profiles { grid-template-columns: repeat(3,1fr);} }

/* ---- Tarjeta profesional (renderColumn) ---- */
.c2-rolecard { background: var(--c-surface); border: 1px solid var(--c-hairline); border-left: 3px solid var(--rc); border-radius: var(--r-md); padding: 18px; height: 100%; display: flex; flex-direction: column; box-shadow: var(--sh-sm); }
.c2-rolecard__head { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--c-hairline-2); }
.c2-rolecard__names { min-width: 0; }
.c2-rolecard__role { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--rc); }
.c2-rolecard__person { font-size: 12px; color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.c2-mini-label { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-2); margin: 12px 0 6px; }
.c2-mini-label .ic { width: 13px; height: 13px; }
.c2-rolecard .c2-textarea { font-size: 13px; }
.c2-goal { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 11px 13px; background: var(--c-surface-2); border: 1px solid var(--c-hairline-2); border-radius: var(--r-sm); cursor: pointer; }
.c2-goal input { width: 17px; height: 17px; accent-color: var(--rc); }
.c2-goal span { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-2); }
.c2-restag-box { background: var(--c-surface-2); border: 1px solid var(--c-hairline-2); border-radius: var(--r-sm); padding: 12px; margin: 4px 0; }
.c2-restag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.c2-restag-list:empty { margin-bottom: 0; }
.c2-restag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; background: var(--c-brand-050); color: var(--c-brand-700); border: 1px solid color-mix(in srgb, var(--c-brand) 22%, transparent); }
html.dark .c2-restag { color: var(--c-brand); }
.c2-restag.is-pdf { background: var(--c-danger-050); color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 22%, transparent); }
.c2-restag a { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c2-restag a:hover { text-decoration: underline; }
.c2-restag__x { border: none; background: none; color: inherit; cursor: pointer; font-size: 17px; line-height: 1; opacity: .7; }
.c2-restag__x:hover { opacity: 1; color: var(--c-danger); }
.c2-restag-add { display: flex; gap: 7px; }
.c2-select--sm { padding: 8px 30px 8px 11px; font-size: 12px; }
.c2-restag-add__btn { flex-shrink: 0; width: 38px; border: none; border-radius: var(--r-sm); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.c2-restag-add__btn .ic { width: 18px; height: 18px; }
.c2-rolecard__file { margin-top: auto; padding-top: 6px; }
.c2-file-current { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--c-surface-2); border: 1px solid var(--c-hairline-2); border-radius: var(--r-sm); }
.c2-file-current a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--c-brand-700); min-width: 0; }
html.dark .c2-file-current a { color: var(--c-brand); }
.c2-file-current a .ic { width: 16px; height: 16px; flex-shrink: 0; }
.c2-file-del { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--c-ink-3); }
.c2-file-del .ic { width: 16px; height: 16px; }
.c2-file-del input { accent-color: var(--c-danger); }
.c2-file-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border: 1.5px dashed var(--c-hairline); border-radius: var(--r-sm); background: var(--c-surface-2); cursor: pointer; position: relative; transition: border-color var(--dur), background var(--dur); }
.c2-file-drop:hover { border-color: var(--rc); background: var(--c-surface); }
.c2-file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.c2-file-drop span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--c-ink-2); }
.c2-file-drop span .ic { width: 16px; height: 16px; }
.ic { width: 18px; height: 18px; }

/* ---- Rejilla de tarjetas de rol ---- */
.c2-roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
@media (min-width: 1400px){ .c2-roles-grid { grid-template-columns: repeat(3, 1fr);} }

/* ---- Tarjetas navegables (cursos, etapas, perfiles, semanas) ---- */
.c2-tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.c2-tile { position: relative; display: block; text-decoration: none; background: var(--c-surface); border: 1px solid var(--c-hairline); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-sm); transition: box-shadow var(--dur), transform var(--dur), border-color var(--dur); }
.c2-tile:hover { box-shadow: var(--sh-md); transform: translateY(-3px); border-color: color-mix(in srgb, var(--c-brand) 40%, var(--c-hairline)); }
.c2-tile__badge { position: absolute; top: 12px; right: 12px; }
.c2-tile__emoji { font-size: 38px; line-height: 1; margin-bottom: 12px; }
.c2-tile__title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; color: var(--c-ink); }
.c2-tile__meta { font-size: 13px; color: var(--c-ink-2); margin-top: 3px; }
.c2-tile__del { position: absolute; top: 0; left: 0; width: 30px; height: 30px; border: none; border-radius: var(--r-lg) 0 var(--r-md) 0; background: var(--c-danger-050); color: var(--c-danger); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--dur); }
.c2-tile:hover .c2-tile__del { opacity: 1; }
.c2-tile__del:hover { background: var(--c-danger-600); color: #fff; }
.c2-tile__del svg { width: 16px; height: 16px; }

/* Semana (fila) */
.c2-week { display: flex; align-items: stretch; gap: 0; background: var(--c-surface); border: 1px solid var(--c-hairline); border-radius: var(--r-md); overflow: hidden; cursor: pointer; box-shadow: var(--sh-sm); transition: box-shadow var(--dur), transform var(--dur); }
.c2-week:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.c2-week__icon { flex-shrink: 0; width: 62px; display: flex; align-items: center; justify-content: center; background: var(--c-brand-050); color: var(--c-brand-700); }
html.dark .c2-week__icon { color: var(--c-brand); }
.c2-week__icon svg { width: 26px; height: 26px; }
.c2-week__body { flex: 1; padding: 15px 18px; min-width: 0; }
.c2-week__name { font-size: 16px; font-weight: 700; color: var(--c-ink); }
.c2-week__topic { font-size: 13px; color: var(--c-ink-2); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.c2-week__avatars { display: flex; align-items: center; padding: 15px 18px; gap: 0; }
.c2-week__av { width: 32px; height: 32px; margin-left: -8px; border: 2px solid var(--c-surface); border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.c2-week__av:first-child { margin-left: 0; }

/* ---- Barra de sub-pestañas (evaluaciones) ---- */
.c2-subtabs { display: inline-flex; gap: 4px; background: var(--c-surface-2); border: 1px solid var(--c-hairline); border-radius: var(--r-md); padding: 4px; }
.c2-subtab { padding: 8px 18px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; color: var(--c-ink-2); text-decoration: none; transition: background var(--dur), color var(--dur); }
.c2-subtab:hover { color: var(--c-ink); }
.c2-subtab.is-active { background: var(--c-surface); color: var(--c-brand-700); box-shadow: var(--sh-sm); }
html.dark .c2-subtab.is-active { color: var(--c-brand); }

/* ---- Radios de calificación ---- */
.c2-grade { cursor: pointer; display: inline-block; }
.c2-grade input { position: absolute; opacity: 0; pointer-events: none; }
.c2-grade__mark { width: 34px; height: 34px; margin: 0 auto; border-radius: 999px; border: 2px solid var(--c-hairline); background: var(--c-surface); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--c-ink-3); transition: all var(--dur); }
.c2-grade:hover .c2-grade__mark { transform: scale(1.08); }
.c2-grade__mark svg { width: 18px; height: 18px; color: transparent; }
.c2-grade input:checked + .c2-grade__mark { color: #fff; border-color: transparent; }
.c2-grade input:checked + .c2-grade__mark svg { color: #fff; }
.g-ok input:checked + .c2-grade__mark { background: #3D7A52; }
.g-proc input:checked + .c2-grade__mark { background: #B9892F; }
.g-no input:checked + .c2-grade__mark { background: #B3473D; }
.g-IN input:checked + .c2-grade__mark { background: #B3473D; }
.g-SU input:checked + .c2-grade__mark { background: #C1612E; }
.g-BI input:checked + .c2-grade__mark { background: #B9892F; }
.g-NT input:checked + .c2-grade__mark { background: #3D7A52; }
.g-SB input:checked + .c2-grade__mark { background: #2F5D8F; }

/* ---- Chat ---- */
.c2-chatlist { flex: 1; overflow-y: auto; }
.c2-chatrow { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--c-hairline-2); cursor: pointer; transition: background var(--dur); }
.c2-chatrow:hover { background: var(--c-surface-2); }
.c2-chatrow__body { flex: 1; min-width: 0; }
.c2-chatrow__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.c2-chatrow__name { font-weight: 700; font-size: 14px; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c2-chatrow__time { font-size: 10px; color: var(--c-ink-3); font-weight: 600; flex-shrink: 0; }
.c2-chatrow__last { font-size: 12px; color: var(--c-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.c2-chatrow__last.is-unread { color: var(--c-ink); font-weight: 700; }
.c2-unreaddot { width: 9px; height: 9px; border-radius: 999px; background: var(--c-pink); flex-shrink: 0; }
.c2-conv { display: none; flex-direction: column; height: 100%; background: var(--c-surface-2); }
.c2-conv.flex { display: flex; }
.c2-chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.c2-chat-note { text-align: center; font-size: 12px; font-weight: 700; color: var(--c-ink-2); background: var(--c-surface); padding: 8px 12px; border-radius: var(--r-md); width: fit-content; margin: 12px auto; box-shadow: var(--sh-sm); }
.c2-bubble-row { display: flex; }
.c2-bubble-row.is-mine { justify-content: flex-end; }
.c2-bubble { max-width: 82%; padding: 10px 13px; border-radius: var(--r-md); box-shadow: var(--sh-sm); border: 1px solid var(--c-hairline-2); }
.c2-bubble.is-mine { background: var(--c-brand-050); border-color: color-mix(in srgb, var(--c-brand) 20%, transparent); border-bottom-right-radius: 4px; }
.c2-bubble.is-other { background: var(--c-surface); border-bottom-left-radius: 4px; }
.c2-bubble-text { font-size: 14px; color: var(--c-ink); white-space: pre-wrap; word-break: break-word; }
.c2-bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 3px; }
.c2-bubble-meta span { font-size: 9px; font-weight: 700; color: var(--c-ink-3); }
.c2-chat-sender { font-size: 10px; font-weight: 800; margin-bottom: 3px; }
.c2-chat-del { border: none; background: none; cursor: pointer; color: var(--c-ink-3); }
.c2-chat-del svg { width: 13px; height: 13px; }
.c2-chat-del:hover { color: var(--c-danger); }
.c2-chatinput { padding: 12px; border-top: 1px solid var(--c-hairline); background: var(--c-surface); display: flex; gap: 8px; align-items: center; }
.c2-chatinput input[type=text] { flex: 1; border: 1px solid var(--c-hairline); background: var(--c-surface-2); border-radius: var(--r-pill); padding: 10px 15px; font-size: 14px; }
.c2-chatinput input[type=text]:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-ring); }
.c2-chatinput button { flex-shrink: 0; width: 42px; height: 42px; border-radius: 999px; border: none; background: var(--c-brand-600); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.c2-chatinput button svg { width: 18px; height: 18px; }

/* ---- Almacén: tarjeta de recurso ---- */
.c2-resgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.c2-rescard { position: relative; background: var(--c-surface); border: 1px solid var(--c-hairline); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; box-shadow: var(--sh-sm); overflow: hidden; transition: box-shadow var(--dur), transform var(--dur); }
.c2-rescard:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.c2-rescard__bg { position: absolute; right: -12px; bottom: -12px; font-size: 92px; opacity: .06; pointer-events: none; }
.c2-rescard__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.c2-rescard__cat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; background: var(--c-surface-2); border: 1px solid var(--c-hairline-2); border-radius: var(--r-sm); font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--c-ink-2); }
.c2-rescard__title { font-size: 16px; font-weight: 700; color: var(--c-ink); line-height: 1.3; margin-bottom: 8px; z-index: 1; }
.c2-rescard__meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: auto; padding-top: 12px; }
.c2-rescard__by { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c-ink-3); }
.c2-rescard__open { display: block; margin-top: 14px; text-align: center; padding: 11px; border-radius: var(--r-sm); font-weight: 800; font-size: 13px; text-decoration: none; z-index: 1; }

/* ---- Stat cards (panel) ---- */
.c2-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.c2-stat { background: var(--c-surface); border: 1px solid var(--c-hairline); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-sm); }
.c2-stat__ico { width: 42px; height: 42px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.c2-stat__ico svg { width: 22px; height: 22px; }
.c2-stat__num { font-family: 'Fraunces', serif; font-size: 32px; font-weight: 600; color: var(--c-ink); line-height: 1; }
.c2-stat__label { font-size: 13px; color: var(--c-ink-2); margin-top: 6px; }

/* Volver arriba */
#btnSubir { position: fixed; bottom: 84px; right: 20px; z-index: 90; width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--c-hairline); background: var(--c-surface); color: var(--c-brand-700); box-shadow: var(--sh-md); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity var(--dur), transform var(--dur); }
#btnSubir svg { width: 22px; height: 22px; }
#btnSubir.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
@media (min-width: 1024px){ #btnSubir { bottom: 24px; } }
html.dark #btnSubir { color: var(--c-brand); }

/* Utilidad truncado */
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Extras finales ---- */
.c2-addweek { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .34s ease, opacity .34s ease; }
.c2-addweek.is-open { max-height: 620px; opacity: 1; }
.c2-iconbtn--danger { color: var(--c-danger); background: var(--c-danger-050); border-color: color-mix(in srgb, var(--c-danger) 22%, transparent); }
.c2-iconbtn--danger:hover { background: var(--c-danger-600); color: #fff; }
.c2-brandmark--spin { animation: c2-brandspin 14s linear infinite; }
@keyframes c2-brandspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce){ .c2-brandmark--spin { animation: none; } }

/* ---- Breadcrumb / búsqueda / emojis ---- */
.c2-breadcrumb { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.c2-breadcrumb a { color: var(--c-brand-700); font-weight: 700; text-decoration: none; }
html.dark .c2-breadcrumb a { color: var(--c-brand); }
.c2-breadcrumb a:hover { text-decoration: underline; }
.c2-breadcrumb span { color: var(--c-ink-3); }
.c2-breadcrumb .is-current { color: var(--c-ink-2); font-weight: 700; }
.c2-searchbar { position: relative; display: flex; align-items: center; min-width: 260px; }
.c2-searchbar .ic { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--c-ink-3); pointer-events: none; }
.c2-searchbar input { width: 100%; padding: 11px 14px 11px 38px; border: 1px solid var(--c-hairline); background: var(--c-surface); border-radius: var(--r-pill); font-size: 14px; color: var(--c-ink); }
.c2-searchbar input:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-ring); }
.c2-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 148px; overflow-y: auto; background: var(--c-surface-2); padding: 8px; border: 1px solid var(--c-hairline); border-radius: var(--r-sm); }
.c2-emoji { cursor: pointer; }
.c2-emoji input { position: absolute; opacity: 0; }
.c2-emoji span { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-size: 20px; border-radius: var(--r-xs); border: 2px solid transparent; transition: transform var(--dur); }
.c2-emoji:hover span { transform: scale(1.12); }
.c2-emoji input:checked + span { background: var(--c-purple-050); border-color: var(--c-purple); }

/* ==========================================================================
  LOGOTIPO ANDA
   ========================================================================== */
.anda-logo-grid {
    display: flex;
    gap: 0.15em;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', 'Georgia', serif;
}

.anda-letter {
    width: 1.4em;
    height: 1.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #232120;
    font-size: 1em;
    font-weight: 400;
    transition: all 0.25s ease;
    box-shadow: 0 0.05em 0 #1a1817;
    border: 1px solid #3d3936;
    position: relative;
    cursor: default;
    line-height: 1;
}

.anda-letter:nth-child(1) { transform: rotate(-6deg) translateY(-4%); border-radius: 50% 20% 50% 20% / 20% 50% 20% 50%; color: #D48C9A; }
.anda-letter:nth-child(2) { transform: rotate(4deg) translateY(6%); border-radius: 30% 50% 30% 50% / 50% 30% 50% 30%; color: #F5F5F5; }
.anda-letter:nth-child(3) { transform: rotate(-3deg) translateY(-2%); border-radius: 20% 50% 20% 50% / 40% 20% 40% 20%; color: #D9B772; }
.anda-letter:nth-child(4) { transform: rotate(7deg) translateY(5%); border-radius: 45% 15% 45% 15% / 15% 45% 15% 45%; color: #7B9DA8; }

.anda-letter:hover { transform: rotate(0deg) scale(1.08) translateY(0); box-shadow: 0 0.1em 0 #1a1817; border-color: #7f7770; z-index: 2; }

/* Modificadores de tamaño (Responsive) */
.anda-logo--login {
    font-size: clamp(35px, 10vw, 55px); /* Se adapta al tamaño del móvil o PC */
    margin-bottom: 15px;
}

.anda-logo--sidebar {
    font-size: 22px; /* Tamaño ideal para encajar en la cabecera de la app */
    margin-left: 10px;
}
