:root {
  color-scheme: light;
  --ink: #182c3b;
  --muted: #657682;
  --line: #dce3e6;
  --surface: #fff;
  --canvas: #f0f3f4;
  --slate: #233d50;
  --slate-light: #31536b;
  --emerald: #0b8c68;
  --emerald-dark: #067052;
  --danger: #b43d37;
  --success: #117453;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
button, input, select { font: inherit; }
button, a, input, select { outline-color: var(--emerald); outline-offset: 3px; }
.site-header { height: 72px; padding: 0 max(24px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; background: var(--slate); color: white; font-size: 11px; letter-spacing: .06em; }
.secure-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.secure-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); }
.page-shell { width: min(100% - 32px, 880px); margin: 42px auto 70px; }
.site-footer { max-width: 880px; margin: 0 auto 28px; padding: 0 16px; text-align: center; color: var(--muted); font-size: 12px; }
.checkout-layout { display: grid; grid-template-columns: .92fr 1.08fr; min-height: 620px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.summary-panel { padding: 42px 38px 32px; background: var(--slate); color: #f5fafc; display: flex; flex-direction: column; }
.eyebrow { margin: 0 0 12px; color: #607582; font-size: 11px; font-weight: 750; letter-spacing: .12em; }
.eyebrow-light { color: #aec2cf; }
.summary-panel h1 { margin: 0; font-size: 26px; line-height: 1.25; letter-spacing: -.035em; font-weight: 650; }
.summary-amount { margin-top: 36px; font-size: clamp(32px, 4vw, 43px); line-height: 1; letter-spacing: -.045em; font-weight: 720; }
.summary-caption { margin: 10px 0 28px; color: #bdcbd2; font-size: 13px; }
.summary-details { margin: 0; border-top: 1px solid rgba(255,255,255,.16); }
.summary-details div { padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.16); }
.summary-details dt { color: #a8bdc9; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.summary-details dd { margin: 6px 0 0; color: #f7fafb; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.trust-note { display: flex; gap: 12px; align-items: flex-start; margin-top: auto; padding-top: 28px; color: #c9d7de; font-size: 12px; line-height: 1.55; }
.lock-icon { color: #83d2b6; font-size: 15px; }
.form-panel { padding: 42px 40px 34px; }
.form-panel h2, h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.03em; }
.form-intro { margin: 0 0 25px; font-size: 14px; line-height: 1.5; }
.muted { color: var(--muted); line-height: 1.6; }
.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 7px; color: #273a47; font-size: 13px; font-weight: 650; }
.field input, .filter-form input, .filter-form select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #cbd5da; border-radius: 8px; background: white; color: var(--ink); }
.field input:focus, .filter-form input:focus, .filter-form select:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(11,140,104,.12); outline: none; }
.field input::placeholder { color: #97a5ad; }
.field-hint, .privacy-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.field-error { min-height: 0; margin: 0; color: var(--danger); font-size: 12px; line-height: 1.4; }
.field-error:not(:empty) { margin-top: 6px; }
.stripe-element { min-height: 44px; padding: 12px; border: 1px solid #cbd5da; border-radius: 8px; }
.attempt-note { margin: 3px 0 16px; color: #657682; font-size: 11px; line-height: 1.5; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 17px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.button-primary { background: var(--emerald); color: white; }
.button-primary:hover:not(:disabled) { background: var(--emerald-dark); }
.button:disabled { opacity: .65; cursor: not-allowed; }
.button-secondary { border-color: #cbd5da; background: white; color: var(--ink); }
.button-secondary:hover { background: #f5f8f9; }
.button-wide { width: 100%; }
.button-spinner { display: none; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; }
.is-busy .button-spinner { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.message-panel, .login-panel { width: min(100%, 480px); margin: 72px auto; padding: 38px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.message-panel h1, .login-panel h1 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.04em; }
.message-icon, .status-icon { width: 43px; height: 43px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 50%; background: #eff3f5; color: var(--slate); font-size: 20px; font-weight: 700; }
.status-success { background: #e4f4ed; color: var(--success); }
.status-error { background: #fbebea; color: var(--danger); }
.status-pending { background: #edf3f7; color: #34546a; }
.result-panel > .button { margin-top: 24px; }
.polling-status { min-height: 20px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.htmx-indicator { display: none; color: var(--muted); font-size: 12px; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.login-panel { margin-top: 80px; }
.stack-form { margin-top: 24px; }
.alert-error, .alert-success { padding: 11px 13px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.alert-error { border: 1px solid #f0c6c3; background: #fff5f4; color: var(--danger); }
.alert-success { border: 1px solid #b9dfd0; background: #f0faf5; color: var(--success); }
.panel-layout { width: min(100% - 32px, 1320px); margin: 28px auto 70px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; }
.panel-sidebar { align-self: start; position: sticky; top: 24px; min-height: calc(100vh - 48px); padding: 18px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; display: flex; flex-direction: column; }
.panel-sidebar .brand { font-size: 14px; }
.panel-nav { display: grid; gap: 4px; margin: 28px 0; }
.panel-nav a, .nav-logout { padding: 10px 11px; border-radius: 7px; color: #435660; font-size: 13px; text-decoration: none; }
.panel-nav a:hover, .panel-nav a.active { background: #edf4f5; color: #18394c; }
.nav-logout { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.nav-logout:hover { background: #f5f7f8; }
.panel-sidebar form { margin-top: auto; }
.panel-content { min-width: 0; padding: 18px 0; }
.panel-content h1 { margin: 0 0 23px; font-size: 29px; letter-spacing: -.04em; }
.panel-content h2 { margin-top: 29px; font-size: 17px; }
.panel-heading, .panel-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h1 { margin-bottom: 0; }
.health-grid, .count-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.health-item, .count-card { min-height: 78px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.health-item span, .count-card span { display: block; color: var(--muted); font-size: 11px; }
.health-item strong { display: block; margin-top: 8px; font-size: 13px; }
.count-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.count-card { display: block; text-decoration: none; }
.count-card strong { display: block; margin-top: 5px; color: var(--ink); font-size: 24px; }
.count-card:hover { border-color: #9cb6be; }
.panel-section-heading { margin-top: 26px; }
.panel-section-heading h2 { margin: 0; }
.panel-section-heading a { color: var(--emerald-dark); font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; white-space: nowrap; }
th { background: #f7f9fa; color: #63747e; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
th, td { padding: 12px 13px; border-bottom: 1px solid #e8edef; }
tbody tr:last-child td { border-bottom: 0; }
td { color: #304550; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.money { font-weight: 700; }
.state-badge { display: inline-block; padding: 4px 7px; border-radius: 5px; background: #eff3f5; color: #405562; font-size: 10px; }
.state-pagada { background: #e5f5ed; color: #126947; }
.state-rechazada, .state-cancelada { background: #fcebea; color: #9b3531; }
.state-en_disputa { background: #fff2db; color: #82570b; }
.filter-form { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 12px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.filter-form label { display: grid; gap: 6px; color: #52646e; font-size: 11px; }
.filter-form input, .filter-form select { min-height: 39px; font-size: 12px; }
.filter-form .button { min-height: 39px; }
.empty-state { margin: 14px 0; padding: 26px; border: 1px dashed #cbd5da; border-radius: 8px; color: var(--muted); text-align: center; font-size: 13px; }
.error-list { padding-left: 18px; color: var(--danger); font-size: 12px; line-height: 1.9; }

@media (max-width: 760px) {
  .site-header { height: 62px; padding: 0 16px; }
  .page-shell { width: min(100% - 20px, 560px); margin-top: 18px; }
  .checkout-layout { grid-template-columns: 1fr; }
  .summary-panel { padding: 27px 24px 22px; }
  .summary-panel h1 { max-width: 360px; font-size: 23px; }
  .summary-amount { margin-top: 23px; font-size: 34px; }
  .summary-caption { margin-bottom: 18px; }
  .summary-details div { padding: 12px 0; }
  .trust-note { padding-top: 18px; }
  .form-panel { padding: 28px 23px; }
  .panel-layout { width: min(100% - 20px, 700px); display: block; margin-top: 12px; }
  .panel-sidebar { position: static; min-height: 0; padding: 12px; }
  .panel-nav { display: flex; overflow-x: auto; margin: 12px 0 0; }
  .panel-nav a { flex: 0 0 auto; }
  .panel-sidebar form { display: none; }
  .panel-content { padding-top: 24px; }
  .health-grid { grid-template-columns: 1fr; gap: 8px; }
  .count-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .filter-form { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .message-panel, .login-panel { margin: 36px auto; padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
