










* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: #f2efe6;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(196, 163, 90, 0.16), transparent),
    linear-gradient(165deg, #1a211c 0%, #121612 100%);
}

body.is-embed {
  background: #1a211c;
  min-height: 0;
}

.wrap {
  width: 920px;
  max-width: calc(100% - 1.5rem);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.wrap-wide {
  width: 1760px;
}

.table-scroll {
  overflow-x: auto;
}

table.historial {
  min-width: 1480px;
  font-size: 0.82rem;
}

table.historial-feria {
  min-width: 1920px;
}

table.historial th,
table.historial td {
  white-space: nowrap;
  vertical-align: top;
}

table.historial td.nota {
  white-space: normal;
  max-width: 14rem;
}

table.historial-feria th.col-a,
table.historial-feria td.col-a {
  background: rgba(111,159,122,0.14);
}

table.historial-feria th.col-x,
table.historial-feria td.col-x {
  background: rgba(196,163,90,0.12);
}

table.historial-feria th.col-dux,
table.historial-feria td.col-dux {
  background: rgba(196,163,90,0.08);
}

table.historial-feria .hist-group th {
  text-align: center;
  letter-spacing: 0.06em;
}

table.historial-feria .hist-totales td {
  font-weight: 700;
  border-top: 2px solid rgba(242,239,230,0.2);
}

body.is-embed .wrap {
  padding-top: 0.75rem;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2rem;
  margin: 0 0 0.35rem;
}

.brand-embed { font-size: 1.45rem; }

.lead, .muted { color: #b7c0b5; }
.warn { color: #c4a35a; }

.panel {
  background: rgba(44,56,48,0.92);
  border: 1px solid rgba(242,239,230,0.08);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  margin: 0 0 0.85rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1rem; }
.actions form { margin: 0; }
.top-actions { margin-bottom: 1rem; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 0.65rem 1.05rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-primary { background: #c4a35a; color: #1a160c; }
.btn-ghost { background: transparent; color: #f2efe6; border: 1px solid rgba(242,239,230,0.25); }
.btn-danger { background: rgba(196,107,90,0.22); color: #f2efe6; border: 1px solid rgba(196,107,90,0.55); }
.btn-compact { padding: 0.3rem 0.55rem; font-size: 0.78rem; }
.hist-borrar { display: inline; margin: 0; }
.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.dropdown { position: relative; display: inline-block; }
.dropdown > summary {
  list-style: none;
  display: inline-block;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::marker { content: ""; }
.dropdown > summary::after {
  content: " ▾";
  font-weight: 400;
  opacity: 0.8;
}
.dropdown-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 13rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.5rem;
  background: #2c3830;
  border: 1px solid rgba(242,239,230,0.18);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.dropdown-menu a {
  display: block;
  padding: 0.6rem 0.95rem;
  color: #f2efe6;
  text-decoration: none;
  border: 1px solid rgba(242,239,230,0.22);
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}
.dropdown-menu a:hover { background: rgba(242,239,230,0.08); border-color: rgba(196,163,90,0.55); }

label.file, form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #b7c0b5;
  margin-bottom: 0.75rem;
}

input[type="file"], input[type="text"], input[type="password"], select.cond-iva {
  color: #f2efe6;
  background: #243028;
  border: 1px solid rgba(196,163,90,0.35);
  border-radius: 6px;
  padding: 0.7rem;
  font: inherit;
}

select.cond-iva {
  appearance: none;
  width: 100%;
  max-width: 16rem;
  padding: 0.45rem 0.6rem;
}

.grid .faltante select.cond-iva {
  color: #c46b5a;
  border-color: rgba(196,107,90,0.65);
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.45rem 0.35rem; border-bottom: 1px solid rgba(242,239,230,0.08); }
th { color: #b7c0b5; font-size: 0.72rem; text-transform: uppercase; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.grid dt { margin: 0; font-size: 0.72rem; color: #b7c0b5; text-transform: uppercase; }
.grid dd { margin: 0.15rem 0 0; }

.flash { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash li { padding: 0.7rem 0.9rem; border-radius: 6px; }
.flash .error { background: rgba(196,107,90,0.2); border: 1px solid rgba(196,107,90,0.45); }
.flash .ok { background: rgba(111,159,122,0.2); border: 1px solid rgba(111,159,122,0.45); }

.panel-error { border-left: 4px solid #c46b5a; }
.panel-warn { border-left: 4px solid #c4a35a; }
.panel-ok { border-left: 4px solid #6f9f7a; }
.errores { color: #c46b5a; margin: 0.35rem 0 0; padding-left: 1.2rem; }
.grid .faltante dd { color: #c46b5a; }
.grid .recordado dd { color: #c4a35a; }
.hint-recordado {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.download-frame {
  position: absolute;
  width: 0;
  height: 0;
  border: 0;
  overflow: hidden;
}

.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 999px; margin-bottom: 0.75rem; }
.badge-dry { background: rgba(196,163,90,0.2); color: #c4a35a; }
.badge-faltante {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 1.6rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(196,107,90,0.28);
  color: #c46b5a;
  margin: 0;
  text-align: center;
}
a.badge-faltante {
  text-decoration: none;
  cursor: pointer;
}
a.badge-faltante:hover {
  background: rgba(196,107,90,0.5);
  color: #f2efe6;
}
.num-faltante { color: #c46b5a; font-weight: 700; }
.linea-faltante td { background: rgba(196,107,90,0.1); }

.panel-faltantes-stock {
  border-left-color: #c46b5a;
  color: #f2efe6;
}
.panel-faltantes-stock h2 {
  color: #c46b5a;
}
.panel-faltantes-stock .num-faltante {
  color: #c46b5a;
}

table.historial tr.fila-faltante > td {
  border-top: 1px solid rgba(196,107,90,0.85);
  border-bottom: 1px solid rgba(196,107,90,0.85);
  background: rgba(196,107,90,0.06);
}
table.historial tr.fila-faltante > td:first-child {
  border-left: 2px solid #c46b5a;
}
table.historial tr.fila-faltante > td:last-child {
  border-right: 2px solid #c46b5a;
}
table.historial td.celda-faltante {
  color: #c46b5a;
  font-weight: 700;
}

.warnings { color: #c4a35a; }

.cliente-picker {
  margin-bottom: 1rem;
  max-width: 28rem;
}
.cliente-picker-search { position: relative; }
.cliente-picker label { margin-bottom: 0.35rem; }
.cliente-picker input[type="search"] { width: 100%; }
.cliente-picker #cliente-limpiar { margin-top: 0.5rem; }
.suggest-list {
  position: absolute;
  z-index: 9;
  left: 0;
  right: 0;
  top: calc(100% + 0.2rem);
  background: #2c3830;
  border: 1px solid rgba(242,239,230,0.18);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  max-height: 16rem;
  overflow: auto;
  padding: 0.25rem;
}
.suggest-list button {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  color: #f2efe6;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}
.suggest-list button strong { display: block; }
.suggest-list button small { color: #b7c0b5; }
.suggest-list button:hover,
.suggest-list button.is-active { background: rgba(242,239,230,0.08); }
.suggest-empty {
  margin: 0;
  padding: 0.65rem 0.7rem;
  color: #b7c0b5;
}

pre.payload {
  margin: 0;
  padding: 0.85rem;
  overflow: auto;
  max-height: 16rem;
  background: #1a211c;
  border-radius: 6px;
  font-size: 0.8rem;
}

.result-ok { border-left: 4px solid #6f9f7a; }
.result-err { border-left: 4px solid #c46b5a; }
.footer-note { color: #b7c0b5; font-size: 0.85rem; }
a { color: #c4a35a; }

.panel-split .muted { margin: 0.35rem 0 0.85rem; }
table.split-escenarios {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.split-escenarios th,
table.split-escenarios td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(242,239,230,0.12);
  text-align: left;
}
table.split-escenarios th.num,
table.split-escenarios td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.split-escenarios th.col-a,
table.split-escenarios td.col-a {
  background: rgba(111,159,122,0.14);
}
table.split-escenarios th.col-x,
table.split-escenarios td.col-x {
  background: rgba(196,163,90,0.14);
}
table.split-escenarios tr.split-activo td {
  background: rgba(196,163,90,0.28);
  box-shadow: inset 0 0 0 1px rgba(196,163,90,0.55);
  font-weight: 600;
}
table.split-escenarios tr.split-activo td:first-child {
  border-left: 4px solid #c4a35a;
  box-shadow: inset 4px 0 0 #c4a35a, inset 0 0 0 1px rgba(196,163,90,0.55);
}
table.split-escenarios tr.split-activo td.col-a {
  background: rgba(111,159,122,0.38);
}
table.split-escenarios tr.split-activo td.col-x {
  background: rgba(196,163,90,0.38);
}
table.split-escenarios tr.split-activo td.num strong {
  color: #c4a35a;
  font-size: 1.05em;
}
.badge-split-activo {
  background: #c4a35a;
  color: #1a211c;
  margin: 0 0 0 0.4rem;
  vertical-align: middle;
}
