/* Estilos generales de la aplicación: colores, tipografía, cabecera, listas, formularios y paneles. */
/* Layout: cabecera fija con selector de rol y pestañas; área de trabajo en columnas que se apilan en móvil; panel lateral para avisos y formularios */
:root {
  --bg: #edf1f4;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --ink: #15202b;
  --muted: #566473;
  --line: #d6dee6;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --accent-soft: #e2ebf9;
  --ok: #1d7448;
  --ok-soft: #dff1e6;
  --warn: #9a5800;
  --warn-soft: #fbeed6;
  --bad: #b0261d;
  --bad-soft: #fae2df;
  --vio: #5f45a6;
  --vio-soft: #ece7f8;
  --neutral-soft: #e6ebf0;
  --scrim: rgba(8, 14, 22, 0.42);
  --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: #0f141a;
    --surface: #171f28;
    --surface-2: #1c2530;
    --ink: #e6ecf2;
    --muted: #9aa8b6;
    --line: #2a3644;
    --accent: #72a6f6;
    --accent-ink: #0b1422;
    --accent-soft: #1b2a40;
    --ok: #5fca94;
    --ok-soft: #173226;
    --warn: #f0aa50;
    --warn-soft: #3a2a12;
    --bad: #f2806f;
    --bad-soft: #3d1d1a;
    --vio: #b8a2f2;
    --vio-soft: #2a2342;
    --neutral-soft: #232d39;
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f141a;
  --surface: #171f28;
  --surface-2: #1c2530;
  --ink: #e6ecf2;
  --muted: #9aa8b6;
  --line: #2a3644;
  --accent: #72a6f6;
  --accent-ink: #0b1422;
  --accent-soft: #1b2a40;
  --ok: #5fca94;
  --ok-soft: #173226;
  --warn: #f0aa50;
  --warn-soft: #3a2a12;
  --bad: #f2806f;
  --bad-soft: #3d1d1a;
  --vio: #b8a2f2;
  --vio-soft: #2a2342;
  --neutral-soft: #232d39;
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--ink);
  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: 30;
  background: var(--surface);
}
p {
  margin: 0;
}
.hdr {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.in {
  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));
}
.hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding-block: 10px 4px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--accent);
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  flex: none;
  display: block;
}
.login-logo {
  display: block;
  width: calc(100% + 48px);
  max-width: none;
  height: 190px;
  object-fit: contain;
  background: #212843;
  margin: -24px -24px 4px;
  border-radius: 10px 10px 0 0;
}
.brand b {
  display: block;
  font: 700 18px var(--f-display);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand small {
  font-size: 12.5px;
  color: var(--muted);
}
.role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
select,
input,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.role select {
  width: auto;
  max-width: 230px;
}
textarea {
  resize: vertical;
}
.tabs {
  overflow-x: auto;
}
.tabs .in {
  display: flex;
  gap: 2px;
}
.tab {
  appearance: none;
  border: 0;
  background: none;
  font: 500 14px var(--f-body);
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-current='page'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
main.in {
  padding-block: 22px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
h1 {
  font: 700 24px/1.15 var(--f-display);
  margin: 0;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2 {
  font: 600 15px var(--f-display);
  margin: 0;
  text-wrap: balance;
}
.bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/1.2 var(--f-body);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--muted);
}
.btn.pri {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.sm {
  padding: 5px 9px;
  font-size: 12.5px;
}
.btn.danger {
  color: var(--bad);
  border-color: var(--bad);
  background: transparent;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sec {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-width: 0;
}
.sec-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.sec-b {
  padding: 14px 16px;
}
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
  gap: 20px;
  align-items: start;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  align-items: start;
}
.list {
  display: flex;
  flex-direction: column;
}
.item {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: start;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
button.item {
  cursor: pointer;
}
button.item:hover {
  background: var(--surface-2);
}
.list > .item:last-child,
.list > details:last-child {
  border-bottom: 0;
}
.ref {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sub {
  color: var(--muted);
  font-size: 12.5px;
}
.desc {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.side.start {
  justify-content: flex-start;
}
html.movil .item {
  grid-template-columns: minmax(0, 1fr);
}
html.movil .side {
  justify-content: flex-start;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--muted);
}
.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.pill.info {
  background: var(--accent-soft);
  color: var(--accent);
}
.pill.vio {
  background: var(--vio-soft);
  color: var(--vio);
}
.pill.o {
  background: transparent;
  box-shadow: inset 0 0 0 1px currentColor;
}
.pill.no {
  text-decoration: line-through;
  font-weight: 600;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kpi b {
  font: 700 30px/1 var(--f-display);
  font-variant-numeric: tabular-nums;
}
.kpi.bad b {
  color: var(--bad);
}
.kpi span {
  font-size: 13px;
  color: var(--muted);
}
.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font: 500 13px var(--f-body);
  color: var(--muted);
  cursor: pointer;
}
.chip[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.chip i {
  font: normal 400 12px var(--f-mono);
  margin-left: 4px;
  opacity: 0.75;
}
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 16px;
  margin: 0;
}
.kv dt {
  color: var(--muted);
  font-size: 12.5px;
  padding-top: 1px;
}
.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
html.movil .kv {
  grid-template-columns: minmax(0, 1fr);
}
html.movil .kv dd {
  margin-bottom: 6px;
}
.mono {
  font-family: var(--f-mono);
  font-size: 13px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}
.big {
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.note {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
}
.note.warn {
  background: var(--warn-soft);
  border-color: transparent;
}
.note.bad {
  background: var(--bad-soft);
  border-color: transparent;
}
.visit,
.hist {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.parte {
  border-left: 3px solid var(--line);
  padding-left: 10px;
}
.empty {
  padding: 16px;
  color: var(--muted);
}
.kv .back {
  text-align: left;
}
.back {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: 500 14px var(--f-body);
  padding: 0;
  cursor: pointer;
  align-self: flex-start;
}
.dir {
  border-top: 1px solid var(--line);
}
.dir:first-child {
  border-top: 0;
}
.dir-h {
  padding: 14px 16px 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  min-width: 0;
}
.fld.wide,
.wide {
  grid-column: 1/-1;
}
.chk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  cursor: pointer;
}
.chk input {
  width: auto;
  margin-top: 3px;
}
.checks {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.checks label {
  display: flex;
  gap: 6px;
  align-items: center;
}
.checks input {
  width: auto;
}
.formbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
html.movil .form {
  grid-template-columns: minmax(0, 1fr);
}
.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}
.panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(600px, 100%);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.ph {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ph h2 {
  font-size: 18px;
}
.x {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.pb {
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 60;
  max-width: calc(100% - 32px);
}
.when {
  font: 700 15px/1.2 var(--f-display);
}
details.av {
  border-bottom: 1px solid var(--line);
}
details.av > summary {
  list-style: none;
  cursor: pointer;
}
details.av > summary::-webkit-details-marker {
  display: none;
}
details.av[open] > summary {
  background: var(--surface-2);
}
.av-b {
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
a {
  color: var(--accent);
}

/* Ajustes de la app real */
.note.vio {
  background: var(--vio-soft);
  border-color: transparent;
}
.sec.mant {
  border-color: var(--vio);
}
.sec.mant .sec-h {
  background: var(--vio-soft);
}
.btn.wa {
  color: var(--ok);
  border-color: var(--ok);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn.wa::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
}
.kpi.warn b {
  color: var(--warn);
}
.hb {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hb-plot {
  position: relative;
  height: 190px;
  margin-left: 28px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}
.hb-grid {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
}
.hb-grid span {
  position: absolute;
  left: -28px;
  top: -8px;
  width: 22px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hb-col {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1;
}
.hb-bar {
  width: min(26px, 60%);
  background: var(--accent);
  opacity: 0.55;
  border-radius: 4px 4px 0 0;
  min-height: 0;
}
.hb-col.cur .hb-bar,
.hb-col:hover .hb-bar {
  opacity: 1;
}
.hb-val {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hb-x {
  display: flex;
  gap: 2px;
  margin-left: 28px;
}
.hb-x span {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
}
.leyenda {
  display: inline-flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.leyenda i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.hb .leyenda {
  margin-bottom: 4px;
}
.hb-eur.hb-plot,
.hb-eur.hb-x {
  margin-left: 40px;
}
.hb-eur .hb-grid span {
  left: -40px;
  width: 34px;
}
.hb-stack {
  width: min(30px, 64%);
  display: flex;
  flex-direction: column-reverse;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  opacity: 0.85;
}
.hb-col.cur .hb-stack,
.hb-col:hover .hb-stack {
  opacity: 1;
}
.hb-stack i {
  display: block;
  min-height: 0;
}
.hbar {
  display: flex;
  height: 8px;
  width: 100%;
  max-width: 260px;
  background: var(--neutral-soft);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0 2px;
}
.hbar i {
  display: block;
  height: 100%;
}
table.sr-only {
  display: block;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
#print {
  display: none;
}
.grid-partes {
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin: 6px 8px;
}
.grid-partes th {
  font: 600 11px var(--f-body);
  color: var(--muted);
  text-align: center;
  padding: 2px;
  line-height: 1.2;
}
.grid-partes th.fin {
  opacity: 0.5;
}
.grid-partes th.hoy {
  color: var(--accent);
}
.grid-partes tbody th {
  text-align: left;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}
.grid-partes tbody th .back {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.gc {
  padding: 0;
}
.gc button {
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  font: 600 11px var(--f-body);
  cursor: pointer;
  background: transparent;
  color: inherit;
}
.gc.si button {
  background: var(--ok-soft);
  color: var(--ok);
}
.gc.inc button {
  background: var(--bad-soft);
  color: var(--bad);
}
.gc.no button {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--warn-soft);
}
.gc.hoy button {
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.gc.na button {
  background: var(--neutral-soft);
  opacity: 0.45;
}
.leyenda i.lg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.lg.si {
  background: var(--ok-soft);
}
.lg.inc {
  background: var(--bad-soft);
}
.lg.no {
  box-shadow: inset 0 0 0 1.5px var(--warn-soft);
}
.feed-inc {
  display: block;
  margin-top: 4px;
  padding: 4px 8px;
  border-left: 3px solid var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}
.dash-ctl {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dash-f select {
  min-width: 240px;
  max-width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font: 500 14px var(--f-body);
}
.dash-act {
  margin: -4px 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.dash-act b {
  color: var(--ink);
}
.feed-obra {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
}
.feed-obra b {
  color: var(--ink);
  font-size: 14.5px;
}
html.movil .dash-ctl {
  width: 100%;
  justify-content: flex-start;
}
html.movil .dash-f,
html.movil .dash-f select {
  width: 100%;
}
.ia-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.ia-head .acts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ia-cupo {
  font-size: 13px;
}
.ia-cols {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.ia-texto {
  font-size: 15px;
  line-height: 1.55;
  max-width: 70ch;
}
.ia-texto p {
  margin: 0 0 10px;
}
.ia-meta {
  margin-bottom: 10px;
}
.item.sel {
  background: var(--accent-soft);
}
html.movil .ia-cols {
  grid-template-columns: 1fr;
}
.picked {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
}
.picker {
  max-height: 340px;
  overflow: auto;
}
.picker .item.first {
  background: var(--surface-2);
}
details.mes > summary {
  list-style: none;
  cursor: pointer;
}
details.mes > summary::-webkit-details-marker {
  display: none;
}
details.mes > summary b::before {
  content: '▸ ';
  color: var(--muted);
}
details.mes[open] > summary b::before {
  content: '▾ ';
}
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13.5px;
}
.check-list li.si {
  color: var(--ok);
}
.check-list li.no {
  color: var(--bad);
}
.checks.col {
  flex-direction: column;
  gap: 10px;
}
.checks.col label {
  align-items: flex-start;
  font-size: 14.5px;
}
.checks.col input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex: none;
}
.chkcell {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.chkcell input {
  width: 18px;
  height: 18px;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
body::before {
  display: none;
}
.hdr {
  top: 0;
  padding-top: env(safe-area-inset-top, 0px);
}
main.in {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}
.user {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.login {
  max-width: 400px;
  margin: 10vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login .btn {
  padding: 10px;
}
.toast.err {
  background: var(--bad);
  color: var(--surface);
}
.dim {
  opacity: 0.62;
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.sec.next {
  border-color: var(--accent);
}
.sec.next .sec-h {
  background: var(--accent-soft);
}
.nx-cli {
  font: 700 18px var(--f-display);
}

/* Personalizar el Panel y el Dashboard: tarjetas que se arrastran, se mueven con flechas o se ocultan */
.tj-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.tj-grid > .tj-ancho {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .tj-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.tj {
  border: 2px dashed var(--accent);
  border-radius: var(--r);
  padding: 6px;
  background: var(--accent-soft);
  cursor: grab;
  min-width: 0;
}
.tj > :not(.tj-ctl) {
  pointer-events: none;
}
.tj-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.tj-asa {
  color: var(--muted);
  font-size: 16px;
}
.tj-nombre {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tj-oculta {
  border-color: var(--line);
  background: var(--surface-2);
}
.tj-oculta > :not(.tj-ctl) {
  opacity: 0.35;
}
.tj.arrastrando {
  opacity: 0.5;
}
.tj.sobre {
  border-style: solid;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tj-aviso {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
html.movil .tj-grid {
  grid-template-columns: minmax(0, 1fr);
}
html.movil .tj {
  cursor: default;
}
/* Al personalizar, las cifras se hacen un poco más anchas para que quepan los controles */
.kpis:has(> .tj) {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.tj-ctl .btn {
  flex: none;
}
html.movil .kpis:has(> .tj) {
  grid-template-columns: minmax(0, 1fr);
}
/* Bloques que se pueden recoger (p. ej. el resumen con IA de la obra) */
.h-plegable {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.btn.plegar {
  flex: none;
  min-width: 30px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}
.sec.plegada > .sec-h {
  border-bottom: 0;
}
/* Mosaico (mosaico.js): los bloques se apilan sin dejar huecos bajo los más bajos */
.mosaico {
  grid-auto-rows: 4px;
  row-gap: 0;
  align-items: start;
}
@media print {
  .mosaico {
    grid-auto-rows: auto;
    row-gap: 20px;
  }
  .mosaico > * {
    grid-row-end: auto !important;
  }
}
/* En los bloques estrechos de las rejillas, las etiquetas pasan debajo del texto para no pisarlo */
.mosaico .sec {
  container-type: inline-size;
}
@container (max-width: 640px) {
  .item {
    grid-template-columns: 5.6rem minmax(0, 1fr);
  }
  .item > .side {
    grid-column: 2;
    justify-content: flex-start;
  }
}
.main b {
  overflow-wrap: anywhere;
}

/* Usuarios agrupados por rol (plegables) */
details.ugrupo > summary {
  cursor: pointer;
  list-style: none;
}
details.ugrupo > summary::-webkit-details-marker {
  display: none;
}
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);
}
details.ugrupo + details.ugrupo {
  margin-top: 14px;
}
.filtros-sel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.pill.rol {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pill.rol i {
  font-style: normal;
}
.rol-av {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.95rem;
  background: var(--neutral-soft);
  color: var(--muted);
}
.rol-av.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.rol-av.info {
  background: var(--accent-soft);
  color: var(--accent);
}
.rol-av.vio {
  background: var(--vio-soft);
  color: var(--vio);
}
.rol-av.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
/* Filtros en una franja: a la izquierda los principales y a la derecha el resto (en el móvil, debajo) */
.franja-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.franja-filtros .ff-der {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-left: auto;
}
html.movil .franja-filtros .ff-der {
  margin-left: 0;
}
.franja-filtros select {
  width: auto;
  min-width: 0;
  max-width: 14rem;
}
.franja-filtros .role {
  gap: 6px;
}
