:root {
  --ink: #102033;
  --navy: #091b2d;
  --blue: #123b62;
  --mint: #20c9a7;
  --mint-dark: #118d76;
  --paper: #f3f7fa;
  --line: #dbe5ec;
  --muted: #647386;
  --danger: #b32635;
  --success: #13785e;
  --white: #fff;
  --shadow: 0 16px 42px rgba(10, 32, 52, 0.1);
}
* {
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
.topbar {
  height: 72px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 64px);
  gap: 38px;
  box-shadow: 0 5px 20px rgba(2, 15, 28, 0.16);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--navy);
  font-weight: 900;
}
.brand-mark.large {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-size: 1.4rem;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 25px;
  flex: 1;
}
.topbar nav a {
  color: #c9d6e2;
  font-weight: 600;
}
.topbar nav a:hover {
  color: #fff;
}
.account {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
}
.account form {
  margin: 0;
}
.link-button {
  border: 0;
  background: none;
  color: var(--mint);
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}
.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 42px clamp(18px, 4vw, 54px) 80px;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(32, 201, 167, 0.14),
      transparent 30%
    ),
    linear-gradient(145deg, #071827, #123b62);
}
.auth-card,
.narrow-card {
  width: min(100%, 460px);
  background: #fff;
  border-radius: 24px;
  padding: 38px;
  box-shadow: 0 24px 70px rgba(0, 12, 25, 0.26);
}
.narrow-card {
  margin: 40px auto;
  box-shadow: var(--shadow);
}
.auth-brand {
  margin-bottom: 26px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--mint-dark);
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  line-height: 1.12;
  margin: 0 0 10px;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.18rem;
  margin: 0 0 22px;
}
.muted {
  color: var(--muted);
  margin: 0 0 24px;
}
.stack {
  display: grid;
  gap: 17px;
  margin-top: 24px;
}
label {
  font-weight: 700;
  font-size: 0.88rem;
  color: #34465a;
}
input,
select {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #cbd8e1;
  border-radius: 10px;
  background: #fff;
  padding: 12px 13px;
  color: var(--ink);
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--mint-dark);
  box-shadow: 0 0 0 3px rgba(32, 201, 167, 0.15);
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
}
.check input {
  width: 17px;
  height: 17px;
  margin: 0;
}
.button,
button.primary,
button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 11px 17px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}
.primary {
  background: var(--navy);
  color: #fff !important;
}
.primary:hover {
  background: var(--blue);
}
.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.secondary {
  background: #fff;
  color: var(--ink) !important;
  border-color: #cbd8e1 !important;
}
.full {
  width: 100%;
}
.quiet-link {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-weight: 700;
}
.alert {
  border-radius: 12px;
  padding: 13px 15px;
  margin: 18px 0;
  font-size: 0.92rem;
}
.alert.error {
  background: #fff0f1;
  color: #8d1b2a;
  border: 1px solid #f5c6cc;
}
.alert.success {
  background: #eafaf5;
  color: #0d6953;
  border: 1px solid #bcebdd;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}
.credit-card {
  background: var(--navy);
  color: #fff;
  border-radius: 16px;
  padding: 15px 21px;
  min-width: 190px;
  box-shadow: var(--shadow);
}
.credit-card span,
.credit-card small {
  display: block;
  color: #b9cad8;
  font-size: 0.76rem;
}
.credit-card strong {
  font-size: 1.8rem;
  color: var(--mint);
  line-height: 1.2;
}
.search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.search input {
  margin: 0;
  max-width: 520px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 25px;
  box-shadow: 0 8px 28px rgba(12, 42, 65, 0.055);
}
.table-panel {
  padding: 0;
  overflow: hidden;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: #eaf0f4;
  color: #536477;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  padding: 13px 16px;
}
td {
  padding: 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.9rem;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 3px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact {
  padding: 8px 12px !important;
  font-size: 0.82rem;
  white-space: nowrap;
}
.empty {
  padding: 44px 20px;
  text-align: center;
}
.empty strong,
.empty span {
  display: block;
}
.empty span {
  color: var(--muted);
  margin-top: 5px;
}
.two-column {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(400px, 1.2fr);
  gap: 22px;
}
.summary dl {
  margin: 0;
}
.summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.summary dt {
  color: var(--muted);
}
.summary dd {
  margin: 0;
  text-align: right;
  font-weight: 750;
}
.accent {
  color: var(--mint-dark) !important;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.full-row {
  grid-column: 1/-1;
}
.field-note {
  font-size: 0.82rem;
  margin: 0;
}
.error-text {
  color: var(--danger);
}
.back {
  display: inline-block;
  margin-bottom: 22px;
  font-weight: 750;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.confirmation {
  max-width: 900px;
}
.confirmation-grid,
.result-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.confirmation-grid div,
.result-summary div {
  background: #fff;
  padding: 17px;
}
.confirmation-grid span,
.result-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 5px;
}
.confirmation-grid strong,
.result-summary strong {
  display: block;
}
.delivery {
  background: #eef8f5;
  padding: 13px;
  border-radius: 10px;
}
.confirm-actions,
.download-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.status {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef2f5;
  font-size: 0.74rem;
  font-weight: 800;
}
.status.stamped {
  background: #e4f8f1;
  color: var(--success);
}
.status.failed {
  background: #ffebed;
  color: var(--danger);
}
.status.submitting,
.status.preparing,
.status.review {
  background: #fff4d8;
  color: #876006;
}
.result-card {
  max-width: 780px;
  margin: 20px auto;
  background: #fff;
  border-radius: 24px;
  padding: 38px;
  text-align: center;
  box-shadow: var(--shadow);
}
.result-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--mint);
  color: var(--navy);
  font-size: 1.7rem;
  font-weight: 900;
  margin: 0 auto 20px;
}
.failure-result .result-icon {
  background: #f9c8ce;
  color: var(--danger);
}
.uuid {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.result-summary {
  text-align: left;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 28px;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(520px, 1.28fr);
  gap: 22px;
}
.temporary-password {
  font-family: ui-monospace, monospace;
  background: #edf2f5;
  border: 1px dashed #9eafbc;
  padding: 15px;
  border-radius: 10px;
  margin: 22px 0;
  overflow-wrap: anywhere;
}
@media (max-width: 850px) {
  .topbar {
    height: auto;
    min-height: 70px;
    flex-wrap: wrap;
    padding: 14px 18px;
    gap: 12px;
  }
  .topbar nav {
    order: 3;
    width: 100%;
    overflow: auto;
  }
  .account span {
    display: none;
  }
  .page-shell {
    padding-top: 28px;
  }
  .two-column,
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .confirmation-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 580px) {
  .auth-card,
  .narrow-card {
    padding: 27px 22px;
    border-radius: 18px;
  }
  .page-head {
    display: block;
  }
  .credit-card {
    margin-top: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .confirmation-grid,
  .result-summary {
    grid-template-columns: 1fr;
  }
  .confirm-actions,
  .download-row {
    flex-direction: column;
  }
  .search {
    display: grid;
  }
  .topbar nav {
    gap: 18px;
  }
  .topbar nav a {
    font-size: 0.88rem;
  }
  td {
    padding: 13px 11px;
  }
  .table-wrap {
    overflow-x: auto;
  }
}

/* Panel de clientes */
.topbar {
  background: linear-gradient(115deg, #071827 0%, #0b2943 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar nav a {
  position: relative;
  padding: 25px 0 23px;
  transition: color 0.18s ease;
}
.topbar nav a.active {
  color: #fff;
}
.topbar nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--mint);
}
.page-shell {
  max-width: 1320px;
}
.welcome-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}
.welcome-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 42px;
}
.metric-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 25px;
  box-shadow: 0 10px 32px rgba(12, 42, 65, 0.055);
}
.metric-card span,
.metric-card small {
  display: block;
}
.metric-card span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}
.metric-card strong {
  display: block;
  font-size: 2.25rem;
  line-height: 1.1;
  margin: 9px 0 7px;
  letter-spacing: -0.045em;
}
.metric-card small {
  color: var(--muted);
}
.metric-card.featured {
  background: linear-gradient(135deg, #0a2136, #123f65);
  color: #fff;
  border-color: transparent;
}
.metric-card.featured::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  right: -45px;
  top: -60px;
  background: rgba(32, 201, 167, 0.15);
}
.metric-card.featured span,
.metric-card.featured small {
  color: #b9ccda;
}
.metric-card.featured strong {
  color: var(--mint);
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 16px;
}
.section-heading h2 {
  font-size: 1.35rem;
  margin: 0;
}
.section-heading .eyebrow {
  margin-bottom: 5px;
}
.section-heading > a {
  font-weight: 750;
  font-size: 0.88rem;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 45px;
}
.module-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 17px;
  min-height: 132px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(12, 42, 65, 0.045);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.module-card:hover {
  transform: translateY(-3px);
  border-color: #a9d9d0;
  box-shadow: 0 15px 35px rgba(12, 42, 65, 0.1);
}
.module-card h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}
.module-card p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
}
.module-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #e3f8f3;
  color: var(--mint-dark);
  font-size: 1.35rem;
  font-weight: 900;
}
.module-icon.history-icon {
  background: #e9f1fb;
  color: #286093;
}
.module-icon.credit-icon {
  background: #fff2d9;
  color: #9b6711;
  font-size: 1rem;
}
.module-arrow {
  color: #91a0ae;
  font-size: 1.25rem;
  transition: transform 0.18s ease;
}
.module-card:hover .module-arrow {
  transform: translateX(3px);
  color: var(--mint-dark);
}
.recent-heading {
  margin-top: 8px;
}
.credit-metrics {
  margin-bottom: 20px;
}
.info-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #edf6fb;
  border: 1px solid #cee2ee;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 36px;
  color: #35536a;
}
.info-note > span {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2c6c98;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}
.info-note p {
  margin: 0;
  font-size: 0.87rem;
}
.credit-debit {
  color: var(--danger);
}
.credit-refund {
  color: var(--success);
  font-size: 0.82rem;
}

@media (max-width: 950px) {
  .metric-grid,
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }
  .module-grid .module-card:last-child {
    grid-column: 1/-1;
  }
  .topbar nav a {
    padding: 8px 0 6px;
  }
  .topbar nav a.active::after {
    bottom: -5px;
  }
}
@media (max-width: 620px) {
  .welcome-head {
    display: block;
  }
  .welcome-head .button {
    margin-top: 4px;
  }
  .metric-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }
  .module-grid .module-card:last-child {
    grid-column: auto;
  }
  .metric-card {
    padding: 21px;
  }
  .metric-card strong {
    font-size: 2rem;
  }
  .module-card {
    min-height: 112px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .section-heading > a {
    white-space: nowrap;
  }
  .account {
    margin-left: auto;
  }
}
