:root {
  --bg: #0f1412;
  --panel: #18201c;
  --ink: #eef4ef;
  --muted: #9aada3;
  --line: rgba(238, 244, 239, 0.1);
  --accent: #d4a017;
  --good: #7dcca0;
  --warn: #e0a35a;
  --bad: #e07a6a;
  font-family: "Segoe UI", "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

button, input, select { font: inherit; color: inherit; }

.app {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}
.shell-main .app {
  max-width: none;
  width: 100%;
  padding-left: 24px;
  padding-right: 24px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.04em;
}

.lede, .sync-line, .empty, small, .hint {
  color: var(--muted);
}

.lede { max-width: 560px; line-height: 1.45; margin: 8px 0 0; }

.top-actions, .pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button, .linkbtn {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

button.primary {
  background: var(--accent);
  color: #1a1404;
  border-color: transparent;
  font-weight: 650;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.kpis {
  display: grid;
  grid-template-columns: minmax(180px, 280px);
  gap: 12px;
  margin: 8px 0 10px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { font-size: 28px; letter-spacing: -0.03em; }
.kpi.hot strong { color: var(--bad); }

.watch {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  margin: 0 0 18px;
  overflow: auto;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.check-col { width: 36px; }
tr.picked { background: rgba(212, 160, 23, 0.08); }
tr.watching td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.row-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}
.row-actions .ghost,
.row-actions .linkbtn,
.row-actions .primary {
  padding: 5px 7px;
  font-size: 11px;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}
.vale-actions,
.ficha-actions,
.misc-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.who-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125, 204, 160, 0.35);
  color: var(--good);
  font-size: 12px;
  font-weight: 650;
}
.live-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(125, 204, 160, 0.7);
  animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
  70% { box-shadow: 0 0 0 8px rgba(125, 204, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 204, 160, 0); }
}
.who-filters, .who-assign { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.who-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  flex-shrink: 0;
  display: block;
  background: #c8b8a0;
  border: 2px solid rgba(238, 244, 239, 0.35);
  filter: brightness(1.22) contrast(1.08);
}
.who-pato .who-avatar,
.leg.pato .who-avatar,
.kpi.who-pato .who-avatar { border-color: #d4a017; }
.who-marla .who-avatar,
.leg.marla .who-avatar,
.kpi.who-marla .who-avatar { border-color: #2f9d78; }
.who-karo .who-avatar,
.leg.karo .who-avatar,
.kpi.who-karo .who-avatar,
.who-bar-chip.who-karo .who-avatar { border-color: #6b7cff; }
.who-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 10px 5px 5px;
}
.who-assign button,
.who-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 3px;
  font-size: 12px;
  font-weight: 650;
}
.who-assign .who-avatar,
.who-btn .who-avatar { width: 24px; height: 24px; }
.who-bar-chip,
.who-cell,
.kpi-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.who-bar-chip {
  margin-right: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.kpi-who .who-avatar { width: 28px; height: 28px; }
.desierto-star {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 160, 23, 0.16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
button.ghost.picked {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212, 160, 23, 0.12);
}
.desierto-cal {
  margin: 0 0 16px;
}
.desierto-cal .registro-days {
  display: flex;
}
.listing .muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.who-filter.active,
.who-assign button.active {
  border-color: transparent;
  font-weight: 700;
}
.who-filter.who-pato.active,
.who-assign button.who-pato.active {
  background: #d4a017;
  color: #1a1404;
}
.who-filter.who-marla.active,
.who-assign button.who-marla.active {
  background: #2f9d78;
  color: #04140e;
}
.who-filter.who-karo.active,
.who-assign button.who-karo.active {
  background: #6b7cff;
  color: #fff;
}
tr.who-pato td:first-child { box-shadow: inset 4px 0 0 #d4a017; }
tr.who-marla td:first-child { box-shadow: inset 4px 0 0 #2f9d78; }
tr.who-karo td:first-child { box-shadow: inset 4px 0 0 #6b7cff; }
tr.who-pato { background: rgba(212, 160, 23, 0.1); }
tr.who-marla { background: rgba(47, 157, 120, 0.1); }
tr.who-karo { background: rgba(107, 124, 255, 0.12); }

.vale-actions { display: flex; flex-direction: column; gap: 4px; }
.vale-yes, .vale-no {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 650;
  font-size: 12px;
  white-space: nowrap;
  width: 100%;
}
.vale-yes { color: var(--good); border-color: rgba(125, 204, 160, 0.45); }
.vale-yes:hover { background: rgba(47, 157, 120, 0.18); }
.vale-no { color: var(--bad); border-color: rgba(224, 122, 106, 0.45); }
.vale-no:hover { background: rgba(224, 122, 106, 0.16); }

.kpi { cursor: default; }

.sync-line { margin: 0 0 18px; font-size: 13px; }
.sync-line.err { color: var(--bad); }

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
label.grow { grid-column: span 1; }
label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 10px; }

input, select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.table-head, .table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.table-head { border-bottom: 1px solid var(--line); gap: 16px; flex-wrap: wrap; }

.watch-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px 0;
}
.watch-tab {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}
.watch-tab b {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(238, 244, 239, 0.08);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.watch-tab.active {
  background: var(--accent);
  color: #1a1404;
  border-color: transparent;
}
.watch-tab.active b { background: rgba(26, 20, 4, 0.12); }

.ingresar-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 360px;
  min-width: min(100%, 280px);
}
.ingresar-field { flex: 1; margin: 0; }
.ingresar-form input {
  width: 100%;
  min-width: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.table-foot { border-top: 1px solid var(--line); justify-content: space-between; gap: 12px; }

h2 { margin: 0; font-size: 16px; }

.table-scroll { overflow: auto; }

table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.listing { table-layout: fixed; width: 100%; }
table.listing .col-tight { width: 8%; }
table.listing .nombre-cell {
  width: 46%;
  min-width: 0;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
table.listing .nombre-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}
table.listing .organismo-cell {
  width: 12%;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: break-word;
  word-break: normal;
}
table.listing .ganador-cell { width: 11%; min-width: 0; }
table.listing .money { width: 8%; }
table.listing .resultado-cell { width: 7%; min-width: 0; }
table.listing.compras .cierre-col { width: 108px; }
table.listing.compras .codigo-col { width: 128px; }
table.listing.compras .nombre-cell {
  width: auto;
  font-size: 14px;
  line-height: 1.35;
}
table.listing.compras .organismo-cell { width: 16%; }
table.listing.compras .money {
  width: 112px;
  text-align: right;
  padding-right: 6px;
  white-space: nowrap;
}
table.listing.compras .cotizando-col {
  width: 52px;
  text-align: left;
  padding-left: 2px;
  padding-right: 12px;
  white-space: nowrap;
}
table.listing.compras th.money { text-align: right; }
table.listing td.mono { white-space: nowrap; }
table.listing tr.listing-data td { border-bottom: 0; padding-top: 12px; padding-bottom: 6px; }
table.listing tr.listing-actions td {
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--line);
}
table.listing tr.listing-actions { cursor: default; }
.listing-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.listing-actions-bar button,
.listing-actions-bar .linkbtn {
  width: auto;
  white-space: nowrap;
  font-size: 13px;
  padding: 8px 12px;
}
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(212, 160, 23, 0.06); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.money { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { text-align: center; padding: 40px 16px; cursor: default; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.badge.critica { color: var(--bad); border-color: var(--bad); }
.badge.pronta { color: var(--warn); border-color: var(--warn); }
.badge.ok { color: var(--good); border-color: var(--good); }
.badge.tipo-licitacion { color: #9aa6ff; border-color: #6b7cff; }
.badge.tipo-compra_agil { color: var(--accent); border-color: var(--accent); }

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: flex-end;
}

.drawer[hidden] { display: none; }

.drawer-card {
  width: min(460px, 100%);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 20px;
  overflow: auto;
}

.drawer-card h3 { margin: 12px 0 8px; }
.drawer-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.drawer-card dt { color: var(--muted); font-size: 12px; }
.drawer-card dd { margin: 4px 0 0; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card h1 { font-size: 36px; }
.login-card button.primary { margin-top: 8px; }

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.shell-side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #121916;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.shell-brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shell-menu { display: none; }
.brand { text-decoration: none; color: inherit; }
.brand strong { display: block; font-size: 22px; letter-spacing: -0.03em; }

.shell-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shell-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
}
.shell-nav a:hover, .shell-nav a.active {
  color: var(--ink);
  background: rgba(238, 244, 239, 0.06);
}
.shell-nav a.active { color: var(--accent); }
.shell-side .ghost { width: 100%; }
.nav-soon {
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home {
  max-width: 920px;
  padding: 36px 28px 72px;
}

.modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
  min-height: 180px;
}
.module-card h2 { font-size: 22px; }
.module-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.module-go {
  margin-top: auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}
.module-card.soon { opacity: 0.85; }
.ghost-card { border-style: dashed; color: var(--muted); }

.registro-dash {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}
.registro-people {
  display: grid;
  gap: 10px;
}
.registro-people .kpi small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.registro-people .kpi.who-pato { border-color: rgba(212, 160, 23, 0.5); }
.registro-people .kpi.who-marla { border-color: rgba(47, 157, 120, 0.5); }
.registro-people .kpi.who-karo { border-color: rgba(107, 124, 255, 0.5); }
.registro-people .kpi.who-pato strong { color: #d4a017; }
.registro-people .kpi.who-marla strong { color: #7dcca0; }
.registro-people .kpi.who-karo strong { color: #9aa6ff; }
.registro-years,
.registro-months,
.registro-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.registro-months button,
.registro-days button,
.registro-years button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}
.registro-days { display: none; }
.registro-months button small,
.registro-days button small {
  color: var(--muted);
  font-size: 11px;
}
.registro-months button.picked,
.registro-days button.picked,
.registro-years button.picked {
  border-color: var(--accent);
  color: var(--accent);
}
.registro-months button.picked small,
.registro-days button.picked small { color: var(--accent); }
.registro-chart .registro-days {
  padding: 0 16px 16px;
  margin: 0;
}
.registro-chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.registro-chart .table-head { align-items: flex-end; }
.chart-legend {
  display: flex;
  gap: 12px;
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.chart-legend .leg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .leg:has(.who-avatar)::before { display: none; }
.chart-legend .who-avatar { width: 16px; height: 16px; }
.chart-legend .leg::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #6d7a74;
}
.chart-legend .leg.pato::before { background: #d4a017; }
.chart-legend .leg.marla::before { background: #2f9d78; }
.chart-legend .leg.karo::before { background: #6b7cff; }
.chart-total {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
.chart-total strong {
  display: block;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.03em;
}
.month-chart {
  display: flex;
  align-items: stretch;
  gap: 3px;
  height: 168px;
  padding: 8px 16px 28px;
}
.month-chart .day {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.month-chart .day:hover .stack,
.month-chart .day.selected .stack {
  background: rgba(238, 244, 239, 0.16);
}
.month-chart .day.selected {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
.month-chart .stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  background: rgba(238, 244, 239, 0.06);
  pointer-events: none;
}
.month-chart .seg { width: 100%; min-height: 0; pointer-events: none; }
.month-chart .seg.pato { background: #d4a017; }
.month-chart .seg.marla { background: #2f9d78; }
.month-chart .seg.karo { background: #6b7cff; }
.month-chart .seg.other { background: #6d7a74; }
.month-chart .day small {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.month-chart .day small.quiet { opacity: 0; }
.month-chart .day:hover small.quiet,
.month-chart .day.selected small.quiet { opacity: 1; color: var(--ink); }
.month-chart .day.selected small { color: var(--accent); }
.day-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.day-detail p { margin: 0; }
.day-detail-date { color: var(--ink); font-weight: 650; }
.day-detail-total strong {
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.03em;
}
.day-detail-people {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.day-detail-people li {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.day-detail-people .who-avatar { width: 18px; height: 18px; }
.day-detail-people strong { color: var(--ink); }
.day-detail-people .pato strong { color: #d4a017; }
.day-detail-people .marla strong { color: #7dcca0; }
.day-detail-people .karo strong { color: #9aa6ff; }

tr.won-row { background: rgba(125, 204, 160, 0.08); }
tr.lost-row { background: rgba(224, 122, 106, 0.08); }
.good-text { color: var(--good); }
.bad-text { color: var(--bad); }
.resultado-cell small { display: block; margin-top: 4px; }
.ganador-cell { min-width: 0; }
.ganador-name { font-weight: 650; line-height: 1.3; }
.ganador-name.won { color: var(--good); }
.ganador-name.lost { color: var(--bad); }
.ganador-cell .mono { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.consulta-text {
  margin: 6px 0 0;
  color: var(--ink);
  line-height: 1.4;
  white-space: pre-wrap;
}
.consulta-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.consulta-box label { display: grid; gap: 6px; }
.consulta-box textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.consulta-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 8px;
}
.month-nav strong { letter-spacing: -0.02em; }

.sii-tabs { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.sii-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.sii-panel h2 { margin: 0 0 12px; }
.sii-sub { margin: 28px 0 8px; }
.sii-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.sii-items { margin: 12px 0 16px; }
.sii-items .table-head { padding: 0 0 10px; border: 0; }
.sii-items td input { width: 100%; }
.sii-totals { margin: 10px 0 0; color: var(--ink); font-weight: 650; }
.sii-panel small { display: block; margin-top: 4px; color: var(--muted); }
.sii-advanced { margin: 14px 0; color: var(--muted); }
.sii-advanced summary { cursor: pointer; margin-bottom: 10px; }
.sii-checks { margin: 12px 0; padding-left: 18px; }
.sii-checks li { margin: 4px 0; }
.sii-checks li.ok { color: var(--ok, #1f7a4d); }
.sii-checks li.bad { color: var(--bad, #b42318); }
.sii-raw {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  max-height: 280px;
  overflow: auto;
  background: var(--panel-2, #0f1720);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
}

.perfil-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 240px));
  gap: 14px;
  max-width: 780px;
}
.perfil-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.perfil-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.perfil-card .who-avatar {
  width: 88px;
  height: 88px;
  border-width: 3px;
}
.perfil-file {
  position: relative;
  overflow: hidden;
  font-size: 13px;
  padding: 7px 12px;
}
.perfil-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.perfil-card label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.perfil-card input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}

@media (max-width: 1100px) {
  .sii-grid { grid-template-columns: 1fr; }
  .perfil-grid { grid-template-columns: 1fr; max-width: 280px; }
}

@media (min-width: 701px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .shell-menu { display: none; }
  .shell-nav { display: flex; flex-direction: column; }
  .shell-side [data-logout] { display: block; width: 100%; }
  .shell-side {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  table.listing { display: table; table-layout: fixed; width: 100%; }
  table.listing thead { display: table-header-group; }
  table.listing tbody { display: table-row-group; }
  table.listing tr { display: table-row; }
  table.listing th, table.listing td { display: table-cell; }
  table.listing td[data-label]::before { content: none; display: none; }
  .registro-days { display: none; }
}

@media (max-width: 700px) {
  html, body { overflow-x: hidden; }
  h1 { font-size: 28px; }
  .lede { font-size: 14px; }
  .app { padding: 18px 14px 88px; }
  .shell-main .app { padding-left: 14px; padding-right: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi strong { font-size: 22px; }
  .filters { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .registro-dash { grid-template-columns: 1fr; }
  .ingresar-form { flex-direction: column; align-items: stretch; width: 100%; }
  .ingresar-form input { width: 100%; }
  .who-filters, .top-actions { width: 100%; }
  .month-chart { overflow-x: auto; }
  .shell { grid-template-columns: 1fr; }
  .shell-side {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .shell-menu { display: inline-flex; min-height: 40px; }
  .shell-nav,
  .shell-side [data-logout] { display: none; }
  .shell.nav-open .shell-nav {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
  }
  .shell.nav-open .shell-side [data-logout] { display: block; margin-top: 8px; }
  .shell-nav a { padding: 12px 10px; font-size: 15px; }
  table.listing, table.listing thead, table.listing tbody, table.listing tr, table.listing th, table.listing td {
    display: block;
    width: 100%;
  }
  table.listing { table-layout: auto; }
  table.listing thead { display: none; }
  table.listing tbody tr {
    padding: 14px 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(238, 244, 239, 0.02);
  }
  table.listing tr.listing-data {
    padding: 14px 12px 4px;
    margin-bottom: 0;
    border-bottom: 0;
  }
  table.listing tr.listing-actions td {
    padding: 6px 12px 16px;
  }
  table.listing .nombre-cell,
  table.listing .organismo-cell,
  table.listing .ganador-cell,
  table.listing .money,
  table.listing .resultado-cell,
  table.listing .col-tight { width: auto; }
  table.listing .nombre-cell { font-size: 16px; padding-top: 10px; padding-bottom: 8px; }
  table.listing .nombre-text { -webkit-line-clamp: 4; }
  table.listing td[data-label] {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }
  table.listing td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 2px;
  }
  table.listing td.nombre-cell[data-label] { grid-template-columns: 1fr; }
  table.listing td.nombre-cell[data-label]::before { display: none; }
  .listing-actions-bar { gap: 8px; }
  .listing-actions-bar button,
  .listing-actions-bar .linkbtn { min-height: 40px; font-size: 14px; }
  .who-assign { flex-wrap: wrap; }
  .drawer-card { width: min(100%, 420px); }
  .drawer-card dl { grid-template-columns: 1fr; }
  .login-wrap { padding: 20px 16px; }
  .login-card h1 { font-size: 30px; }
  .home { padding: 20px 16px 72px; }
  .modules { grid-template-columns: 1fr; }
  .sii-tabs button { min-height: 40px; }
  input, select, button, .linkbtn { min-height: 40px; }
  .registro-days { display: flex; }
  .registro-months button,
  .registro-days button {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 44px;
  }
}

.who-ellis .who-avatar,
.leg.ellis .who-avatar,
.kpi.who-ellis .who-avatar,
.who-bar-chip.who-ellis .who-avatar { border-color: #e8a04a; }
.who-filter.who-ellis.active,
.who-assign button.who-ellis.active {
  background: #e8a04a;
  color: #1a1404;
}
tr.who-ellis td:first-child { box-shadow: inset 4px 0 0 #e8a04a; }
tr.who-ellis { background: rgba(232, 160, 74, 0.12); }
.registro-people .kpi.who-ellis { border-color: rgba(232, 160, 74, 0.5); }
.registro-people .kpi.who-ellis strong { color: #f0c080; }
.month-chart .seg.ellis { background: #e8a04a; }
