/* ==========================================================================
   HARANA DISCO · Panel web en vivo
   Dark + oro, mobile-first, sin dependencias de fuentes externas.
   ========================================================================== */

:root {
  --bg: #0a0907;
  --bg-2: #12100c;
  --bg-3: #171410;
  --line: #2a251c;
  --line-soft: #211d16;
  --text: #f1eadc;
  --muted: #a89e8b;
  --muted-2: #7e7565;
  --gold: #c9a86a;
  --gold-2: #e8cf9c;
  --gold-soft: rgba(201, 168, 106, 0.12);
  --danger: #e0796f;
  --danger-soft: rgba(224, 121, 111, 0.12);
  --warn: #d8b072;
  --warn-soft: rgba(216, 176, 114, 0.12);
  --ok: #7cc79b;
  --ok-soft: rgba(124, 199, 155, 0.12);
  --info: #8fb6d6;
  --info-soft: rgba(143, 182, 214, 0.12);
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: var(--gold-2);
}

::selection {
  background: rgba(201, 168, 106, 0.28);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 640px at 82% -12%, rgba(201, 168, 106, 0.10), transparent 62%),
    radial-gradient(700px 520px at -12% 108%, rgba(201, 168, 106, 0.05), transparent 60%),
    linear-gradient(180deg, #0d0b08 0%, #0a0907 58%);
  z-index: -1;
}

/* ============================== MARCA ============================== */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(201, 168, 106, 0.42);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 0 18px rgba(201, 168, 106, 0.08);
}

.logo-mark {
  color: var(--logo-gold, var(--gold-2));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.logo-mark.small { font-size: 13px; }

.logo-mark.small {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.brand-eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.brand-name {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.24em;
}

.brand-sub {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

/* ============================== ARRANQUE ============================== */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--bg);
  z-index: 20;
}

.boot p {
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.boot-line {
  display: block;
  width: 120px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.boot-line::after {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  content: "";
  animation: boot 1.2s ease-in-out infinite;
}

@keyframes boot {
  from { transform: translateX(-110%); }
  to { transform: translateX(260%); }
}

/* ============================== ACCESO ============================== */

.auth {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: max(24px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
}

.auth-theme {
  position: absolute;
  top: 16px;
  right: 16px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 26px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(420px 200px at 10% -10%, rgba(201, 168, 106, 0.10), transparent 70%),
    linear-gradient(170deg, #15120d, #0e0c09);
  box-shadow: var(--shadow);
}

.auth-card .brand {
  margin-bottom: 26px;
}

.auth h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

.auth h1 em {
  color: var(--gold-2);
  font-style: italic;
}

.auth-sub {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 16px;
  transition: border-color 160ms ease, background 160ms ease;
}

.field input::placeholder {
  color: #5f5749;
}

.field input:focus,
.field select:focus {
  border-color: rgba(201, 168, 106, 0.55);
  background: var(--panel-2);
  outline: none;
}

.field-inline {
  position: relative;
  display: block;
}

.field-inline input {
  padding-right: 64px;
}

.reveal {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 54px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reveal:hover {
  background: var(--gold-soft);
}

.credentials {
  margin: 4px 0 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
}

.credentials summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 13px;
  cursor: pointer;
  list-style: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.credentials summary::-webkit-details-marker {
  display: none;
}

.credentials summary small {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 500;
}

.credentials[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.credentials-body {
  padding: 14px 13px 6px;
}

.btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn[disabled] {
  cursor: progress;
  opacity: 0.6;
}

.btn-gold {
  width: 100%;
  margin-top: 6px;
  background: linear-gradient(135deg, #e0c184, #b08c4c);
  color: #191307;
  box-shadow: 0 12px 30px rgba(201, 168, 106, 0.18);
}

.btn-gold:hover {
  filter: brightness(1.06);
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(224, 121, 111, 0.35);
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
}

.hint {
  margin: 9px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.6;
}

.hint b {
  color: #c8baa1;
}

.hint.center {
  text-align: center;
}

.auth-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding: 0 8px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ============================== PANEL ============================== */

.app {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 9, 7, 0.97);
}

.brand-copy {
  min-width: 0;
}

#company-name {
  overflow: hidden;
  max-width: 46vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}

.live.is-on {
  border-color: rgba(124, 199, 155, 0.35);
  color: var(--ok);
}

.live.is-on i {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(124, 199, 155, 0.12);
  animation: pulse 2.2s ease-in-out infinite;
}

.live.is-off {
  border-color: rgba(224, 121, 111, 0.32);
  color: var(--danger);
}

.live.is-off i {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--muted);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  border-color: rgba(201, 168, 106, 0.4);
  color: var(--gold-2);
}

.device-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
}

.device-select {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.device-select select {
  max-width: 52vw;
  height: 36px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.stamp {
  flex: none;
  color: var(--muted-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.content {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
}

.content.is-updated {
  animation: flash 700ms ease;
}

@keyframes flash {
  0% { opacity: 0.45; }
  100% { opacity: 1; }
}

.banner {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(224, 121, 111, 0.35);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.26em;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 8vw, 36px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.hero h1 em {
  color: var(--gold-2);
  font-style: italic;
}

.version {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ KPIs ------------------------------ */

.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
}

.kpi::after {
  position: absolute;
  inset: auto -30% -60% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 106, 0.08), transparent 70%);
  content: "";
  pointer-events: none;
}

.kpi p {
  margin: 0;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin: 7px 0 3px;
  font-family: var(--serif);
  font-size: clamp(19px, 5.6vw, 24px);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.kpi small {
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.4;
}

.kpi.is-danger {
  border-color: rgba(224, 121, 111, 0.32);
  background: linear-gradient(160deg, rgba(224, 121, 111, 0.10), #0f0d09 64%);
}

.kpi.is-danger strong {
  color: var(--red);
}

.kpi.is-warn {
  border-color: rgba(216, 176, 114, 0.3);
}

.kpi.is-warn strong {
  color: var(--amber);
}

.kpi.is-ok strong {
  color: var(--ok);
}

/* ------------------------------ PANELES ------------------------------ */

.panel {
  margin-bottom: 14px;
  padding: 15px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-note {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.03em;
}

/* ------------------------------ ALERTAS ------------------------------ */

.alerts {
  display: grid;
  gap: 8px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--muted-2);
  border-radius: 9px;
  background: var(--panel-2);
}

.alert b {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

.alert small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.alert.is-warning {
  border-left-color: var(--warn);
  background: linear-gradient(90deg, var(--warn-soft), #100e0a 60%);
}

.alert.is-danger {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, var(--danger-soft), #100e0a 60%);
}

.alert.is-info {
  border-left-color: var(--info);
  background: linear-gradient(90deg, var(--info-soft), #100e0a 60%);
}

.alert.is-ok {
  border-left-color: var(--ok);
  background: linear-gradient(90deg, var(--ok-soft), #100e0a 60%);
}

.alert-value {
  margin-left: auto;
  text-align: right;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.alert-value small {
  color: var(--muted-2);
}

/* ------------------------------ GRÁFICO ------------------------------ */

.chart {
  display: flex;
  height: 168px;
  align-items: flex-end;
  gap: 6px;
  padding-top: 18px;
}

.bar-col {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
}

.bar-value {
  color: var(--muted-2);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar-track {
  display: flex;
  width: 100%;
  max-width: 34px;
  flex: 1 1 auto;
  align-items: flex-end;
  border-radius: 6px;
  background: var(--line);
}

.bar-fill {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold-2), #96763f);
  box-shadow: 0 0 18px rgba(201, 168, 106, 0.12);
  transition: height 420ms cubic-bezier(0.22, 0.8, 0.3, 1);
}

.bar-col.is-today .bar-fill {
  background: linear-gradient(180deg, #f2dfb2, #c9a86a);
}

.bar-label {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bar-col.is-today .bar-label {
  color: var(--gold-2);
}

/* ------------------------------ LISTAS ------------------------------ */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.rank-list,
.stock-list,
.invoice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid #1c1913;
}

.rank-item:last-child {
  border-bottom: 0;
}

.rank-index {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.rank-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.rank-copy b {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-copy small {
  color: var(--muted-2);
  font-size: 10px;
}

.rank-total {
  flex: none;
  color: var(--gold-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.stock-item {
  padding: 9px 2px;
  border-bottom: 1px solid #1c1913;
}

.stock-item:last-child {
  border-bottom: 0;
}

.stock-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stock-top b {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-top span {
  flex: none;
  color: var(--warn);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stock-bar {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.stock-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a8625a, var(--warn));
}

.invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid #1c1913;
}

.invoice-item:last-child {
  border-bottom: 0;
}

.invoice-copy {
  min-width: 0;
}

.invoice-copy b {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.invoice-copy small {
  display: block;
  overflow: hidden;
  max-width: 58vw;
  color: var(--muted-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-right {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.invoice-total {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chip {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip.is-pagada,
.chip.is-activo {
  border-color: rgba(124, 199, 155, 0.32);
  color: var(--ok);
}

.chip.is-pendiente,
.chip.is-abonada,
.chip.is-por_facturar {
  border-color: rgba(216, 176, 114, 0.32);
  color: var(--warn);
}

.chip.is-anulada {
  border-color: rgba(224, 121, 111, 0.32);
  color: var(--danger);
}

.empty {
  margin: 0;
  padding: 18px 6px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.foot {
  margin: 8px 0 0;
  color: #6d6454;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-align: center;
}

/* ------------------------------ RESPONSIVE ------------------------------ */

@media (min-width: 640px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: 22px 22px 36px;
  }

  .panel {
    padding: 17px 18px;
  }

  .invoice-copy small {
    max-width: 34vw;
  }
}

@media (min-width: 1024px) {
  .kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .content {
    padding: 26px 28px 40px;
  }

  .topbar,
  .device-bar {
    padding-right: 28px;
    padding-left: 28px;
  }

  .auth {
    padding-top: 44px;
    padding-bottom: 44px;
  }
}

@media (max-width: 380px) {
  .live span {
    display: none;
  }

  .live {
    padding: 0 8px;
  }

  .stamp {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Equipos modestos: se apagan las capas que más repintan. */
html[data-perf="low"] {
  scroll-behavior: auto;
}

html[data-perf="low"] *,
html[data-perf="low"] *::before,
html[data-perf="low"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

html[data-perf="low"] .topbar {
  background: var(--bg);
}

html[data-perf="low"] .login-card,
html[data-perf="low"] .panel,
html[data-perf="low"] .kpi,
html[data-perf="low"] .content.is-updated {
  box-shadow: none;
  animation: none;
}

html[data-perf="low"] .live.is-on i {
  box-shadow: none;
}

.empty-wide {
  grid-column: 1 / -1;
  padding: 30px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}

/* Master remoto: inventario y ofertas */
.remote-help {
  margin: 0 0 12px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.remote-inventory {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.remote-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.remote-legend span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.3;
}

.remote-legend b { color: var(--gold-2); }

.remote-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.remote-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.remote-field > span {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.remote-field-time { min-width: 0; }

.remote-time {
  padding: 0 4px;
  font-size: 10.5px;
}

.remote-offer-status {
  color: var(--gold-2) !important;
  font-size: 8.5px !important;
  font-family: var(--font-mono, Consolas, monospace);
  white-space: nowrap;
}

.remote-offer-status:not(:empty) { margin-top: 2px; }

.remote-row-head {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  border-color: transparent;
  padding-top: 0;
  padding-bottom: 0;
}

.remote-name {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.remote-name b {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.remote-name small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.remote-input {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.remote-input:focus {
  border-color: var(--gold);
  outline: none;
}

.remote-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.remote-check input {
  accent-color: var(--gold);
  width: 15px;
  height: 15px;
}

.remote-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.btn-remote {
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--gold);
  border-radius: 9px;
  background: var(--gold);
  color: #191204;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-remote:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 720px) {
  .remote-row {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 0.6fr);
    gap: 6px;
  }
  .remote-row-head {
    display: none;
  }
  .remote-name {
    grid-column: 1 / -1;
  }
  .remote-check {
    grid-column: 1 / -1;
  }
}

.icon-btn.is-on {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 162, 77, 0.1);
}

/* Meser@s web */
.waiter-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.waiter-form input {
  flex: 1 1 160px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
}

.waiter-form input:focus {
  border-color: var(--gold);
  outline: none;
}

.waiter-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.waiter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}

.waiter-row b {
  font-size: 12px;
}

.waiter-row small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.waiter-remove {
  border: 0;
  background: transparent;
  color: var(--red, #e18b77);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* ============================ TEMA CLARO ============================ */
html[data-theme="light"] {
  --logo-gold: #a2761d;
  --bg: #f3ede1;
  --bg-2: #fffaf0;
  --bg-3: #f6efe2;
  --line: #d9cdb7;
  --line-soft: #e6dccb;
  --text: #241d12;
  --muted: #6f6453;
  --muted-2: #8b7f6b;
  --gold: #94701f;
  --gold-2: #7a5a15;
  --gold-soft: rgba(148, 112, 31, 0.12);
  color-scheme: light;
}

html[data-theme="light"] body,
html[data-theme="light"] .app,
html[data-theme="light"] .content,
html[data-theme="light"] .topbar,
html[data-theme="light"] .auth,
html[data-theme="light"] .boot {
  background: var(--bg) !important;
  color: var(--text);
}

html[data-theme="light"] .ambient {
  background: radial-gradient(900px 640px at 82% -12%, rgba(148, 112, 31, 0.10), transparent 62%), var(--bg) !important;
}

html[data-theme="light"] .panel,
html[data-theme="light"] .kpi,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .device-bar,
html[data-theme="light"] .alert,
html[data-theme="light"] .invoice-item,
html[data-theme="light"] .rank-item,
html[data-theme="light"] .stock-item,
html[data-theme="light"] .remote-row,
html[data-theme="light"] .waiter-row {
  background: var(--bg-2) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] .field input,
html[data-theme="light"] .remote-input,
html[data-theme="light"] .waiter-form input {
  background: #fffdf7 !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

html[data-theme="light"] .icon-btn {
  background: #fffdf7 !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

/* iPhone: evitar zoom por doble toque */
button, a, input, select, textarea {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
html, body { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
