:root {
  --uni-maroon: #5b120d;
  --uni-red: #872218;
  --uni-cream: #f2e5b8;
  --paper: #fffdf7;
  --ink: #172120;
  --muted: #667074;
  --line: rgba(91, 18, 13, .14);
  --soft: #f7f1e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

a {
  color: var(--uni-red);
  text-decoration: none;
}

.public-page {
  min-height: 100vh;
  background:
      linear-gradient(176deg, var(--uni-maroon) 0 66%, transparent 66%),
      radial-gradient(circle at 78% 20%, rgba(242, 229, 184, .18), transparent 28%),
      var(--soft);
}

.app-page {
  min-height: 100vh;
  background:
      linear-gradient(180deg, var(--uni-maroon) 0 230px, var(--soft) 230px),
      var(--soft);
}

.soft-page {
  min-height: 100vh;
  background:
      linear-gradient(180deg, var(--uni-maroon) 0 86px, var(--soft) 86px),
      var(--soft);
}

.topbar {
  min-height: 82px;
  padding: 14px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(53, 10, 8, .62);
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 900;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
}

.brand:hover,
.nav-link-clean:hover {
  color: var(--uni-cream);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--uni-red);
  font-size: .75rem;
  font-weight: 900;
  border: 2px solid rgba(242, 229, 184, .7);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link-clean {
  color: #fff7ea;
  font-weight: 800;
}

.btn {
  border-radius: 999px;
  font-weight: 800;
  padding-inline: 1.35rem;
}

.btn-primary-uni {
  color: #fff;
  background: var(--uni-red);
  border-color: var(--uni-red);
}

.btn-primary-uni:hover {
  color: #fff;
  background: #68170f;
  border-color: #68170f;
}

.btn-cream,
.btn-light-uni {
  color: var(--uni-maroon);
  background: var(--uni-cream);
  border-color: var(--uni-cream);
}

.btn-light-uni {
  background: #fffaf0;
  border-color: #efe6d7;
}

.hero {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(42px, 8vw, 110px) 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: clamp(24px, 7vw, 96px);
  align-items: center;
}

.hero-copy {
  color: #fffaf0;
  padding-top: 20px;
  text-shadow: 0 2px 18px rgba(28, 7, 4, .22);
}

.hero-copy .eyebrow {
  color: var(--uni-cream);
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: .92;
  letter-spacing: 0;
  max-width: 900px;
  margin: 0 0 24px;
}

.hero .lead {
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  color: rgba(255, 250, 240, .92);
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-card,
.panel,
.auth-card,
.step-card,
.metric {
  background: rgba(255, 253, 247, .94);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(42, 17, 6, .12);
}

.hero-card,
.panel,
.auth-card {
  border-radius: 24px;
  padding: clamp(22px, 4vw, 38px);
}

.panel {
  background: var(--paper);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--uni-red);
  text-transform: uppercase;
  font-size: .82rem;
  font-weight: 900;
}

.route-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.route-item span,
.step-number {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f8eee8;
  color: var(--uni-red);
  font-weight: 900;
}

.route-item p,
.step-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.auth-shell {
  min-height: calc(100vh - 82px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(520px, 100%);
}

.auth-card.wide {
  width: min(860px, 100%);
}

.auth-card h1,
.panel h1 {
  font-weight: 900;
  letter-spacing: 0;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.sending-panel,
.success-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  border-radius: 16px;
}

.sending-panel {
  border: 1px solid rgba(91, 18, 13, .16);
  background: #fffaf0;
}

.success-panel {
  border: 1px solid rgba(6, 95, 70, .2);
  background: #ecfdf5;
}

.sending-panel strong,
.sending-panel span,
.success-panel strong,
.success-panel span {
  display: block;
}

.sending-panel span {
  color: var(--muted);
}

.success-panel strong,
.success-icon {
  color: #065f46;
}

.success-panel span {
  color: #047857;
}

.success-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #d1fae5;
  font-weight: 900;
}

.sending-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(91, 18, 13, .14);
  border-top-color: var(--uni-red);
  border-radius: 999px;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.dashboard-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.7rem);
  line-height: 1;
}

.status-pill {
  padding: 14px 20px;
  border-radius: 999px;
  background: #fff2df;
  color: var(--uni-red);
  white-space: nowrap;
}

.status-pill.ok {
  background: #e8f5ed;
  color: #16633b;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  color: var(--ink);
}

.step-card h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.step-card.done .step-number {
  background: #e2f3e8;
  color: #17623b;
}

.payment-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.payment-guide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
}

.payment-guide span {
  display: block;
  color: var(--uni-maroon);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-guide strong {
  display: block;
  margin-top: 4px;
}

.payment-guide p {
  margin: 4px 0 0;
  color: var(--muted);
}

.payment-box > div,
.metric {
  border-radius: 18px;
  padding: 20px;
  background: #fffaf0;
}

.payment-box span,
.metric span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.payment-box strong,
.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
  color: var(--uni-red);
}

.photo-preview {
  min-height: 180px;
  border: 2px dashed rgba(91, 18, 13, .24);
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: #fffaf0;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.native-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.combo {
  position: relative;
}

.combo-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffdf8;
  box-shadow: 0 24px 50px rgba(42, 17, 6, .18);
  padding: 8px;
}

.combo-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.combo-option:hover,
.combo-option:focus {
  background: #f8eee8;
}

.combo-option strong {
  color: var(--ink);
}

.combo-option span,
.combo-empty {
  color: var(--muted);
  font-size: .92rem;
}

.combo-empty {
  padding: 14px;
}

.admin-photo {
  min-height: 260px;
}

.admin-nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 18px;
  padding-bottom: 6px;
}

.admin-nav a {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fffaf0;
  color: var(--uni-maroon);
  font-weight: 800;
  border: 1px solid var(--line);
}

.admin-subnav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 6px;
  margin: 12px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-subnav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f7efe7;
  color: var(--uni-maroon);
  font-weight: 800;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, auto) auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.table-message {
  max-width: 360px;
}

.json-box {
  max-height: 340px;
  overflow: auto;
  padding: 14px;
  border-radius: 12px;
  background: #1f1a17;
  color: #fff7e6;
  font-size: .88rem;
  white-space: pre-wrap;
}

.json-box.compact {
  max-height: 180px;
  margin-top: 8px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #8d7f75;
  border-radius: 12px;
  background: #fffaf0;
}

.timeline-item span {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.timeline-item p {
  margin: 6px 0 0;
}

.timeline-item.level-ERROR {
  border-left-color: #b42318;
}

.timeline-item.level-WARN {
  border-left-color: #c26a00;
}

.timeline-item.level-INFO {
  border-left-color: #1f7a4d;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.detail-list,
.ficha-grid {
  display: grid;
  gap: 12px;
}

.detail-list div,
.ficha-grid div {
  padding: 14px;
  border-radius: 14px;
  background: #fffaf0;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
  font-weight: 800;
}

.switch-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #fffaf0;
  font-weight: 800;
}

.ficha-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 22px;
}

.ficha-header img {
  width: 130px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.ficha-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .hero,
  .grid-3,
  .grid-2,
  .payment-box,
  .ficha-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.2rem);
  }

  .dashboard-hero,
  .payment-guide,
  .ficha-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}

@media print {
  .no-print,
  .topbar {
    display: none !important;
  }

  body,
  .app-page {
    background: white !important;
  }

  .panel {
    box-shadow: none;
    border: 0;
  }
}
