/* Estilos generales: colores, cabecera, tablas, formularios, tarjetas y modales. */
/* Layout: cabecera fija + menú (lateral en tablet y PC); una columna de contenido (máx. 1240px); tablas dentro de pozos con scroll propio */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #ece8e1;
  --line: #ddd6cb;
  --line-strong: #c4baab;
  --fg: #1f2420;
  --muted: #5f665f;
  --faint: #8d938a;
  --accent: #356b5c;
  --accent-ink: #ffffff;
  --accent-soft: #e0ece6;
  --accent-strong: #244d41;
  --ok: #23774a;
  --ok-soft: #ddf0e4;
  --warn: #94600a;
  --warn-soft: #faebcf;
  --crit: #b3261e;
  --crit-soft: #f7dedb;
  --info: #3b5ba9;
  --info-soft: #e1e7f7;
  --bar-track: #e6e1d8;
  --bar-fill: #356b5c;
  --shadow: 0 12px 40px rgba(31, 36, 32, 0.18);
  --f-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121513;
    --surface: #191d1a;
    --surface-2: #212622;
    --line: #2e352f;
    --line-strong: #414a42;
    --fg: #e6e9e4;
    --muted: #a1a99f;
    --faint: #778073;
    --accent: #7cc3ad;
    --accent-ink: #0c231b;
    --accent-soft: #1c3a30;
    --accent-strong: #a6dcc9;
    --ok: #5fc28c;
    --ok-soft: #163525;
    --warn: #e3aa4c;
    --warn-soft: #3a2c12;
    --crit: #ef7366;
    --crit-soft: #3d1c19;
    --info: #8da6ea;
    --info-soft: #1d2744;
    --bar-track: #2a312b;
    --bar-fill: #7cc3ad;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #121513;
  --surface: #191d1a;
  --surface-2: #212622;
  --line: #2e352f;
  --line-strong: #414a42;
  --fg: #e6e9e4;
  --muted: #a1a99f;
  --faint: #778073;
  --accent: #7cc3ad;
  --accent-ink: #0c231b;
  --accent-soft: #1c3a30;
  --accent-strong: #a6dcc9;
  --ok: #5fc28c;
  --ok-soft: #163525;
  --warn: #e3aa4c;
  --warn-soft: #3a2c12;
  --crit: #ef7366;
  --crit-soft: #3d1c19;
  --info: #8da6ea;
  --info-soft: #1d2744;
  --bar-track: #2a312b;
  --bar-fill: #7cc3ad;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;
}
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] {
  display: none !important;
}
img {
  max-width: 100%;
}
body {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.45;
}
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
.mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
}
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Cabecera */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 10px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-right: auto;
  min-width: 0;
}
.brand b {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand span {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover {
  color: var(--fg);
}
.tab[aria-current='page'] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.tab .cnt {
  font-family: var(--f-mono);
  font-size: 11px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 5px;
  color: var(--muted);
}

/* Temporizador */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dot {
    animation: none;
  }
}

/* Botones */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  border-radius: 6px;
  padding: 7px 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--fg);
}
.btn.pri {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.pri:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.btn.ghost {
  border-color: transparent;
  background: none;
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--fg);
  background: var(--surface-2);
}
.btn.danger {
  color: var(--crit);
  border-color: var(--crit);
}
.btn.danger.solid {
  background: var(--crit);
  color: #fff;
}
.btn.sm {
  padding: 4px 9px;
  font-size: 12.5px;
}
.btn.round {
  border-radius: 999px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Estructura de página */
main {
  padding-block: 22px 60px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 0;
  margin-right: auto;
  text-wrap: balance;
}
.page-head .sub {
  width: 100%;
  color: var(--muted);
  margin: -8px 0 0;
}
h2.sec {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h2.sec .muted {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 12.5px;
}
.grid {
  display: grid;
  gap: 16px;
}
.cols-2 {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
@media (max-width: 900px) {
  .cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  min-width: 0;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.panel.flush > h2.sec {
  padding: 14px 16px 0;
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 820px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.kpi .lab {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}
.kpi .val {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi .val small {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  margin-left: 2px;
}
.kpi .foot {
  font-size: 12.5px;
  color: var(--muted);
}
.kpi.crit .val {
  color: var(--crit);
}

/* Filtros */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.filters input,
.filters select {
  min-width: 0;
}
.filters .grow {
  flex: 1 1 220px;
}
input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 9px;
  min-width: 0;
  max-width: 100%;
}
textarea {
  resize: vertical;
  min-height: 72px;
  width: 100%;
}
input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  padding: 0;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  flex-wrap: wrap;
}
.seg button {
  appearance: none;
  border: 0;
  background: var(--surface);
  padding: 6px 11px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  border-right: 1px solid var(--line);
}
.seg button:last-child {
  border-right: 0;
}
.seg button[aria-pressed='true'] {
  background: var(--fg);
  color: var(--bg);
}

/* Tablas */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.panel .tbl-wrap {
  border: 0;
  border-radius: 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr.click {
  cursor: pointer;
}
tbody tr.click:hover td {
  background: var(--surface-2);
}
tr.void td {
  color: var(--faint);
}
tr.void .t-title {
  text-decoration: line-through;
}
tfoot td {
  font-weight: 600;
  background: var(--surface-2);
  border-top: 1px solid var(--line-strong);
}
.t-title {
  font-weight: 500;
}
.t-sub {
  color: var(--muted);
  font-size: 12.5px;
}
.code {
  font-family: var(--f-mono);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--accent-strong);
}
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 420px;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.5;
}
.chip.info {
  background: var(--info-soft);
  color: var(--info);
}
.chip.acc {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.chip.crit {
  background: var(--crit-soft);
  color: var(--crit);
}
.chip.line {
  background: none;
  border: 1px solid var(--line-strong);
}
.chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Alertas */
.alerts {
  display: flex;
  flex-direction: column;
}
.alert {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px 10px 0;
  border-top: 1px solid var(--line);
}
.alert:first-child {
  border-top: 0;
}
.alert .stripe {
  align-self: stretch;
  border-radius: 0 3px 3px 0;
  background: var(--info);
}
.alert.warn .stripe {
  background: var(--warn);
}
.alert.crit .stripe {
  background: var(--crit);
}
.alert .a-t {
  font-weight: 500;
}
.alert .a-s {
  color: var(--muted);
  font-size: 12.5px;
}

/* Tarjetas de bono */
.bar {
  height: 8px;
  background: var(--bar-track);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--bar-fill);
  border-radius: 4px;
}
.bar.warn i {
  background: var(--warn);
}
.bar.crit i {
  background: var(--crit);
}
.bar.off i {
  background: var(--faint);
}
.blist {
  display: flex;
  flex-direction: column;
}
.brow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 4px 16px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.brow:hover {
  background: var(--surface-2);
}
.brow .b-n {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brow .b-s {
  text-align: right;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.brow .bar {
  grid-column: 1/-1;
}
.brow .b-m {
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 12.5px;
}
.bcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
@media (max-width: 420px) {
  .bcards {
    grid-template-columns: minmax(0, 1fr);
  }
}
.bcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.bcard.wide {
  grid-column: 1/-1;
}
.bcard-h {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.bcard-h .ttl {
  margin-right: auto;
  min-width: 0;
}
.bcard-h .ttl b {
  display: block;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15px;
}
.bnums {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.bnums div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.bnums span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.bnums b {
  font-family: var(--f-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.bnums .saldo b {
  color: var(--accent-strong);
  font-size: 16px;
}
.bactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cli-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.cli-group > h3 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

/* Vacío */
.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
}
.empty b {
  display: block;
  color: var(--fg);
  font-family: var(--f-display);
  font-size: 16px;
  margin-bottom: 6px;
}
.empty .bactions {
  justify-content: center;
  margin-top: 14px;
}
.onboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}
@media (max-width: 760px) {
  .onboard {
    grid-template-columns: minmax(0, 1fr);
  }
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step .n {
  font-family: var(--f-mono);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 500;
}
.step b {
  font-family: var(--f-display);
  font-size: 15px;
}
.step p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 16, 22, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 24px
    max(16px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
}
.modal-card {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 640px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.modal-card.wide {
  max-width: 920px;
}
.m-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.m-head h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0;
  margin-right: auto;
  text-wrap: balance;
  min-width: 0;
}
.m-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.m-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 10px 10px;
}
.m-foot .left {
  margin-right: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 560px) {
  .modal {
    padding: 0;
  }
  .modal-card {
    border-radius: 0;
    min-height: 100%;
    margin: 0;
  }
  .m-foot {
    border-radius: 0;
    position: sticky;
    bottom: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
}
.fgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.fgrid.c3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 560px) {
  .fgrid,
  .fgrid.c3,
  .fgrid.c4 {
    grid-template-columns: minmax(0, 1fr);
  }
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.fld > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.fld.full {
  grid-column: 1/-1;
}
.fld input,
.fld select,
.fld textarea {
  width: 100%;
}
#ft-sol-wrap input,
#ft-sol-wrap select {
  width: 100%;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}
.check input {
  flex: none;
}
.fgrid.c4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .fgrid.c4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.imp-prev table {
  min-width: 640px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 0;
  min-width: 0;
}
legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 6px;
}
.form-err {
  color: var(--crit);
  font-weight: 500;
  margin: 0;
}
.preview {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  margin: 0;
}
.preview.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.contact-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr auto auto;
  gap: 6px;
  align-items: center;
}
@media (max-width: 560px) {
  .contact-row {
    grid-template-columns: 1fr 1fr;
  }
}
.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px 18px;
}
.kv div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.kv span {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.kv b {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
.hist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.hist b {
  color: var(--fg);
  font-weight: 500;
}
.state-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Vista cliente */
.cv-head {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}
.cv-head h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  margin: 0;
}
.cv-head .grow {
  margin-right: auto;
  min-width: 0;
}
.gauge {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gauge .big {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.gauge .big small {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--f-body);
  font-weight: 500;
}
.bar.lg {
  height: 12px;
  border-radius: 6px;
}

/* Importar */
.drop {
  display: block;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 26px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
}
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.progress {
  height: 6px;
  background: var(--bar-track);
  border-radius: 3px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  transform: translateX(-50%);
  z-index: 40;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 500;
  max-width: calc(100% - 32px);
}
.toast.crit {
  background: var(--crit);
  color: #fff;
}
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
}
.notice b {
  display: block;
  font-family: var(--f-display);
  font-size: 17px;
  margin-bottom: 6px;
}
.hide-sm {
}
.fld textarea.big {
  min-height: 220px;
  font-size: 14.5px;
  line-height: 1.55;
}
.fld textarea.mid {
  min-height: 140px;
  line-height: 1.5;
}
.desc-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
}
.desc-box h2.sec {
  margin-bottom: 6px;
}
.res-box {
  background: var(--ok-soft);
  border: 1px solid var(--ok);
  border-radius: var(--r);
  padding: 14px 16px;
}
.res-box h2.sec {
  color: var(--ok);
  margin-bottom: 6px;
}
.res-box .prose {
  color: var(--fg);
}
.lead {
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}
.timeline li span {
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 12px;
}
.userbox {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.userbox b {
  color: var(--fg);
  font-weight: 500;
}
.login {
  max-width: 380px;
  margin: 9vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login h1 {
  font-family: var(--f-display);
  font-size: 22px;
  margin: 0;
}
.login p {
  margin: 0;
  color: var(--muted);
}
.login .btn {
  justify-content: center;
  padding: 10px;
}
.tabs:empty {
  display: none;
}
@media (max-width: 640px) {
  .userbox .nm {
    display: none;
  }
  .hide-sm {
    display: none;
  }
  .brand span {
    display: none;
  }
}

/* Usuarios agrupados por rol (plegables) */
details.ugrupo {
  margin-top: 14px;
}
details.ugrupo > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  margin-bottom: 8px;
}
details.ugrupo > summary::-webkit-details-marker {
  display: none;
}
details.ugrupo > summary h2 {
  margin: 0;
  font-size: 1.05rem;
}
details.ugrupo > summary h2::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  transition: transform 0.15s;
}
details.ugrupo[open] > summary h2::before {
  transform: rotate(90deg);
}
.chip.rol i {
  font-style: normal;
}
.utabla {
  table-layout: fixed;
}
.utabla th:nth-child(1) {
  width: 30%;
}
.utabla th:nth-child(2) {
  width: 22%;
}
.utabla th:nth-child(4) {
  width: 15%;
}
.utabla th:nth-child(5) {
  width: 12%;
}
@media (max-width: 640px) {
  .utabla {
    table-layout: auto;
  }
}
.seg-n {
  opacity: 0.65;
  font-size: 0.85em;
}
.preview.crit {
  background: var(--crit-soft);
  border-color: var(--crit);
  color: var(--crit);
}
