/* ============================================================================
   PANEL DE ADMINISTRACIÓN (admin.html) — sobre site.css (tokens y componentes
   del sitio). Prefijo ad-. Tema claro y oscuro: solo variables de tokens.css.
   Gráficas en HTML/CSS: barras de 12 px (≤ 24 px), extremo de 4 px redondeado
   y base recta, un solo color (--accent: cada gráfica es una sola serie y la
   etiqueta dice qué es); textos con los tokens de tinta, nunca con el color de
   la barra. Teléfono (< 760 px): márgenes de 16 px y botones de 44 px.
   ========================================================================== */
.gs { width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: 32px 0 64px; display: flex; flex-direction: column; gap: 20px; }
.gs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.gs-head h1 { margin: 0; font-family: var(--disp); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.01em; }
.gs-sub { margin: 4px 0 0; font-size: 13px; line-height: 18px; color: var(--ink2); }
.gs-skel { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.gs-w40 { width: 40%; }

#gs-panel { display: flex; flex-direction: column; gap: 20px; }

/* ------------------------------------------------------------- PESTAÑAS */
.gs-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 22px; background: var(--fill); align-self: flex-start; }
.gs-tabs > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: transparent; color: var(--ink2); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.gs-tabs > button:hover { color: var(--ink); }
.gs-tabs > button[aria-selected="true"] { background: var(--raised); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); }
.gs-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--defl-soft); color: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gs-sec { display: flex; flex-direction: column; gap: 20px; outline: none; }

/* ---------------------------------------------------------- CIFRAS (tiles) */
.gs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.gs-tile { padding: 16px 18px; border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 .5px var(--paper-edge), 0 1px 3px rgba(0, 0, 0, .05); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gs-tile .l { font-size: 13px; line-height: 16px; color: var(--ink2); }
.gs-tile .v { font-size: 28px; line-height: 34px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.gs-tile .v small { font-size: 15px; font-weight: 600; color: var(--ink2); letter-spacing: 0; white-space: nowrap; }
.gs-tile .d { font-size: 12px; line-height: 16px; color: var(--ink2); }

/* ------------------------------------------------------------- TARJETAS */
.gs-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.gs .s-box { min-width: 0; }
.gs .s-box-h h2 { font-size: 15px; }
.gs .s-box-h .gs-note { margin-left: auto; font-size: 12px; color: var(--ink2); text-align: right; }
.gs-note-p { margin: 0 0 8px; font-size: 12px; line-height: 17px; color: var(--ink2); }
.gs-empty { margin: 0; padding: 8px 0 4px; font-size: 14px; color: var(--ink2); }

/* ------------------------------------------- BARRAS HORIZONTALES (una serie) */
.gs-bars { margin: 0; padding: 4px 0 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.gs-bars > li { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; align-items: center; column-gap: 10px; min-height: 26px; }
.gs-bars .gs-bl { font-size: 13px; line-height: 17px; color: var(--ink); overflow-wrap: anywhere; }
.gs-bars .gs-bl small { display: block; font-size: 11.5px; color: var(--ink2); }
.gs-bars .gs-bt { height: 12px; display: flex; align-items: center; box-shadow: inset 1px 0 0 var(--sep2); }
.gs-bars .gs-bf { height: 12px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--accent); }
.gs-bars .gs-bv { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.gs-bars .gs-bv small { font-weight: 400; color: var(--ink2); }

/* --------------------------------------------- COLUMNAS (altas, L): una serie */
.gs-cols { display: grid; grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr)); align-items: end; gap: 2px; height: 168px; padding-top: 6px; box-shadow: inset 0 -1px 0 var(--sep2); margin-bottom: 22px; }
.gs-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
.gs-col .gs-cb { width: min(24px, 70%); min-height: 0; border-radius: 4px 4px 0 0; background: var(--accent); }
.gs-col .gs-cb.is-cero { height: 1px !important; border-radius: 0; background: var(--sep2); }
.gs-col .gs-cv { font-size: 12px; font-weight: 600; line-height: 16px; color: var(--ink); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.gs-col .gs-cl { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; font-size: 11px; line-height: 14px; color: var(--ink2); white-space: nowrap; }
.gs-col:first-child .gs-cl { left: 0; transform: none; }
.gs-col:last-child .gs-cl { left: auto; right: 0; transform: none; }
.gs-col:hover .gs-cb, .gs-col:focus-visible .gs-cb { filter: brightness(1.12); }
.gs-col:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
/* el dato de cada columna al pasar el ratón o con el teclado (el título también lo dice) */
.gs-col[data-tip]:hover::after, .gs-col[data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2; padding: 4px 8px; border-radius: 8px; background: var(--raised); box-shadow: 0 0 0 .5px var(--sep2), var(--float); color: var(--ink); font-size: 12px; line-height: 16px; white-space: nowrap; pointer-events: none; }
.gs-col:first-child[data-tip]:hover::after, .gs-col:first-child[data-tip]:focus-visible::after { left: 0; transform: none; }
.gs-col:last-child[data-tip]:hover::after, .gs-col:last-child[data-tip]:focus-visible::after { left: auto; right: 0; transform: none; }
.gs-tabla summary { min-height: 32px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--accent-text); cursor: pointer; }
.gs-tabla table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.gs-tabla th, .gs-tabla td { padding: 6px 4px; text-align: left; box-shadow: inset 0 -.5px 0 var(--sep); }
.gs-tabla td:last-child, .gs-tabla th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.gs-tabla th { font-weight: 600; color: var(--ink2); }

/* ------------------------------------------------------------ TABLA SIMPLE */
.gs-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.gs-t th, .gs-t td { padding: 8px 6px; text-align: left; box-shadow: inset 0 -.5px 0 var(--sep); vertical-align: top; }
.gs-t th { font-weight: 600; color: var(--ink2); font-size: 12px; }
.gs-t .n { text-align: right; font-variant-numeric: tabular-nums; }
.gs-t td small { display: block; font-size: 12px; color: var(--ink2); }

/* ---------------------------------------------------- HERRAMIENTAS Y LISTAS */
.gs-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.gs-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gs-fld > label, .gs-lbl { font-size: 13px; line-height: 16px; font-weight: 500; }
.gs-grow { flex: 1 1 260px; }
.gs-sel { width: auto; min-width: 180px; padding-right: 8px; }
.gs-seg { align-self: flex-start; }
.gs-seg > button { height: 34px; border-radius: 15px; cursor: pointer; }
.gs-count { margin: 0 0 0 auto; font-size: 13px; color: var(--ink2); align-self: center; }
.gs-list { display: flex; flex-direction: column; gap: 12px; }
.gs-search { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.gs-search .s-btn { height: 40px; border-radius: 20px; }

/* una solicitud de la comunidad */
.gs-sol { padding: 14px 20px 16px; border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 .5px var(--paper-edge), 0 1px 3px rgba(0, 0, 0, .05); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gs-sol h3 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.gs-sol-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gs-votos { flex: none; display: inline-flex; flex-direction: column; align-items: center; min-width: 48px; padding: 4px 8px; border-radius: 10px; background: var(--fill); font-size: 11px; color: var(--ink2); }
.gs-votos b { font-size: 18px; line-height: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.gs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--fill); color: var(--ink2); font-size: 12px; font-weight: 600; }
.gs-chip.is-recibida { background: var(--accent-soft); color: var(--ink); }
.gs-chip.is-planeada, .gs-chip.is-en_curso { background: var(--defl-soft); color: var(--ink); }
.gs-chip.is-hecha { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--ink); }
.gs-meta { margin: 0; font-size: 12px; line-height: 17px; color: var(--ink2); overflow-wrap: anywhere; }
.gs-det { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.gs-resp { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--fill); font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.gs-resp b { display: block; font-size: 12px; color: var(--ink2); white-space: normal; }
.gs-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.gs-form { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.gs-form textarea.s-in { height: auto; min-height: 120px; padding: 10px 12px; line-height: 20px; resize: vertical; }
.gs-form .gs-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.gs-hint { margin: 0; font-size: 12px; color: var(--ink2); }

/* una cuenta en la lista */
.gs-acc { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 .5px var(--paper-edge); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.gs-acc:hover { box-shadow: 0 0 0 1px var(--accent); }
.gs-acc[aria-expanded="true"] { box-shadow: 0 0 0 1.5px var(--accent); }
.gs-acc .c { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.gs-acc .c small, .gs-acc .x small { display: block; font-size: 12px; font-weight: 400; color: var(--ink2); }
.gs-acc .x { font-size: 13px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.gs-acc .go { color: var(--ink3); }

/* la ficha */
.gs-ficha { display: flex; flex-direction: column; outline: none; }
.gs-ficha .s-kv { grid-template-columns: 180px minmax(0, 1fr); }
.gs-meter { display: flex; flex-direction: column; gap: 6px; padding: 12px 0 4px; }
.gs-meter .t { height: 10px; border-radius: 5px; background: var(--accent-soft); overflow: hidden; }
.gs-meter .f { height: 100%; border-radius: 5px; background: var(--accent); max-width: 100%; }
.gs-meter.is-alto .t { background: var(--defl-soft); }
.gs-meter.is-alto .f { background: var(--defl); }
.gs-meter p { margin: 0; font-size: 13px; color: var(--ink); }
.gs-tope { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding-top: 12px; box-shadow: inset 0 .5px 0 var(--sep); margin-top: 8px; }
.gs-tope .s-in { width: 160px; }
.gs-tope .s-btn { height: 40px; border-radius: 20px; }

/* alertas */
.gs-al { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.gs-al > li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; box-shadow: inset 0 .5px 0 var(--sep); }
.gs-al .t { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 19px; overflow-wrap: anywhere; }
.gs-al .t small { display: block; font-size: 12px; color: var(--ink2); }
.gs-al .s-btn { flex: none; height: 32px; padding: 0 14px; font-size: 13px; }

/* ============================================================= TABLETA */
@media (max-width: 999px) {
  .gs-grid2 { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================ TELÉFONO */
@media (max-width: 759px) {
  .gs { width: calc(100% - 32px); padding: 8px 0 40px; gap: 16px; }
  .gs-head { align-items: center; }
  .gs-head h1 { font-size: 26px; line-height: 32px; }
  .gs-head .s-btn { min-height: 44px; padding: 0 14px; }
  .gs-head .s-btn span { display: none; }
  /* pestañas: dos renglones a lo ancho, de 44 px */
  .gs-tabs { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 16px; }
  .gs-tabs > button { min-height: 44px; padding: 0 6px; border-radius: 13px; font-size: 14px; white-space: normal; text-align: center; line-height: 17px; }
  .gs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gs-tile { padding: 12px 14px; }
  .gs-tile .v { font-size: 22px; line-height: 28px; }
  .gs-bars > li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 3px; }
  .gs-bars .gs-bl { grid-column: 1 / -1; }
  .gs-cols { height: 140px; }
  .gs-tools { align-items: stretch; }
  .gs-tools .gs-fld { flex: 1 1 100%; }
  .gs-sel { width: 100%; }
  .gs-seg { display: flex; align-self: stretch; }
  .gs-seg > button { flex: 1 1 0; height: 44px; border-radius: 14px; }
  .gs-count { margin: 0; }
  .gs-search .s-btn, .gs-tope .s-btn, .gs-acts .s-btn, .gs-form .s-btn, .gs-al .s-btn { min-height: 44px; height: auto; border-radius: 22px; }
  .gs-search .s-btn { flex: 1 1 100%; }
  .gs-tope .s-in { width: 100%; }
  .gs-tope .s-btn { flex: 1 1 100%; }
  .gs-tabla summary { min-height: 44px; }
  .gs-sol { padding: 12px 14px 14px; }
  .gs-acts .s-btn { flex: 1 1 100%; }
  .gs-acc { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; padding: 10px 14px; }
  .gs-acc .x { grid-column: 1 / 2; }
  .gs-acc .go { grid-row: 1; grid-column: 2; }
  .gs-ficha .s-kv { grid-template-columns: minmax(0, 1fr); }
  .gs-al > li { flex-wrap: wrap; }
  .gs-al .s-btn { flex: 1 1 100%; }
  .gs-t th, .gs-t td { padding: 8px 4px; }
}
