:root {
  color-scheme: light;
  --navy: #0a1f44;
  --navy-2: #123564;
  --navy-3: #081731;
  --gold: #c9a227;
  --gold-2: #f0d47a;
  --bone: #f8f3e7;
  --paper: #fffaf0;
  --ink: #172033;
  --muted: #6f7785;
  --line: #d9d1bd;
  --green: #1f8a5b;
  --green-soft: #dff5e7;
  --red: #ba2f2f;
  --red-soft: #f8dada;
  --blue-soft: #dce9f8;
  --shadow: 0 18px 45px rgba(10, 31, 68, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(10, 31, 68, 0.96);
  color: var(--paper);
  box-shadow: 0 8px 24px rgba(7, 17, 34, 0.18);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  width: min(1180px, calc(100vw - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-symbols {
  width: 54px;
  height: 48px;
  position: relative;
  flex: 0 0 auto;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.08);
}

.brand-mark svg {
  width: 42px;
  height: 42px;
}

.brand-bee {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(8, 23, 49, 0.25);
}

.brand-bee svg {
  width: 17px;
  height: 17px;
}

.brand-title {
  min-width: 0;
}

.brand-title strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title span {
  display: block;
  margin-top: 2px;
  color: var(--gold-2);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  color: rgba(255, 250, 240, 0.86);
  font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(201, 162, 39, 0.16);
  color: var(--paper);
}

.main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
  flex: 1;
}

.landing-main {
  width: 100%;
  padding: 0;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
  background:
    linear-gradient(100deg, rgba(8, 23, 49, 0.92), rgba(10, 31, 68, 0.72) 50%, rgba(10, 31, 68, 0.22)),
    url("data:image/svg+xml,%3Csvg width='1600' height='980' viewBox='0 0 1600 980' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1600' height='980' fill='%230a1f44'/%3E%3Cg opacity='.32'%3E%3Crect x='910' y='166' width='410' height='250' rx='18' fill='%23123564' stroke='%23f8f3e7' stroke-width='10'/%3E%3Crect x='948' y='205' width='334' height='178' rx='8' fill='%23081731'/%3E%3Cpath d='M1055 455h126l34 68H1022l33-68Z' fill='%23c9a227'/%3E%3Cpath d='M986 560h262' stroke='%23f8f3e7' stroke-width='18' stroke-linecap='round'/%3E%3C/g%3E%3Cg opacity='.19' stroke='%23f0d47a' stroke-width='2'%3E%3Cpath d='M0 835c187-105 353-131 498-77s271 52 379-6 233-85 375-82 257-36 348-117' fill='none'/%3E%3Cpath d='M0 716c180-94 329-111 447-52s233 67 344 24 231-53 362-29 275-8 447-97' fill='none'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  color: var(--paper);
}

.hero-inner {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 54px 0 88px;
}

.hero-copy {
  width: min(760px, 100%);
}

.kicker {
  color: var(--gold-2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0 16px;
  max-width: 920px;
  font-size: clamp(2.4rem, 8vw, 5.9rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 0 0 24px;
  color: rgba(255, 250, 240, 0.88);
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.hero-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 44px;
  width: min(820px, 100%);
}

.stat-tile {
  border: 1px solid rgba(248, 243, 231, 0.18);
  background: rgba(255, 250, 240, 0.09);
  padding: 16px;
  min-height: 96px;
  border-radius: 8px;
}

.stat-tile span {
  color: rgba(255, 250, 240, 0.68);
  font-size: 0.82rem;
}

.stat-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.section-band {
  background: var(--bone);
  border-top: 1px solid var(--line);
}

.section-inner {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2,
.page-heading h1,
.panel h2,
.seller-hero h1 {
  margin: 0;
  color: var(--navy);
  letter-spacing: 0;
}

.section-heading p,
.page-heading p,
.seller-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--paper);
  font-weight: 750;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(10, 31, 68, 0.18);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.gold {
  background: var(--gold);
  color: var(--navy-3);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(10, 31, 68, 0.18);
  color: var(--navy);
}

.btn.light {
  background: var(--paper);
  color: var(--navy);
}

.btn.danger {
  background: var(--red);
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.84rem;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 0 0 22px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
}

.metric-card,
.panel,
.ticket-card,
.seller-card,
.login-box,
.modal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 132px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric-card strong {
  color: var(--navy);
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric-card.money-metric strong {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.08;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.35;
}

.panel {
  padding: 18px;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.progress-wrap {
  height: 18px;
  background: #e6dcc6;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #d7c99d;
}

.progress-bar {
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, var(--gold), #2b8c67);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-top: 8px;
  font-size: 0.88rem;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #eadfca;
  text-align: left;
  vertical-align: middle;
  font-size: 0.92rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1e7d1;
  color: var(--navy);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status.disponible {
  color: var(--navy);
  background: var(--blue-soft);
}

.status.vendido {
  color: #8a5d00;
  background: #fff1bf;
}

.status.pagado {
  color: var(--green);
  background: var(--green-soft);
}

.status.error {
  color: var(--red);
  background: var(--red-soft);
}

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

.form-field {
  display: grid;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfc4aa;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.filters {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(150px, 0.6fr));
  gap: 10px;
  margin-bottom: 14px;
}

.number {
  color: var(--navy);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.seller-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.seller-hero {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
}

.public-ticket-grid {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}

.ticket-card {
  min-height: 132px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease;
}

.ticket-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.ticket-card strong {
  font-size: 1.45rem;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.ticket-card small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-list {
  display: grid;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eadfca;
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row span {
  color: var(--muted);
}

.summary-row strong {
  color: var(--navy);
  text-align: right;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 23, 49, 0.62);
}

.modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  color: var(--navy);
}

.close-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efe4cd;
  color: var(--navy);
  cursor: pointer;
  font-size: 1.2rem;
}

.login-page {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 36px 16px;
}

.login-box {
  width: min(440px, 100%);
  padding: 24px;
}

.login-box h1 {
  margin: 0 0 8px;
  color: var(--navy);
}

.login-box p {
  margin: 0 0 20px;
  color: var(--muted);
}

.empty-state {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #cdbf9d;
  border-radius: 8px;
  background: #fffaf0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.range-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #efe4cd;
  color: var(--navy);
  font-weight: 800;
}

.receipt-preview {
  background: #fffdf8;
  color: var(--navy);
  border: 2px solid var(--navy);
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  min-height: 220px;
}

.receipt-side {
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.receipt-side.control {
  border-right: 2px dashed var(--navy);
  position: relative;
}

.receipt-side.control::after {
  content: "✂";
  position: absolute;
  right: -13px;
  top: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  display: grid;
  place-items: center;
  background: #fffdf8;
  color: var(--gold);
  font-size: 16px;
}

.receipt-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 900;
}

.receipt-symbols {
  width: 42px;
  height: 42px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.receipt-title .receipt-symbols > svg:not(.bee-svg) {
  width: 38px;
  height: 38px;
}

.receipt-title .bee-svg {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 16px;
  height: 16px;
}

.act-header .receipt-symbols {
  width: 76px;
  height: 76px;
}

.act-header .receipt-symbols > svg:not(.bee-svg) {
  width: 70px;
  height: 70px;
}

.act-header .bee-svg {
  width: 24px;
  height: 24px;
}

.receipt-number {
  color: var(--gold);
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.receipt-data {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.92rem;
}

.receipt-data span {
  display: block;
  border-bottom: 1px solid #cfc4aa;
  padding-bottom: 3px;
}

.mini-logo svg {
  width: 32px;
  height: 32px;
}

.error-page {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  text-align: center;
}

.winner-box {
  border: 2px solid var(--gold);
  background: #fff8df;
  border-radius: 8px;
  padding: 20px;
}

.winner-number {
  font-size: clamp(2.8rem, 12vw, 7rem);
  line-height: 1;
  color: var(--navy);
  font-weight: 950;
  letter-spacing: 0;
}

.inline-edit {
  min-width: 140px;
}

.footer-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow: auto;
    padding-bottom: 2px;
  }

  .grid.cards,
  .grid.two,
  .seller-layout {
    grid-template-columns: 1fr;
  }

  .grid.cards.draw-metrics {
    grid-template-columns: 1fr;
  }

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

  .filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .main,
  .topbar-inner,
  .section-inner,
  .hero-inner {
    width: min(100vw - 22px, 1180px);
  }

  .page-heading,
  .section-heading,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    padding: 42px 0 64px;
  }

  .hero-stats,
  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .receipt-preview {
    grid-template-columns: 1fr;
  }

  .receipt-side.control {
    border-right: 0;
    border-bottom: 2px dashed var(--navy);
  }

  .receipt-side.control::after {
    right: 50%;
    top: auto;
    bottom: -13px;
    margin: 0 -12px 0 0;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .no-print,
  .toast,
  .modal-backdrop.no-print {
    display: none !important;
  }

  .main,
  .section-inner {
    width: auto;
    padding: 0;
    margin: 0;
  }

  .panel,
  .metric-card,
  .receipt-preview {
    box-shadow: none;
  }

  .print-sheet {
    display: block !important;
  }
}
