:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --panel: #ffffff;
  --text: #162027;
  --muted: #65737d;
  --line: #dbe3e8;
  --accent: #0d6b5f;
  --accent-strong: #094f47;
  --warning: #a15c00;
  --danger: #b42318;
  --ok: #197a3e;
  --shadow: 0 16px 40px rgba(31, 45, 61, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

html.sidebar-collapsed-preload .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(37, 161, 142, 0.08), transparent 220px),
    #14212a;
  color: #f7fbfc;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 30px rgba(20, 33, 42, 0.08);
  transition: opacity 180ms ease, transform 180ms ease, padding 180ms ease;
}

body.sidebar-collapsed .sidebar {
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
}

html.sidebar-collapsed-preload .sidebar {
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2bb8a3, #0d6b5f);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(13, 107, 95, 0.28);
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: 0; }
.brand small { color: #9fb0ba; margin-top: 2px; }

.company-logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  vertical-align: middle;
  white-space: nowrap;
}

.company-logo strong {
  font-size: .95em;
  line-height: 1;
}

.company-mark {
  width: 28px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  box-shadow: inset 0 -1px rgba(0, 0, 0, .12);
}

.company-logo-edenred .company-mark {
  background: #e42313;
}

.company-logo-edenred strong {
  color: #c82015;
}

.company-logo-efectivale .company-mark {
  background: #f6a800;
  color: #24313a;
}

.company-logo-efectivale strong {
  color: #7a5200;
}

.company-logo-bbva .company-mark {
  background: #004481;
}

.company-logo-bbva strong {
  color: #004481;
}

.company-logo-santander .company-mark {
  background: #ec0000;
}

.company-logo-santander strong {
  color: #c90000;
}

.company-logo-amex .company-mark {
  background: #e5f4ff;
  color: #006fcf;
  border: 1px solid #b6def8;
}

.company-logo-amex strong {
  color: #006fcf;
}

.company-logo-atio .company-mark {
  width: 42px;
  background: #1f6f46;
}

.company-logo-atio strong {
  color: #1f6f46;
}

.company-logo-cfdi .company-mark {
  width: 38px;
  background: #394956;
}

.company-logo-cfdi strong {
  color: #394956;
}

.sidebar-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7e4ea;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-section {
  margin: 8px 8px 3px;
  color: #78909b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav a {
  color: #c8d5dc;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  font-weight: 700;
}
.nav a span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #9fb0ba;
  font-size: 12px;
  font-weight: 900;
}
.nav a.active, .nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}
.nav a.active span,
.nav a:hover span {
  color: #fff;
  background: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  color: #b9c6cd;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3bd671;
}

.main {
  padding: 28px;
  min-width: 0;
  max-width: 100vw;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar h1 { margin: 2px 0 0; font-size: 28px; letter-spacing: 0; }
.topbar-context {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}
.topbar-context span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-actions form { margin: 0; }

.menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  place-content: center;
  gap: 4px;
  cursor: pointer;
  flex: 0 0 auto;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.menu-toggle:hover {
  border-color: #b8c8d0;
  background: #fbfcfd;
}

.btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.btn:hover {
  background: var(--accent-strong);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--line);
}
.btn.secondary:hover {
  background: #f4faf8;
  border-color: #b7dcd4;
}
.btn:focus-visible,
.sidebar-close:focus-visible,
.menu-toggle:focus-visible,
input:focus,
select:focus {
  outline: 3px solid rgba(37, 161, 142, 0.22);
  outline-offset: 2px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .62;
  transform: none;
}

.compact-btn {
  min-height: 0;
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.action-cell {
  min-width: 88px;
  white-space: nowrap;
}

.link-button {
  border: 0;
  background: transparent;
  color: #d7e4ea;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(22, 32, 39, 0.04), rgba(22, 32, 39, 0.04)),
    linear-gradient(145deg, #edf2f5, #d6e2e7);
}

.login-shell {
  width: min(920px, calc(100vw - 32px));
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  overflow: hidden;
  min-height: 520px;
}

.login-visual {
  background: #18242c;
  color: #fff;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.login-copy span {
  color: #80d7cb;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.login-copy h1 {
  margin: 10px 0 0;
  max-width: 430px;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.login-stats div {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.login-stats strong,
.login-stats span {
  display: block;
}

.login-stats strong {
  font-size: 24px;
}

.login-stats span {
  color: #c3d0d7;
  margin-top: 4px;
  font-size: 13px;
}

.login-panel {
  padding: 34px;
  display: flex;
  align-items: center;
}

.login-brand {
  color: #fff;
}

.login-brand small {
  color: #aebcc5;
}

.login-form {
  display: grid;
  gap: 16px;
  width: 100%;
}

.login-form h2 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: 0;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.alert {
  border: 1px solid #f1c7c2;
  background: #fff3f1;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}
.alert.success {
  border-color: #b9e3c7;
  background: #eefaf2;
  color: var(--ok);
  margin-bottom: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.metric span, .metric small { color: var(--muted); display: block; }
.metric strong {
  display: block;
  font-size: 25px;
  margin: 8px 0 4px;
}
.metric.warning { border-left: 4px solid var(--warning); }

.day-control {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}

.day-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.day-hero h2 {
  margin: 4px 0;
  font-size: 26px;
}

.day-hero p {
  margin: 0;
  color: var(--muted);
}

.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: #e7f8ef;
  color: #08704f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.state-badge.sin_factura,
.state-badge.sin_pago,
.state-badge.diferencia,
.state-badge.falta_atio {
  background: #fff7ed;
  color: #9a3412;
}

.day-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.day-metrics article {
  padding: 14px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.day-metrics article:last-child {
  border-right: 0;
}

.day-metrics article.attention {
  background: #fff9ed;
}

.day-metrics span,
.day-metrics small {
  display: block;
  color: var(--muted);
}

.day-metrics span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-metrics strong,
.day-metrics a {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.day-metrics a:hover {
  color: var(--accent-strong);
}

.shift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.shift-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.shift-card.is-attention {
  background: #fffaf2;
  border-color: #f0d4a3;
}

.shift-card.shift-cerrado {
  background: #f4fbf7;
  border-color: #b9e3c7;
}

.shift-card.shift-sin_movimiento {
  background: #f7fafb;
}

.shift-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.shift-card header strong,
.shift-card header span {
  display: block;
}

.shift-card header a {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.shift-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.shift-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shift-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin: 12px 0 0;
}

.shift-card dt {
  color: var(--muted);
  font-weight: 800;
}

.shift-card dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
}

.shift-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.shift-issues span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.closure-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.closure-panel h2 {
  margin: 5px 0;
  font-size: 24px;
}

.closure-panel p {
  margin: 0;
  color: var(--muted);
}

.closure-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.closure-checks span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.closure-checks .is-ok {
  background: #e8f7ee;
  color: var(--ok);
}

.closure-checks .is-warn {
  background: #fff4df;
  color: var(--warning);
}

.invoice-stack {
  align-items: flex-start;
}

.invoice-stack-values {
  text-align: right;
  white-space: nowrap;
}

.invoice-stack-values small {
  color: var(--muted);
}

.ops-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 18px;
  margin-bottom: 18px;
}

.day-action-list {
  display: grid;
  gap: 9px;
}

.day-action {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.day-action strong {
  font-size: 14px;
}

.day-action span {
  color: var(--muted);
  font-size: 12px;
}

.day-action.diferencia,
.day-action.turno {
  border-color: #f0d4a3;
  background: #fffaf2;
}

.day-action.factura,
.day-action.pago {
  border-color: #b7dcd4;
  background: #f2fbf8;
}

.transaction-control {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.selected-company-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.selected-company-strip > span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.transaction-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.transaction-summary article {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.transaction-summary article:last-child {
  border-right: 0;
}

.transaction-summary article.attention {
  background: #fff8eb;
}

.transaction-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.transaction-summary strong,
.transaction-summary a {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

.transaction-summary small {
  color: var(--muted);
}

.transaction-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.transaction-breakdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .45fr);
  gap: 18px;
  margin-bottom: 18px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.transaction-table small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.ok-text {
  color: var(--ok);
  font-weight: 800;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.report-card {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-card h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 7px 0 8px;
}

.report-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.config-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.config-hero article,
.config-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.config-hero article {
  padding: 16px;
}

.config-hero span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.config-hero strong {
  display: block;
  margin-top: 7px;
  font-size: 28px;
}

.config-hero small {
  color: var(--muted);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.config-card {
  padding: 18px;
}

.config-card h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 7px 0 8px;
}

.config-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.config-card dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.config-card dt {
  color: var(--muted);
  font-weight: 900;
}

.config-card dd {
  margin: 0;
}

.config-table td {
  vertical-align: top;
}

.config-table small {
  display: block;
  margin-top: 4px;
}

.diagnostic-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(13, 107, 95, 0.08), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.diagnostic-hero.needs-review {
  background:
    linear-gradient(135deg, rgba(161, 92, 0, 0.12), rgba(255, 255, 255, 0)),
    var(--panel);
}

.diagnostic-hero h2 {
  margin: 6px 0;
  font-size: 28px;
}

.diagnostic-hero p {
  margin: 0;
  color: var(--muted);
}

.diagnostic-score {
  min-width: 126px;
  text-align: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.diagnostic-score strong,
.diagnostic-score span {
  display: block;
}

.diagnostic-score strong {
  color: var(--accent-strong);
  font-size: 30px;
}

.diagnostic-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.diagnostic-metrics article.attention {
  background: #fff8eb;
  border-color: #f0d4a3;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.diagnostic-card {
  min-width: 0;
}

.diagnostic-details {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}

.diagnostic-details dt {
  color: var(--muted);
  font-weight: 900;
}

.diagnostic-details dd {
  margin: 0;
  min-width: 0;
  font-weight: 800;
}

.diagnostic-list {
  display: grid;
  gap: 9px;
}

.diagnostic-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.diagnostic-item:hover {
  border-color: #b7dcd4;
  background: #f4fbf8;
  text-decoration: none;
}

.diagnostic-item strong,
.diagnostic-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.diagnostic-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-control {
  margin-bottom: 18px;
}

.invoice-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.invoice-actions form {
  margin: 0;
}

.inline-station-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  min-width: 220px;
}

.inline-station-form select {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 34px;
  min-width: 150px;
  padding: 6px 8px;
}

.invoice-file {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}

.invoice-file-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.invoice-file-head h2 {
  margin: 6px 0;
  font-size: 34px;
  line-height: 1;
}

.invoice-file-head p {
  margin: 0;
  color: var(--muted);
}

.invoice-file-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-file-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.invoice-file-metrics article {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.invoice-file-metrics article:last-child {
  border-right: 0;
}

.invoice-file-metrics article.attention {
  background: #fff8eb;
}

.invoice-file-metrics span,
.invoice-scope > article > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.invoice-file-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.invoice-file-metrics small {
  color: var(--muted);
}

.invoice-file-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 18px;
  margin-bottom: 18px;
}

.invoice-scope {
  display: grid;
  gap: 20px;
}

.scope-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 10px 8px 0 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--brand-dark);
  font-weight: 800;
}

.scope-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.scope-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.scope-list div:last-child {
  border-bottom: 0;
}

.scope-list strong,
.scope-list small {
  min-width: 0;
}

.scope-list small {
  color: var(--muted);
  white-space: nowrap;
}

.pending-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pending-list {
  display: grid;
  gap: 8px;
}

.pending-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.pending-item:hover {
  border-color: #b8c8d0;
  background: #f7fafb;
  text-decoration: none;
}

.pending-item strong,
.pending-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pending-item small {
  color: var(--muted);
  margin-top: 3px;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.suggestion-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.suggestion-card:hover {
  border-color: #b8c8d0;
  background: #f7fafb;
  text-decoration: none;
}

.suggestion-card strong,
.suggestion-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.suggestion-card small {
  color: var(--muted);
}

.suggestion-card.subir_factura {
  border-left: 4px solid var(--warning);
}

.suggestion-card.revisar_diferencia {
  border-left: 4px solid var(--danger);
}

.suggestion-card.marcar_pago {
  border-left: 4px solid var(--ok);
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.invoice-preview {
  width: min(980px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.invoice-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.invoice-preview-head h2 {
  margin: 5px 0;
  font-size: 28px;
}

.invoice-preview-head p {
  margin: 0;
  color: var(--muted);
}

.invoice-preview-status {
  text-align: right;
}

.invoice-preview-status strong,
.invoice-preview-status span {
  display: block;
}

.invoice-preview-status strong {
  font-size: 18px;
}

.invoice-preview-status span {
  color: var(--muted);
  margin-top: 4px;
}

.invoice-preview-parties,
.invoice-preview-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.invoice-preview-totals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-preview-parties article,
.invoice-preview-totals article {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.invoice-preview-parties article:last-child,
.invoice-preview-totals article:last-child {
  border-right: 0;
}

.invoice-preview-parties span,
.invoice-preview-totals span,
.invoice-preview-totals small {
  color: var(--muted);
  display: block;
}

.invoice-preview-parties span,
.invoice-preview-totals span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-preview-parties strong,
.invoice-preview-totals strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.invoice-preview-parties p {
  color: var(--muted);
  margin: 4px 0 0;
}

.invoice-preview-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.invoice-preview-section:last-child {
  border-bottom: 0;
}

.invoice-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.invoice-section-title h3 {
  margin: 0;
}

.invoice-section-title span,
.invoice-preview-note {
  color: var(--muted);
}

.invoice-preview-note {
  margin: 10px 0 0;
  font-size: 13px;
}

.dashboard-code-alert {
  align-items: center;
  background: #fff8eb;
  border: 1px solid #f0d4a3;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  color: #6b3d00;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1fr) auto;
  margin-bottom: 18px;
  padding: 14px;
}

.dashboard-code-alert strong,
.dashboard-code-alert span {
  display: block;
}

.dashboard-code-alert > div > span,
.dashboard-code-alert-list span {
  color: #7a5b2a;
  font-size: 12px;
}

.dashboard-code-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.dashboard-code-alert-list span {
  background: #fff;
  border: 1px solid #efd7aa;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}

.ops-toolbar {
  display: grid;
  grid-template-columns: 170px minmax(180px, 1fr) minmax(180px, 1fr) 140px 140px auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.ops-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ops-title {
  display: grid;
  gap: 4px;
  align-self: center;
}

.ops-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.ops-title .company-logo {
  color: var(--text);
}

.ops-title strong {
  font-size: 18px;
}

.ops-actions {
  display: flex;
  gap: 8px;
}

.ops-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.ops-metrics article {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.ops-metrics article:last-child {
  border-right: 0;
}

.ops-metrics span,
.ops-metrics small {
  color: var(--muted);
  display: block;
}

.ops-metrics span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ops-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  white-space: nowrap;
}

.ops-metrics .is-warning {
  background: #fff9ed;
}

.ops-metrics .is-danger {
  background: #fff3f1;
}

.ops-alert-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.ops-alert-strip a,
.ops-all-good {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  white-space: nowrap;
  text-decoration: none;
}

.ops-alert-strip a:hover {
  border-color: var(--accent);
}

.ops-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 8px;
}

.ops-table-head h2 {
  margin: 0;
  font-size: 18px;
}

.ops-table-head span {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.ops-table th,
.ops-table td {
  white-space: nowrap;
}

.ops-support {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.compact-panel {
  padding: 14px;
}

.mini-summary-grid {
  display: grid;
  gap: 8px;
}

.mini-summary-grid article,
.compact-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 9px 10px;
}

.mini-summary-grid article {
  display: grid;
}

.mini-summary-grid span,
.mini-summary-grid small {
  color: var(--muted);
}

.mini-summary-grid strong {
  font-size: 18px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list a {
  color: var(--text);
  text-decoration: none;
}

.compact-list a:hover {
  border-color: var(--accent);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel, .upload-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-foot {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.panel h2, .upload-panel h2 { margin: 0; font-size: 18px; }
.panel-head span, .upload-panel p { color: var(--muted); }

.upload-console {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.upload-menu {
  position: sticky;
  top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.menu-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px 8px;
}

.upload-menu a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 9px;
  font-weight: 800;
}

.upload-menu a:hover {
  background: var(--surface-2);
  color: var(--accent-strong);
}

.upload-menu small {
  color: var(--muted);
  font-weight: 800;
}

.upload-workspace {
  display: grid;
  gap: 14px;
}

.unified-upload-page {
  max-width: 1120px;
}

.upload-intro,
.upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-intro {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.upload-intro strong,
.upload-intro span {
  display: block;
}

.upload-intro span {
  color: var(--muted);
  margin-top: 3px;
}

.upload-history-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.history-strip-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.history-strip-head strong,
.history-strip-head span {
  display: block;
}

.history-strip-head span {
  color: var(--muted);
  margin-top: 3px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.history-item strong,
.history-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-item small {
  color: var(--muted);
  margin-top: 2px;
}

.history-kind {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-numbers {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.history-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.history-status.ok {
  background: #e7f8ef;
  color: #08704f;
}

.history-status.warn {
  background: #fff7ed;
  color: #9a3412;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.upload-card {
  scroll-margin-top: 18px;
  overflow: hidden;
}

.upload-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.upload-card-head h2 {
  margin: 4px 0;
  font-size: 20px;
}

.upload-card-head p {
  margin: 0;
  color: var(--muted);
}

.upload-type {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.upload-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(260px, 1fr);
  gap: 16px;
  padding: 16px;
}

.unified-upload-body {
  grid-template-columns: minmax(280px, 0.6fr) minmax(320px, 1fr);
}

.upload-fields {
  display: grid;
  gap: 12px;
  align-content: start;
}

.upload-fields .field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.file-drop {
  display: grid;
  gap: 4px;
  border: 1px dashed #9bb4bf;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  cursor: pointer;
}

.file-drop input {
  padding: 0;
  border: 0;
  background: transparent;
}

.file-drop strong {
  font-size: 16px;
}

.file-drop span {
  color: var(--muted);
}

.unified-format {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.unified-format h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.upload-card > .upload-result {
  margin: 0 16px 16px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.tabs a {
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.tabs a.active,
.tabs a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
}
.subtabs a {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.subtabs a.active,
.subtabs a:hover {
  color: var(--accent-strong);
  background: #e1f4ef;
  border-color: #9bd5c9;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 24px;
}
th.sortable::after {
  content: "^";
  position: absolute;
  right: 8px;
  color: #9aa8b1;
  font-size: 11px;
}
th.sortable.sort-asc,
th.sortable.sort-desc {
  color: var(--accent-strong);
  background: #eef8f5;
}
th.sortable.sort-asc::after { content: "^"; color: var(--accent); }
th.sortable.sort-desc::after { content: "v"; color: var(--accent); }
th.sortable:focus {
  outline: 2px solid #9bd5c9;
  outline-offset: -2px;
}
.num { text-align: right; }
.muted { color: var(--muted); }
.muted-cell {
  color: var(--muted);
  max-width: 260px;
  overflow-wrap: anywhere;
}
.danger { color: var(--danger); font-weight: 700; }
.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px;
  background: linear-gradient(180deg, #fbfcfd, #f7fafb);
  border-radius: 8px;
}
.affiliate-cell {
  max-width: 260px;
  white-space: normal;
}

.atio-report-table td small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.section-subtitle {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  margin: 0 0 10px;
}

.atio-report-table tfoot th {
  background: #eef8f5;
  border-top: 2px solid #9bd5c9;
  color: var(--text);
  font-weight: 900;
}

.excel-copy-panel {
  border-color: #bfd8d2;
}

.excel-copy-table {
  font-size: 12px;
}

.excel-copy-table th,
.excel-copy-table td {
  cursor: cell;
  padding: 7px 9px;
  text-transform: none;
  user-select: none;
}

.excel-copy-table th {
  color: var(--text);
  font-weight: 900;
}

.excel-copy-table .excel-cell-selected {
  background: #d9f5ed;
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--text);
}

.button-row.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.pill.ok { color: var(--ok); background: #e8f7ee; }
.pill.warn { color: var(--warning); background: #fff4df; }
.pill.muted { color: var(--muted); background: #edf2f5; }
.pill-action {
  border: 0;
  cursor: pointer;
}
.pill-action:hover { filter: brightness(0.97); }

.desabasto-metrics article.danger-soft {
  background: #fff1f0;
}

.desabasto-metrics article.warn-soft {
  background: #fff8e6;
}

.desabasto-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.desabasto-pill-ok {
  background: #e8f7ee;
  color: #047857;
}

.desabasto-pill-riesgo {
  background: #fff4df;
  color: #b45309;
}

.desabasto-pill-critico {
  background: #fee2e2;
  color: #b91c1c;
}

.desabasto-row.desabasto-critico td {
  background: #fffafa;
}

.desabasto-row.desabasto-riesgo td {
  background: #fffdf7;
}

.desabasto-days {
  color: var(--text);
  font-weight: 900;
}

.desabasto-row.desabasto-critico .desabasto-days {
  color: #b91c1c;
}

.desabasto-row.desabasto-riesgo .desabasto-days {
  color: #b45309;
}

.stack-list { display: grid; gap: 10px; }
.stack-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.stack-item span { display: block; color: var(--muted); margin-top: 3px; }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.upload-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}
.upload-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.upload-title-row > div {
  min-width: 0;
}
.upload-title-row h2,
.upload-title-row p {
  overflow-wrap: anywhere;
}
.mini-upload-brand {
  margin-bottom: 8px;
}
.optional-upload {
  border-style: dashed;
  box-shadow: none;
}
.format-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px 12px;
}
.format-help summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
}
.format-help ul {
  margin: 10px 0;
  padding-left: 18px;
  color: var(--muted);
}
.format-help li {
  margin: 4px 0;
}
.format-help pre {
  max-height: 220px;
  overflow: auto;
  background: #111c22;
  color: #d8f3e7;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.check input { width: auto; }
.result {
  min-height: 86px;
  max-height: none;
  overflow: visible;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  white-space: normal;
}
.upload-result {
  display: grid;
  gap: 10px;
}
.upload-result.loading,
.upload-result.warning {
  color: var(--warning);
  background: #fff8ec;
  border-color: #f1d2a1;
}
.upload-result.error {
  color: var(--danger);
  background: #fff3f1;
  border-color: #f1c7c2;
}
.upload-result.success {
  background: #f7fbf9;
  border-color: #cfe8dc;
}
.upload-status {
  font-weight: 800;
}
.upload-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.upload-result-head strong {
  color: var(--text);
  font-size: 15px;
}
.upload-result-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.upload-error {
  color: var(--danger);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.upload-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.upload-summary-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}
.upload-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.upload-summary-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
}
.upload-history-control {
  margin-bottom: 18px;
}
.upload-history-table td {
  vertical-align: top;
}
.upload-history-table tr.needs-review,
tr.needs-review {
  background: #fffaf2;
}
.upload-history-table small {
  display: block;
  margin-top: 4px;
}
.upload-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.upload-insight-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.upload-insight-grid article.attention {
  background: #fff8eb;
  border-color: #f0d4a3;
}
.upload-insight-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.upload-insight-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}
.upload-insight-grid small {
  color: var(--muted);
}
.upload-detail-section,
.upload-json {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}
.upload-detail-section summary,
.upload-json summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
}
.upload-detail-section table {
  margin-top: 8px;
  font-size: 12px;
}
.upload-detail-section th,
.upload-detail-section td {
  padding: 7px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.upload-json pre {
  max-height: 260px;
  overflow: auto;
  background: #111c22;
  color: #d8f3e7;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inline-json {
  max-width: 520px;
  max-height: 160px;
  overflow: auto;
  margin: 0;
  background: #111c22;
  color: #d8f3e7;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.audit-control {
  margin-bottom: 18px;
}
.audit-table td {
  vertical-align: top;
}
.audit-table td:nth-child(6) {
  min-width: 260px;
}
.audit-action {
  background: #eef7f5;
  color: #006b5f;
}
.audit-details summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
  list-style: none;
}
.audit-details summary::-webkit-details-marker {
  display: none;
}
.audit-details summary::after {
  content: "+";
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
}
.audit-details[open] summary::after {
  content: "-";
}
.xml-box summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 10px;
}
.xml-box pre {
  max-height: 420px;
  overflow: auto;
  background: #111c22;
  color: #d8f3e7;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 180px 180px auto;
  gap: 10px;
  margin-bottom: 18px;
}
.transaction-filters {
  grid-template-columns: minmax(240px, 1fr) 150px 150px 140px 180px 160px auto;
  align-items: end;
}
.invoice-filters {
  grid-template-columns: minmax(280px, 1fr) 180px 180px auto;
  align-items: end;
}
.audit-filters {
  grid-template-columns: minmax(260px, 1fr) 210px 180px auto;
  align-items: end;
}
.upload-history-filters {
  grid-template-columns: minmax(260px, 1fr) 210px 180px minmax(190px, .8fr) 150px 150px auto;
  align-items: end;
}
.report-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 160px 160px auto;
  align-items: end;
}
.atio-report-filters {
  grid-template-columns: minmax(280px, 1fr) 130px 150px 180px 180px max-content;
}
.atio-report-filters .station-picker-field {
  grid-column: 1 / -1;
  min-width: 320px;
}
.atio-cortes-filters {
  grid-template-columns: minmax(280px, 1fr) 130px 180px 180px max-content;
}
.atio-mermas-filters {
  grid-template-columns: minmax(280px, 1fr) 140px 120px 160px 160px max-content max-content max-content;
}
.atio-report-filters .filter-actions {
  flex-wrap: wrap;
}
.atio-cortes-filters .filter-actions {
  flex-wrap: wrap;
}
.atio-mermas-filters .filter-actions {
  flex-wrap: wrap;
}
.check-field {
  align-self: end;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}
.check-field input {
  width: 16px;
  height: 16px;
}
.atio-message-cell {
  max-width: 360px;
  white-space: normal;
}
.atio-difference-cell {
  font-size: 16px;
  font-weight: 900;
}
.atio-summary-row.has-difference .atio-difference-cell {
  color: var(--danger);
}
.atio-mermas-table tr.has-difference .atio-difference-cell {
  color: var(--danger);
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.field.wide {
  min-width: 0;
}
.station-picker {
  position: relative;
  background: #fff;
  border: 1px solid #cfdde4;
  border-radius: 8px;
  display: grid;
  min-height: 42px;
}
.station-picker-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
}
.station-picker-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.station-picker-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  margin-top: 3px;
}
.station-picker-head small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
.station-picker-open {
  background: #eef7f6;
  border: 1px solid #c4dddb;
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
  font-weight: 900;
  padding: 8px 12px;
}
.station-picker-panel {
  background: #fff;
  border: 1px solid #bfd8d6;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(22, 37, 44, 0.18);
  display: grid;
  gap: 12px;
  left: 0;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
}
.station-picker-panel[hidden] {
  display: none;
}
.station-picker-panel-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.station-picker-panel-head strong {
  font-size: 15px;
}
.station-picker-panel-head button {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
}
.station-picker-actions {
  display: flex;
  gap: 8px;
}
.station-picker-actions button {
  background: #eef6f6;
  border: 1px solid #cfe2e2;
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 10px;
}
.station-picker-search {
  width: 100%;
  border-color: #b9d7d6;
  box-shadow: 0 0 0 3px rgba(0, 120, 110, 0.08);
}
.station-picker-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}
.station-picker-option {
  align-items: flex-start;
  background: var(--card);
  border: 1px solid #d7e2e7;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.station-picker-option:hover {
  background: #f7fbfb;
  border-color: #aacdcc;
}
.station-picker-option:has(input:checked) {
  background: #e4f5f3;
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent), 0 0 0 2px rgba(0, 120, 110, 0.10);
}
.station-picker-option input {
  accent-color: var(--accent);
  height: 18px;
  margin-top: 2px;
  width: 18px;
}
.station-picker-option strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}
.station-picker-option small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.25;
  margin-top: 2px;
}
.station-picker-option-all {
  background: #eef7f6;
  border-color: #b9d7d6;
  grid-column: 1 / -1;
}
.station-picker-panel-footer {
  display: flex;
  justify-content: flex-end;
}
.station-progress-item {
  align-items: center;
}
.station-progress-item .desabasto-pill {
  flex: 0 0 auto;
}
.affiliates-field {
  grid-column: 1 / -2;
}
.affiliates-field select {
  min-height: 148px;
}
.pending-check {
  align-self: center;
  grid-column: 1 / -2;
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.details {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}
.details dt { color: var(--muted); font-weight: 700; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
}

.admin-form label,
.user-admin-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-form .wide {
  grid-column: 1 / -1;
}

.role-form {
  display: grid;
  grid-template-columns: minmax(180px, .35fr) minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.role-form label,
.role-admin-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-form .wide {
  min-width: 0;
}

.permission-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.automation-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(360px, 1.1fr) minmax(280px, 0.9fr);
  margin-bottom: 18px;
}

.automation-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.automation-head {
  align-items: center;
  display: flex;
  gap: 12px;
}

.automation-head > div,
.secondary-panel {
  color: var(--muted);
}

.automation-head strong,
.secondary-panel strong {
  color: var(--text);
  display: block;
  font-size: 16px;
}

.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field.is-disabled {
  opacity: 0.45;
}

.field.is-disabled input,
.field.is-disabled select {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

.automation-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.automation-note.automation-warning {
  background: #fff8eb;
  border: 1px solid #f0d4a3;
  border-radius: 8px;
  color: #6b3d00;
  padding: 10px 12px;
}

.inline-message {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #065f46;
  padding: 10px 12px;
}

.code-required-panel {
  background: #fff8eb;
  border: 1px solid #f0d4a3;
  border-radius: 10px;
  color: #6b3d00;
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
}

.code-required-panel > strong,
.code-required-panel > span {
  display: block;
}

.code-required-panel > span,
.code-required-list small {
  color: #7a5b2a;
  font-size: 12px;
}

.code-required-list {
  display: grid;
  gap: 8px;
}

.code-required-list article {
  align-items: center;
  background: #fff;
  border: 1px solid #efd7aa;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.code-required-list article div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.code-required-list article strong,
.code-required-list article span,
.code-required-list article small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.automation-alert {
  align-items: flex-start;
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  color: #065f46;
  display: grid;
  gap: 2px;
  min-width: 260px;
  padding: 12px 14px;
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 50;
}

.automation-alert[hidden] {
  display: none;
}

.automation-alert strong,
.automation-alert span {
  display: block;
}

.automation-alert span {
  font-size: 13px;
}

.automation-alert.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.automation-alert.needs-code {
  background: #fff8eb;
  border-color: #f0d4a3;
  color: #6b3d00;
}

.automation-alert form {
  margin-top: 6px;
}

.code-submit-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.code-submit-form input {
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  min-height: 34px;
  padding: 0 10px;
  width: 150px;
}

.code-submit-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 124, 103, 0.14);
  outline: none;
}

.code-submit-form .trust-device-option {
  align-items: flex-start;
  display: flex;
  flex: 1 1 100%;
  gap: 8px;
  line-height: 1.4;
  max-width: 420px;
}

.code-submit-form .trust-device-option input {
  flex: 0 0 auto;
  min-height: 0;
  margin: 3px 0 0;
  padding: 0;
  width: auto;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.table-card-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 18px;
}

.table-card-head h2 {
  font-size: 18px;
  margin: 0;
}

.table-card-head span {
  color: var(--muted);
  font-size: 13px;
}

.table-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.table-card-actions form {
  margin: 0;
}

.table-scroll {
  max-width: 100%;
  overflow: auto;
}

.data-table {
  min-width: 1080px;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  white-space: normal;
}

.data-table .message-col,
.data-table .message-cell {
  width: 360px;
}

.message-cell {
  color: #42525c;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.automation-capture-link {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.automation-monitor {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1px 8px;
  grid-template-columns: auto auto;
  justify-content: start;
  padding: 8px 10px;
}

.automation-monitor strong {
  color: var(--text);
  font-size: 12px;
}

.automation-monitor small {
  color: var(--muted);
  font-size: 11px;
  grid-column: 2;
}

.monitor-dot {
  background: #94a3b8;
  border-radius: 999px;
  display: inline-block;
  grid-row: span 2;
  height: 9px;
  width: 9px;
}

.automation-monitor[data-state="running"] .monitor-dot {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.automation-monitor[data-state="idle"] .monitor-dot {
  background: #94a3b8;
}

.automation-monitor[data-state="queued"] .monitor-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.automation-monitor[data-state="error"] .monitor-dot {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.data-table tr.is-working td {
  background: #f8fbff;
}

.data-table tr.is-working td:first-child {
  box-shadow: inset 3px 0 0 #2563eb;
}

.status-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.status-procesado,
.status-correo_descargado {
  background: #ecfdf5;
  color: #047857;
}

.status-pendiente,
.status-solicitando,
.status-esperando_correo,
.status-procesando {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-requiere_codigo,
.status-codigo_expirado {
  background: #fff7ed;
  color: #9a3412;
}

.status-cancelado {
  background: #f1f5f9;
  color: #475569;
}

.status-error,
.status-error_proceso,
.status-sin_correo,
.status-sin_archivos {
  background: #fef2f2;
  color: #b91c1c;
}

.automation-status-grid {
  display: grid;
  gap: 10px;
}

.automation-status-grid article {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.automation-status-grid span,
.automation-status-grid small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.automation-status-grid strong {
  color: var(--text);
  display: block;
  font-size: 18px;
  margin: 3px 0;
}

.schedule-list {
  display: grid;
  gap: 14px;
}

.schedule-group {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.schedule-group header {
  align-items: flex-start;
  background: #eef3f6;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.schedule-group header strong {
  color: var(--text);
  font-size: 14px;
}

.schedule-group header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-group-items {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.schedule-list article {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(190px, 1fr) minmax(240px, 0.85fr) auto;
  padding: 12px;
}

.schedule-card {
  min-width: 0;
}

.schedule-card form {
  flex: 0 0 auto;
  margin: 0;
}

.schedule-card.is-paused {
  opacity: 0.72;
}

.schedule-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.schedule-title {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.schedule-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-meta,
.schedule-timing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.schedule-meta span,
.schedule-timing span {
  background: #eef3f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #42525c;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-dates {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.schedule-dates span {
  align-items: flex-start;
  border: 1px solid var(--line);
  color: #42525c;
  background: #f8fafc;
  border-radius: 7px;
  display: grid;
  font-size: 11px;
  font-weight: 800;
  gap: 2px;
  min-height: 38px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 7px 9px;
}

.schedule-dates strong {
  color: var(--muted);
  display: block;
  font-size: 10px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.schedule-list small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.mix-report {
  background: #071711;
  border: 1px solid #1d3a2f;
  border-radius: 8px;
  color: #eef7f2;
  margin-bottom: 18px;
  overflow: hidden;
}

.mix-report-head {
  align-items: flex-start;
  border-bottom: 1px solid rgba(224, 242, 232, 0.7);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px;
}

.mix-report-head h2 {
  font-size: 22px;
  margin: 0 0 6px;
}

.mix-report-head p,
.mix-card header span,
.mix-card-foot,
.mix-summary small {
  color: #9db5ac;
}

.mix-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
  min-width: 320px;
}

.mix-legend span {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.mix-dot {
  border-radius: 3px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.mix-dot.efectivo,
.mix-stack .efectivo {
  background: #47bea4;
}

.mix-dot.morralla,
.mix-stack .morralla {
  background: #92aaa3;
}

.mix-dot.xdebito,
.mix-stack .xdebito {
  background: #dfbc63;
}

.mix-dot.vales,
.mix-stack .vales_tarjetas {
  background: #70a3e1;
}

.mix-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mix-summary article {
  border-bottom: 1px solid #1d3a2f;
  border-right: 1px solid #1d3a2f;
  padding: 14px 18px;
}

.mix-summary span,
.mix-card-foot span {
  display: block;
}

.mix-summary strong {
  display: block;
  font-size: 21px;
  margin-top: 6px;
}

.mix-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  padding: 18px;
}

.mix-card {
  background: #0b2118;
  border: 1px solid #234239;
  border-radius: 8px;
  overflow: hidden;
}

.mix-card header {
  align-items: flex-start;
  border-bottom: 1px solid #1d3a2f;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 15px 17px 10px;
}

.mix-card h3 {
  color: #f5fbf7;
  font-size: 20px;
  margin: 0 0 4px;
}

.mix-card header strong {
  color: #a8beb6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.mix-bars {
  align-items: end;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(var(--day-count), 22px);
  min-height: 124px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 16px 16px 10px;
  scrollbar-color: #33584c #0b2118;
  scrollbar-width: thin;
}

.mix-bars::-webkit-scrollbar {
  height: 8px;
}

.mix-bars::-webkit-scrollbar-track {
  background: #0b2118;
}

.mix-bars::-webkit-scrollbar-thumb {
  background: #33584c;
  border-radius: 999px;
}

.mix-day {
  align-self: end;
  min-width: 22px;
  position: relative;
}

.mix-stack {
  background: #17342b;
  border: 1px solid transparent;
  border-radius: 4px;
  display: flex;
  flex-direction: column-reverse;
  height: 82px;
  overflow: hidden;
}

.mix-stack span {
  display: block;
  min-height: 1px;
}

.mix-day.mix-status-atipico_fuerte .mix-stack {
  border-color: #ff6b5c;
  box-shadow: 0 0 0 1px #ff6b5c;
}

.mix-day.mix-status-atipico_leve .mix-stack {
  border-color: #f2c15b;
  box-shadow: 0 0 0 1px #f2c15b;
}

.mix-day.mix-status-morralla_alta .mix-stack {
  border-color: #f08a4b;
  box-shadow: 0 0 0 1px #f08a4b;
}

.mix-day.mix-status-xdebito_alto .mix-stack {
  border-color: #b58cff;
  box-shadow: 0 0 0 1px #b58cff;
}

.mix-day.mix-empty-day .mix-stack {
  background: #25483e !important;
  border: 0 !important;
  border-radius: 2px;
  box-shadow: none !important;
  height: 4px;
  margin-top: 78px;
  opacity: 0.8;
}

.mix-day-label {
  color: #8cb1a5;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  margin-top: 6px;
  text-align: center;
}

.mix-day.atypical .mix-day-label {
  color: #f2c15b;
  font-weight: 900;
}

.mix-day.mix-status-atipico_fuerte .mix-day-label {
  color: #ff7668;
}

.mix-card-foot {
  border-top: 1px solid #1d3a2f;
  display: grid;
  font-size: 12px;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 11px 16px 14px;
}

@media (max-width: 1180px) {
  .mix-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .dashboard-code-alert {
    grid-template-columns: 1fr;
  }

  .dashboard-code-alert .btn {
    justify-self: stretch;
    width: 100%;
  }

  .schedule-list article {
    grid-template-columns: 1fr;
  }

  .code-required-list article {
    grid-template-columns: 1fr;
  }

  .code-required-list form,
  .schedule-card form {
    justify-self: stretch;
  }

  .code-required-list .compact-btn,
  .schedule-card .compact-btn {
    width: 100%;
  }
}

.permission-checks.wide {
  grid-column: 1 / -2;
}

.permission-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.permission-group strong {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
}

.permission-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.permission-checks input {
  width: auto;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  text-transform: none !important;
}

.check-row input {
  width: auto;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.user-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.user-admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.role-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.role-admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.role-admin-card header {
  display: grid;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.role-admin-card header strong,
.role-admin-card header span {
  display: block;
}

.role-admin-card header span {
  color: var(--muted);
  margin-top: 3px;
  font-size: 12px;
}

.user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-checks {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.station-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.atio-payment-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 100px repeat(3, minmax(160px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.station-form label,
.atio-payment-form label,
.station-admin-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.station-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}

.station-admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.station-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.atio-payment-table input,
.atio-payment-table select {
  min-width: 150px;
}

.atio-payment-table td:nth-child(2) {
  font-weight: 900;
  color: var(--accent);
}

.compact-check {
  min-width: 92px;
  color: var(--text);
  text-transform: none;
  font-size: 13px;
}

.station-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.station-overview-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.station-overview-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.station-overview-card header strong,
.station-overview-card header span {
  display: block;
}

.station-overview-card header span {
  color: var(--muted);
  margin-top: 3px;
}

.station-provider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.station-provider-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.station-provider-tags span.is-on {
  color: var(--ok);
  background: #e8f7ee;
  border-color: #b9e3c7;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 16px;
  align-items: start;
}

.portal-credential-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.portal-credential-form label,
.portal-credential-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-credential-form .wide,
.portal-credential-card .wide {
  grid-column: span 2;
}

.portal-credential-list {
  display: grid;
  gap: 14px;
}

.portal-credential-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.portal-credential-card header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.portal-credential-card header strong,
.portal-credential-card header span {
  display: block;
}

.portal-credential-card header span {
  color: var(--muted);
  margin-top: 5px;
  font-size: 12px;
  font-weight: 800;
}

.portal-matrix {
  display: grid;
  gap: 10px;
}

.portal-matrix-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.portal-matrix-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portal-matrix-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
}

.portal-matrix-row span.is-on {
  color: var(--ok);
  background: #e8f7ee;
  border-color: #b9e3c7;
}

.role-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-permissions span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.role-permissions span.is-on {
  color: var(--ok);
  background: #e8f7ee;
  border-color: #b9e3c7;
}

.station-overview-card dl {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
}

.station-overview-card dt {
  color: var(--muted);
  font-weight: 800;
}

.station-overview-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.station-card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .mix-report-head {
    flex-direction: column;
  }

  .mix-legend {
    justify-content: flex-start;
    min-width: 0;
  }

  .mix-summary,
  .mix-grid {
    grid-template-columns: 1fr;
  }

  .mix-card-foot {
    grid-template-columns: 1fr;
  }

  .app-shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .app-shell,
  html.sidebar-collapsed-preload .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(288px, calc(100vw - 42px));
    z-index: 20;
  }
  body.sidebar-collapsed .sidebar,
  html.sidebar-collapsed-preload .sidebar {
    transform: translateX(-100%);
    opacity: 0;
    padding: 18px 14px;
  }
  body:not(.sidebar-collapsed)::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(20, 33, 42, 0.32);
    pointer-events: none;
    z-index: 10;
  }
  .metric-grid, .two-column, .upload-grid, .ops-metrics, .ops-support, .ops-focus-grid, .upload-console, .upload-body, .day-metrics, .shift-grid, .pending-grid, .invoice-file-grid, .invoice-file-metrics, .transaction-summary, .transaction-breakdown, .upload-insight-grid, .config-hero, .config-grid, .diagnostic-grid, .portal-layout, .automation-grid, .field-row, .field-row.three-columns { grid-template-columns: 1fr; }
  .transaction-summary article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .invoice-file-head {
    flex-direction: column;
  }
  .invoice-file-status {
    justify-content: flex-start;
  }
  .invoice-file-metrics article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .invoice-preview-parties,
  .invoice-preview-totals {
    grid-template-columns: 1fr;
  }
  .invoice-preview-parties article,
  .invoice-preview-totals article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .invoice-preview-head {
    flex-direction: column;
  }
  .invoice-preview-status {
    text-align: left;
  }
  .filters, .ops-toolbar, .upload-history-filters, .report-filters { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-title { align-items: flex-start; }
  .day-hero { flex-direction: column; }
  .closure-panel { align-items: flex-start; flex-direction: column; }
  .closure-checks { justify-content: flex-start; }
  .diagnostic-hero { align-items: flex-start; flex-direction: column; }
  .upload-menu { position: static; }
  .upload-intro, .upload-card-head, .history-strip-head { align-items: flex-start; flex-direction: column; }
  .history-item { grid-template-columns: 1fr; }
  .history-numbers { flex-wrap: wrap; }
  .login-card { grid-template-columns: 1fr; }
  .login-visual { min-height: 280px; }
  .login-copy h1 { font-size: 30px; }
  .admin-form,
  .role-form {
    grid-template-columns: 1fr;
  }
  .permission-checks.wide {
    grid-column: auto;
  }
  .station-form,
  .atio-payment-form,
  .station-provider-grid,
  .portal-credential-form,
  .portal-credential-card {
    grid-template-columns: 1fr;
  }
  .portal-credential-form .wide,
  .portal-credential-card .wide {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 14px;
  }

  .atio-report-filters .filter-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .atio-report-filters .station-picker-field {
    min-width: 0;
  }

  .atio-report-filters .btn {
    justify-content: center;
    width: 100%;
  }

  .atio-report-summary .day-metrics {
    gap: 8px;
  }

  .atio-report-table-wrap {
    overflow: visible;
  }

  .atio-report-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    font-size: 13px;
    min-width: 0;
  }

  .atio-report-table thead {
    display: none;
  }

  .atio-report-table tbody,
  .atio-report-table tr,
  .atio-report-table td {
    display: block;
    width: 100%;
  }

  .atio-report-table tbody tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
  }

  .atio-report-table tbody td {
    align-items: flex-start;
    border: 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 7px 0;
    text-align: right;
    white-space: normal;
  }

  .atio-report-table tbody td::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 42%;
    font-size: 11px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
  }

  .atio-report-table tbody td:first-child {
    display: block;
    text-align: left;
  }

  .atio-report-table tbody td:first-child::before {
    display: block;
    margin-bottom: 4px;
  }

  .atio-report-table tbody td:first-child strong {
    display: block;
    font-size: 15px;
  }

  .atio-report-table tbody .atio-message-cell {
    max-width: none;
    text-align: right;
    word-break: break-word;
  }

  .atio-report-table tfoot,
  .atio-report-table tfoot tr,
  .atio-report-table tfoot th {
    display: block;
    width: 100%;
  }

  .atio-report-table tfoot tr {
    background: #eef8f5;
    border: 1px solid #9bd5c9;
    border-radius: 8px;
    margin-top: 8px;
    padding: 10px 12px;
  }

  .atio-report-table tfoot th {
    align-items: flex-start;
    background: transparent;
    border: 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 7px 0;
    text-align: right;
    white-space: normal;
  }

  .atio-report-table tfoot th:first-child {
    display: block;
    text-align: left;
  }

  .atio-report-table tfoot th[data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 42%;
    font-size: 11px;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
  }

  .excel-copy-table {
    border-collapse: collapse;
    border-spacing: 0;
    min-width: 760px;
  }

  .excel-copy-table thead {
    display: table-header-group;
  }

  .excel-copy-table tbody {
    display: table-row-group;
  }

  .excel-copy-table tr {
    display: table-row;
    width: auto;
  }

  .excel-copy-table tbody tr {
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .excel-copy-table th,
  .excel-copy-table td {
    border-bottom: 1px solid var(--line);
    display: table-cell;
    padding: 7px 9px;
    width: auto;
  }

  .excel-copy-table tbody td::before,
  .excel-copy-table tfoot th[data-label]::before {
    content: none;
  }
}

@media print {
  body {
    background: #fff;
  }
  .sidebar,
  .topbar,
  .preview-actions {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  .main {
    padding: 0;
  }
  .invoice-preview {
    width: 100%;
    border: 0;
    box-shadow: none;
  }
  .invoice-preview-head,
  .invoice-preview-parties article,
  .invoice-preview-totals article,
  .invoice-preview-section {
    break-inside: avoid;
  }
}

/* Gastos: captura, consulta y detalle. */
.gastos-panel { padding: 24px; margin-bottom: 20px; }
.gastos-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gastos-metrics article a { display: inline-block; font-size: 14px; margin-top: 10px; color: #0f766e; }
.gastos-panel summary { cursor: pointer; padding: 8px 0; }
.gastos-form, .gastos-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0; }
.gastos-form > * { min-width: 0; }
.gastos-form label { display: flex; flex-direction: column; gap: 8px; }
.gastos-form input, .gastos-form select, .gastos-form textarea { width: 100%; min-width: 0; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.gastos-form textarea { min-height: 110px; resize: vertical; }
.gastos-form input[type="file"] { background: #f8fafc; }
.gastos-wide { grid-column: 1 / -1; }
.gastos-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 0; }
.gastos-detail dt { color: #64748b; font-size: 13px; margin-bottom: 6px; }
.gastos-detail dd { margin: 0; overflow-wrap: anywhere; }
.gastos-text { white-space: pre-wrap; }
.gasto-state { display: inline-block; border-radius: 20px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.gasto-state.pendiente { background: #fef3c7; color: #854d0e; }
.gasto-state.autorizado { background: #dcfce7; color: #166534; }
.gasto-state.denegado { background: #fee2e2; color: #991b1b; }
@media(max-width: 1000px) { .gastos-form, .gastos-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width: 600px) { .gastos-panel { padding: 16px; } .gastos-form, .gastos-detail, .gastos-metrics { grid-template-columns: 1fr; } }

/* Approval screen: bounded filter tracks and touch-friendly mobile cards. */
.gastos-review { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.gastos-review > .panel, .gastos-review > .day-control { margin: 0; }
.gastos-review .gastos-list-panel { order: 2; }
.gastos-mobile-cards { display: none; }
.gastos-review .gastos-filter-panel { order: 3; }
.gastos-review .gastos-summary-panel { order: 4; }
.gastos-review .gastos-rules-panel { order: 5; }
.gastos-review .gastos-catalog-panel { order: 6; }
.gastos-station-picker { padding: 14px 18px; }
.gastos-station-picker h2 { margin: 0 0 12px; font-size: 18px; }
.gastos-top-filters { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(150px, .8fr) auto; gap: 12px; align-items: end; }
.gastos-top-filters label { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.gastos-top-filters select, .gastos-top-filters input { width: 100%; min-height: 44px; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.gastos-review .day-hero { padding: 18px 22px; }
.gastos-review .day-hero h2 { margin: 0 0 4px; font-size: 20px; }
.gastos-review .day-hero p { margin: 0; }
.gastos-review .day-metrics article { padding: 10px 14px; }
.gastos-review .gastos-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 20px 0 0; align-items: end; }
.gastos-review .gastos-filters > *, .gastos-review .field { min-width: 0; }
.gastos-review .field { display: flex; flex-direction: column; gap: 8px; }
.gastos-review .field input, .gastos-review .field select { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; box-sizing: border-box; }
.gastos-review .gastos-filters .filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.gastos-review .btn { min-height: 44px; white-space: normal; text-align: center; }
.gastos-review .gastos-actions { padding: 16px; }
.gastos-review .panel-head { flex-wrap: wrap; gap: 12px; }
.gastos-review p { line-height: 1.6; }
.gastos-review summary { min-height: 44px; line-height: 1.5; cursor: pointer; }
.gastos-review .gastos-form { align-items: end; }
.gastos-review td { overflow-wrap: anywhere; }
.gasto-description { min-width: 220px; max-width: 340px; white-space: normal; }
.gasto-row-actions { min-width: 190px; }
.gasto-row-actions > a { display: inline-block; margin-bottom: 8px; }
.gasto-row-actions form { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.gasto-row-actions input[name="motivo"] { width: 180px; min-height: 38px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
.gasto-row-actions .btn { min-height: 38px; padding: 8px 10px; }
.gasto-quick-approve { background: #0f766e; color: white; }
.gasto-quick-deny { color: #991b1b; }
.gastos-capture-actions a { display: inline-block; margin-right: 10px; }
.gastos-refresh-bar { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin: 12px 0; }
.gastos-refresh-bar span { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .gastos-review .gastos-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .gastos-capture-actions a { display: inline-flex; min-height: 34px; align-items: center; margin-right: 8px; }
  .gastos-refresh-bar { align-items: stretch; flex-direction: column; }
  .gastos-panel { padding: 12px; margin-bottom: 12px; }
  .gastos-panel h2 { font-size: 16px; margin-bottom: 8px; }
  .gastos-form { gap: 10px; margin: 10px 0; }
  .gastos-form label { gap: 4px; font-size: 12px; }
  .gastos-form input, .gastos-form select, .gastos-form textarea { padding: 8px; }
  .gastos-form textarea { min-height: 78px; }
  .gastos-review { gap: 16px; }
  .gastos-review > .panel, .gastos-review > .day-control { border-radius: 8px; }
  .gastos-review .panel { padding: 12px; }
  .gastos-review .panel h2 { font-size: 16px; line-height: 1.25; margin: 0 0 8px; }
  .gastos-review .panel-head { padding: 0 0 8px; }
  .gastos-review .panel-head h2 { font-size: 16px; }
  .gastos-review .panel-head span, .gastos-review .panel > p { font-size: 12px; line-height: 1.35; }
  .gastos-review .day-control { overflow: hidden; }
  .gastos-review .day-hero { padding: 12px 14px; }
  .gastos-review .day-hero h2 { font-size: 17px; }
  .gastos-review .day-hero p { font-size: 12px; line-height: 1.35; }
  .gastos-review .day-metrics article { padding: 9px 14px; }
  .gastos-review .day-metrics span { font-size: 10px; }
  .gastos-review .day-metrics strong { font-size: 18px; margin-top: 3px; }
  .gastos-review .day-metrics small { font-size: 11px; }
  .gastos-review .day-metrics a { min-height: 30px; margin-top: 3px; font-size: 13px; }
  .gastos-review .gastos-station-picker { padding: 10px 12px; }
  .gastos-review .gastos-station-picker h2 { font-size: 15px; margin-bottom: 7px; }
  .gastos-station-picker label { grid-template-columns: 1fr; gap: 8px; }
  .gastos-top-filters { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gastos-top-filters label { gap: 4px; font-size: 12px; }
  .gastos-top-filters select, .gastos-top-filters input { min-height: 38px; font-size: 14px; }
  .gastos-top-filters .btn { width: 100%; min-height: 38px; }
  .gastos-review .gastos-filters, .gastos-review .gastos-form { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gastos-review input, .gastos-review select { font-size: 16px; }
  .gastos-review .gastos-filters .field { gap: 4px; font-size: 12px; }
  .gastos-review .gastos-filters .field input, .gastos-review .gastos-filters .field select { min-height: 38px; }
  .gastos-review .gastos-filters .filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gastos-review .filter-actions > :first-child { grid-column: 1 / -1; }
  .gastos-review .btn { width: 100%; min-height: 36px; padding: 7px 9px; font-size: 13px; }
  .gastos-review .day-hero { padding: 18px; }
  .gastos-review .gastos-metrics { grid-template-columns: minmax(0, 1fr); }
  .gastos-review .gastos-metrics article { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; }
  .gastos-review .gastos-metrics article:last-child { border-bottom: 0; }
  .gastos-review .gastos-metrics a { display: inline-flex; align-items: center; min-height: 44px; }
  .gastos-review .table-wrap { overflow: visible; padding: 8px; }
  .gastos-review .gastos-desktop-table { display: none; }
  .gastos-review .gastos-mobile-cards { display: grid; gap: 8px; }
  .gasto-mobile-station-group { display: grid; gap: 6px; }
  .gasto-mobile-station-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border: 1px solid #b8d9d4; border-radius: 8px; background: #e8f5f2; color: #075e54; }
  .gasto-mobile-station-group > header strong { font-size: 14px; font-weight: 900; }
  .gasto-mobile-station-group > header span { color: #397a72; font-size: 11px; font-weight: 700; }
  .gasto-mobile-card { border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: var(--surface); }
  .gasto-mobile-folio { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
  .gasto-mobile-grid { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 4px 9px; padding: 7px 0; font-size: 12px; line-height: 1.3; }
  .gasto-mobile-grid > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .gasto-mobile-grid > strong { min-width: 0; overflow-wrap: anywhere; }
  .gasto-mobile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding-top: 7px; }
  .gasto-mobile-actions form { margin: 0; }
  .gasto-mobile-deny { display: flex; flex: 1 1 190px; gap: 5px; }
  .gasto-mobile-deny input { min-width: 0; flex: 1; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
  .gasto-icon-approve, .gasto-icon-deny { width: 36px; height: 36px; border: 0; border-radius: 7px; color: white; font-size: 21px; font-weight: 800; cursor: pointer; }
  .gasto-icon-approve { background: #0f766e; }
  .gasto-icon-deny { background: #b91c1c; }
  .gasto-mobile-detail { min-height: 34px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
  .gastos-review .gastos-panel .table-wrap { padding: 8px 0 0; }
  .gastos-review table, .gastos-review tbody { display: block; width: 100%; min-width: 0; }
  .gastos-review thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gastos-review tbody tr { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; margin-bottom: 9px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
  .gastos-review tbody td { display: grid; grid-template-columns: minmax(88px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 3px 10px; padding: 6px 0; border: 0; white-space: normal; text-align: left; font-size: 13px; line-height: 1.3; }
  .gastos-review td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 5; font-size: 10px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
  .gastos-review td > * { grid-column: 2; min-width: 0; }
  .gastos-review td br { display: none; }
  .gastos-review td[colspan] { display: block; }
  .gastos-review td[colspan]::before { display: none; }
  .gastos-review td a { display: inline-flex; align-items: center; min-height: 34px; }
  .gastos-review .gasto-description { min-width: 0; max-width: none; }
  .gastos-review .gasto-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .gastos-review .gasto-row-actions form { display: grid; grid-template-columns: 1fr; }
  .gastos-review .gasto-row-actions { align-items: stretch; }
  .gastos-review .gasto-row-actions input[name="motivo"], .gastos-review .gasto-row-actions .btn { width: 100%; min-height: 36px; }
  .gastos-review .gasto-state { padding: 3px 8px; font-size: 11px; }
}
