
  :root {
    --rosa-fuerte: #DA006B;
    --vino: #68063C;
    --rosa-suave: #EE8CBC;
    --gris: #444444;
    --negro: #000000;
  }
  * { box-sizing: border-box; }
  body {
    font-family: 'Century Gothic', 'Segoe UI', Verdana, sans-serif;
    color: var(--gris);
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: safe center;
    justify-content: safe center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    background:
      radial-gradient(circle at 18% 22%, rgba(238,140,188,0.35), transparent 38%),
      radial-gradient(circle at 82% 78%, rgba(218,0,107,0.4), transparent 42%),
      linear-gradient(155deg, var(--negro) 0%, var(--vino) 65%, var(--negro) 100%);
  }
  .blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
    animation: flotar 16s ease-in-out infinite;
  }
  .blob-1 { width: 420px; height: 420px; top: -120px; left: -100px; background: radial-gradient(circle, var(--rosa-fuerte), transparent 70%); }
  .blob-2 { width: 360px; height: 360px; bottom: -140px; right: -80px; background: radial-gradient(circle, var(--rosa-suave), transparent 70%); animation-delay: -6s; }
  .blob-3 { width: 280px; height: 280px; top: 38%; right: 12%; background: radial-gradient(circle, var(--vino), transparent 70%); opacity: 0.35; animation-delay: -3s; }
  @keyframes flotar {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -25px) scale(1.06); }
  }
  .logo-marca-agua {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 900px;
    max-width: 130vw;
    transform: translate(-50%, -50%);
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
  }
  .logo-panel {
    display: block;
    margin: 0 auto 12px;
    height: 52px;
  }
  .fondo-red {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
      linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
      radial-gradient(rgba(255,255,255,0.16) 1.5px, transparent 1.6px);
    background-size: 42px 42px, 42px 42px, 42px 42px;
    background-position: 0 0, 0 0, 21px 21px;
    animation: deriva 40s linear infinite;
    mask-image: radial-gradient(circle at 50% 50%, transparent 0%, transparent 12%, black 55%);
  }
  @keyframes deriva {
    from { background-position: 0 0, 0 0, 21px 21px; }
    to { background-position: 420px 0, 0 420px, 441px 421px; }
  }
  .panel, .dashboard {
    position: relative;
    z-index: 1;
  }
  .panel {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(20,0,15,0.45), 0 0 0 1px rgba(255,255,255,0.08) inset;
  }
  .panel h1 {
    color: var(--vino);
    font-size: 1.25rem;
    margin: 0 0 4px;
    text-align: center;
  }
  .panel p.sub {
    text-align: center;
    font-size: 0.85rem;
    margin: 0 0 24px;
    color: var(--gris);
  }
  label { display: block; font-weight: bold; font-size: 0.9rem; margin: 14px 0 6px; }
  input {
    width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem;
  }
  button {
    width: 100%;
    margin-top: 22px;
    background: linear-gradient(135deg, var(--vino), var(--rosa-fuerte));
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 700;

    cursor: pointer;
    box-shadow: 0 8px 20px rgba(218,0,107,0.35);
    transition: filter .15s ease, transform .1s ease;
  }
  button:hover { filter: brightness(1.08); }
  button:active { transform: translateY(1px); }
  
  .dashboard h1 { color: var(--vino); font-size: 1.2rem; margin: 0 0 4px; text-align: center; }
  .dashboard p.sub { text-align: center; font-size: 0.85rem; color: var(--gris); margin: 0 0 22px; }
  .dashboard a.boton {
    display: block;
    text-decoration: none;
    background: var(--vino);
    color: #fff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.95rem;
  }
  .dashboard a.boton:hover { background: var(--rosa-fuerte); }
  .dashboard a.boton.secundario { background: #f3eef0; color: var(--vino); }
  .dashboard a.boton.secundario:hover { background: #ecdfe4; }
  #panel-selector {
    max-width: 680px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(20,0,15,0.5), 0 0 0 1px rgba(255,255,255,0.08) inset;
  }
  #panel-selector .dash-header { text-align: left; }
  #panel-selector .dash-marca p.sub { color: var(--gris); }
  .tarjetas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 4px;
  }
  .tarjeta-sistema {
    display: flex; flex-direction: column; align-items: center;
    background: linear-gradient(165deg, color-mix(in srgb, var(--acento, var(--vino)) 8%, white), #fff 55%);
    border: 1px solid color-mix(in srgb, var(--acento, var(--vino)) 18%, white);
    border-top: 3px solid var(--acento, var(--vino));
    border-radius: 16px;
    padding: 28px 16px 22px;
    text-align: center;
    text-decoration: none;
    color: var(--vino);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  .tarjeta-sistema:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px color-mix(in srgb, var(--acento, var(--vino)) 26%, transparent);
    border-color: color-mix(in srgb, var(--acento, var(--vino)) 40%, white);
  }
  .tarjeta-sistema .icono { display: flex; align-items: center; justify-content: center; height: 46px; margin-bottom: 12px; }
  .tarjeta-sistema .titulo { display: block; font-weight: 800; font-size: 1.05rem; }
  .tarjeta-sistema .desc { display: block; font-size: 0.74rem; color: var(--gris); margin-top: 6px; line-height: 1.4; }
  .boton-volver {
    display: inline-block; margin-bottom: 16px; font-size: 0.82rem;
    color: var(--vino); text-decoration: none; font-weight: bold;
  }
  .boton-volver:hover { text-decoration: underline; }

  .grupo-botones { margin-bottom: 18px; }
  .grupo-botones h2 {
    font-size: 0.76rem; color: var(--vino);
    margin: 0 0 8px; text-align: left; font-weight: bold;
  }
  .grupo-botones .fila-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  }
  .grupo-botones .fila-grid a.boton { margin-bottom: 0; }
  @media (max-width: 480px) {
    .grupo-botones .fila-grid { grid-template-columns: 1fr; }
  }

  /* ---- Tablero de Convivencia Educativa: grid de categorías, sin scroll ---- */
  #panel-dashboard {
    width: min(1400px, 96vw);
    max-width: none;
    padding: clamp(18px, 2.8vh, 32px) clamp(18px, 2.8vw, 34px);
    background: #fff;
    box-shadow: 0 30px 70px rgba(20,0,15,0.5), 0 0 0 1px rgba(255,255,255,0.08) inset;
  }
  .dash-header {
    margin-bottom: clamp(14px, 2.4vh, 22px);
    padding-bottom: clamp(12px, 1.8vh, 16px);
    border-bottom: 1px solid #f2e6eb;
  }
  .dash-footer {
    margin-top: clamp(10px, 2vh, 16px);
  }
  .dash-footer .boton-volver { margin-bottom: 0; }
  .dash-marca { display: flex; align-items: center; gap: 16px; }
  .dash-marca .logo-chip {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 54px; height: 54px; border-radius: 14px;
    background: linear-gradient(145deg, var(--vino), var(--negro));
    box-shadow: 0 8px 18px rgba(104,6,60,0.3);
  }
  .dash-marca .logo-chip img { height: 30px; margin: 0; filter: brightness(0) invert(1); }
  .dash-eyebrow {
    display: block; font-size: 0.66rem; font-weight: 800; 
    color: var(--rosa-fuerte); margin: 0 0 2px;
  }
  .dash-marca h1 { margin: 0; font-size: 1.5rem; color: var(--vino); text-align: left; }
  .dash-marca p.sub { margin: 4px 0 0; font-size: 0.82rem; color: var(--gris); text-align: left; }
  .dash-marca p.sub strong { color: var(--rosa-fuerte); font-weight: 700; }

  .grid-categorias {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 0;
  }
  /* El acento de cada tarjeta lo decide su lugar, no su cargo: la rueda es
     grafito, vino, fucsia y rosa —los cuatro tonos del manual, en ese orden
     y decidido por ella—, y vuelve a empezar cada cuatro tarjetas. Mover una
     tarjeta de sitio la rehace sola.
     El rosa no sostiene letra blanca, así que cada tarjeta lleva además con qué
     se le escribe: `--sobre-acento` es lo que va encima del tono y
     `--acento-texto` es el tono cuando le toca ser letra sobre blanco. En las
     tarjetas de rosa los dos son el vino.
     Con cuatro columnas la rueda deja cada columna de un solo tono, porque la
     vecina de arriba queda a cuatro tarjetas y la rueda mide cuatro; con tres,
     dos o una columna ninguna toca a otra de su color. */
  .cat-card:nth-child(4n+1) { --acento: var(--gris); --sobre-acento: #fff; --acento-texto: var(--gris); }
  .cat-card:nth-child(4n+2) { --acento: var(--vino); --sobre-acento: #fff; --acento-texto: var(--vino); }
  .cat-card:nth-child(4n+3) { --acento: var(--rosa-fuerte); --sobre-acento: #fff; --acento-texto: var(--rosa-fuerte); }
  .cat-card:nth-child(4n+4) { --acento: var(--rosa-suave); --sobre-acento: var(--vino); --acento-texto: var(--vino); }

  /* `display: flex` le gana al atributo `hidden`, así que sin esta línea la
     tarjeta de administración se veía igual escondida. */
  .cat-card[hidden] { display: none; }
  .cat-card {
    display: flex; flex-direction: column;
    align-self: start;
    background: linear-gradient(165deg, color-mix(in srgb, var(--acento, var(--vino)) 7%, white), #fff 60%);
    border: 1px solid color-mix(in srgb, var(--acento, var(--vino)) 18%, white);
    border-top: 3px solid var(--acento, var(--vino));
    border-radius: 14px;
    padding: clamp(10px, 1.8vh, 16px) clamp(10px, 1.2vw, 14px);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  .cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px color-mix(in srgb, var(--acento, var(--vino)) 24%, transparent);
    border-color: color-mix(in srgb, var(--acento, var(--vino)) 38%, white);
  }
  .cat-header { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(8px, 1.4vh, 12px); }
  .cat-badge {
    flex: none; display: flex; align-items: center; justify-content: center;
    height: 34px; width: 50px;
  }
  .cat-badge svg { width: 100%; height: 100%; }
  .cat-header h2 {
    margin: 0; font-size: 0.85rem; font-weight: 800; text-align: left;
    color: var(--vino);
  }
  .cat-acciones { display: flex; flex-direction: column; gap: 6px; flex: 1; }
  .cat-boton {
    display: flex; align-items: center; gap: 7px; text-decoration: none;
    background: rgba(255,255,255,0.75); color: var(--vino);
    border: 1px solid color-mix(in srgb, var(--acento, var(--vino)) 22%, white);
    border-radius: 8px; padding: clamp(6px, 0.9vh, 8px) 9px;
    font-size: 0.71rem; font-weight: 400; line-height: 1.22;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
  }
  .cat-boton::before {
    content: ''; width: 5px; height: 5px; border-radius: 50%; flex: none;
    background: var(--acento, var(--vino)); transition: background .15s ease;
  }
  .cat-boton:hover {
    background: var(--acento, var(--vino)); color: var(--sobre-acento, #fff);
    border-color: var(--acento, var(--vino));
  }
  .cat-boton:hover::before { background: var(--sobre-acento, #fff); }

  .cat-acciones-numeradas { display: flex; flex-direction: column; gap: 6px; flex: 1; }
  .tema-numerado {
    display: flex; align-items: center; gap: 7px; text-decoration: none;
    background: rgba(255,255,255,0.75); color: var(--vino);
    border: 1px solid color-mix(in srgb, var(--acento, var(--vino)) 22%, white);
    border-radius: 8px; padding: clamp(6px, 0.9vh, 8px) 9px;
    font-size: 0.71rem; font-weight: 700; line-height: 1.22;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
  }
  .tema-numerado:hover {
    background: var(--acento, var(--vino)); color: var(--sobre-acento, #fff);
    border-color: var(--acento, var(--vino));
  }
  .numero-tema {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--acento, var(--vino)); color: var(--sobre-acento, #fff);
    font-size: 0.62rem; font-weight: 800; transition: background .15s ease, color .15s ease;
  }
  /* El recuadro del número invertido queda blanco siempre —también en las
     tarjetas de rosa, donde `--sobre-acento` es vino y lo dejaría invisible—. */
  .tema-numerado:hover .numero-tema {
    background: #fff; color: var(--acento-texto, var(--acento, var(--vino)));
  }

  @media (max-width: 1180px) {
    .grid-categorias { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 860px) {
    .grid-categorias { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 420px) {
    .grid-categorias { grid-template-columns: 1fr; }
  }
  @media (max-height: 640px) {
    .cat-header h2 { font-size: 0.76rem; }
    .cat-boton { font-size: 0.68rem; padding: 5px 8px; }
    .cat-card { padding: 8px 10px; }
    .cat-header { margin-bottom: 6px; }
    .cat-acciones { gap: 4px; }
    .cat-acciones-numeradas { gap: 4px; }
    .tema-numerado { font-size: 0.68rem; padding: 5px 8px; }
  }
  /* ── La tarjeta de ingreso (especificación 003) ───────────────────────── */
  #panel-ingreso { padding: 38px 36px 32px; text-align: center; }
  .login-logo {
    width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, var(--vino), var(--negro));
    box-shadow: 0 10px 22px rgba(104,6,60,0.35);
  }
  .login-logo img { height: 30px; margin: 0; filter: brightness(0) invert(1); }
  .login-eyebrow { display: block; font-size: 0.66rem; font-weight: 800; color: var(--rosa-fuerte); margin-bottom: 5px; }
  #panel-ingreso h1 { font-size: 1.4rem; }
  .login-tagline { text-align: center; font-size: 0.83rem; color: var(--gris); margin: 3px 0 24px; }
  .login-reglas { text-align: center; font-size: 0.74rem; color: var(--gris); margin: 0 0 16px; }
  .pista-login { display: block; font-size: 0.7rem; color: var(--gris); margin-top: 5px; }
  .campo-login { margin-bottom: 14px; text-align: left; }
  .campo-login label { display: block; font-weight: 800; font-size: 0.68rem; color: var(--vino); margin: 0 0 6px; }
  .campo-login input, .campo-login select {
    width: 100%; padding: 11px 13px; border: 1.5px solid #e8dfe4; border-radius: 9px;
    font-size: 0.92rem; font-family: inherit; color: var(--gris); background: #fff; box-sizing: border-box;
  }
  .campo-login input:focus, .campo-login select:focus {
    outline: none; border-color: var(--rosa-fuerte); box-shadow: 0 0 0 3px rgba(218,0,107,0.14);
  }
  /* La clave al azar, a la vista en la misma tarjeta: decisión suya del 2026-09-28. */
  .clave-al-azar {
    border: 1.5px solid var(--rosa-suave); border-radius: 10px; padding: 14px 12px; margin: 0 0 16px;
    color: var(--gris); font-size: 0.82rem; line-height: 1.45;
  }
  .clave-al-azar strong { display: block; font-size: 1.35rem; letter-spacing: 0.12em; color: var(--vino); margin: 6px 0; }
  .error-ingreso { color: var(--rosa-fuerte); font-size: 0.85rem; text-align: center; margin-top: 12px; min-height: 1.2em; }
  .exito-ingreso { color: var(--vino); font-size: 0.85rem; text-align: center; margin-top: 12px; min-height: 1.2em; }
  .link-secundario {
    display: block; text-align: center; margin-top: 16px; font-size: 0.78rem;
    color: var(--gris); text-decoration: none; background: none; cursor: pointer;
    border: 0; padding: 0; width: 100%; font-family: inherit; font-weight: 400; box-shadow: none; transform: none;
  }
  .link-secundario:hover { color: var(--rosa-fuerte); text-decoration: underline; }
  .paso-ingreso { display: none; }
  .quien-entro { font-size: 0.78rem; color: var(--gris); margin: 2px 0 0; }
  .quien-entro a { color: var(--vino); font-weight: 700; text-decoration: none; margin-left: 8px; }
  .quien-entro a:hover { text-decoration: underline; }
