:root {
  --bg: #eef3ff;
  --card: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: #d0d7e2;
  --primary: #3156d9;
  --primary-dark: #2446bd;
  --blue: #2952d5;
  --free: #ffffff;
  --reserved: #f6d76d;
  --paid: #22c55e;
  --success: #16a34a;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

body {
  padding: 12px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.hero {
  padding-top: 18px;
}

.brand-row,
.section-head,
.progress-head,
.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero .brand-row {
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.badge {
  background: #ffe4eb;
  color: var(--primary-dark);
}

.brand-logo {
  display: block;
  width: min(210px, 58vw);
  height: auto;
  flex-shrink: 1;
}

.pix-logo {
  display: block;
  width: 168px;
  max-width: 58vw;
  height: auto;
  margin: 0 auto 16px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  margin-top: 14px;
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 16px;
  font-size: clamp(15px, 4vw, 18px);
  text-align: center;
  white-space: nowrap;
}

h2 {
  font-size: 22px;
  font-weight: 800;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-block;
}

.dot.livre {
  background: var(--free);
}

.dot.reservado {
  background: var(--reserved);
  border-color: var(--reserved);
}

.dot.pago {
  background: var(--paid);
  border-color: var(--paid);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  background: #f8fbff;
}

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress-wrap {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.progress-head {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.progress-head strong {
  color: var(--text);
}

.progress-track {
  width: 100%;
  height: 12px;
  margin-top: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-percent {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.section-head {
  margin-bottom: 12px;
}

.status-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.status-box.success {
  background: #dcfce7;
  color: #166534;
}

.status-box.error {
  background: #fee2e2;
  color: #991b1b;
}

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

.num {
  width: 100%;
  aspect-ratio: 1 / 0.72;
  min-height: 48px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: var(--free);
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.num:active {
  transform: scale(0.96);
}

.num.selected {
  background: #dbeafe;
  border-color: var(--blue);
  color: #1e3a8a;
}

.num.reservado {
  background: var(--reserved);
  border-color: var(--reserved);
  color: #321600;
}

.num.pago {
  background: var(--paid);
  border-color: var(--paid);
  color: #ffffff;
}

.num:disabled {
  opacity: 1;
}

.checkout-card {
  padding-bottom: 18px;
}

.summary {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.summary-line {
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.summary-line strong {
  color: var(--text);
  text-align: right;
  font-size: 15px;
}

.summary-line.total {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.summary-line.total strong {
  color: var(--primary);
  font-size: 24px;
}

.form {
  margin-top: 14px;
}

label {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 14px;
  font-size: 16px;
  outline: none;
}

textarea {
  min-height: 110px;
  resize: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(41, 82, 213, 0.14);
}

.btn {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 800;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:disabled {
  background: #22c55e;
  color: #ffffff;
}

.btn-light {
  background: #e8f0ff;
  color: var(--blue);
}

.btn-green {
  background: #dcfce7;
  color: #166534;
}

.btn-red {
  background: #fee2e2;
  color: #991b1b;
}

.btn-compact {
  width: auto;
  min-height: 38px;
  margin-top: 0;
  padding: 0 12px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.address-box {
  margin-top: 12px;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
}

.pix-page {
  min-height: calc(100vh - 24px);
  display: flex;
  align-items: stretch;
}

.pix-box {
  width: 100%;
}

.pix-box h1 {
  font-size: clamp(20px, 6vw, 25px);
  margin-bottom: 8px;
  text-align: center;
}

.pix-summary {
  margin: 10px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.qr-wrap {
  display: grid;
  place-items: center;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.qr-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
}

.copy-feedback {
  min-height: 0;
  margin-top: 12px;
  border-radius: 8px;
  padding: 0;
  color: #166534;
  font-size: 14px;
  font-weight: 800;
}

.copy-feedback.success,
.copy-feedback.error {
  padding: 12px;
}

.copy-feedback.success {
  background: #dcfce7;
  color: #166534;
}

.copy-feedback.error {
  background: #fee2e2;
  color: #991b1b;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.admin-site-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

body.admin-page .app {
  max-width: 1280px;
}

.admin-hidden {
  display: none !important;
}

body.admin-page .admin-login {
  display: grid;
  min-height: calc(100dvh - 24px);
  place-items: center;
  max-width: 430px;
}

.admin-login-card {
  width: 100%;
}

.admin-login-card h1 {
  margin-top: 14px;
}

.admin-login-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-login-form label {
  font-size: 14px;
  font-weight: 800;
}

.admin-login-error {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 800;
}

body.admin-page .admin-panel {
  padding: 18px;
}

body.admin-page .admin-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.admin-page .admin-toolbar .btn {
  margin-top: 0;
}

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

.admin-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.admin-top,
.admin-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-number {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.admin-status {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: lowercase;
}

.admin-status.livre {
  background: #e2e8f0;
  color: #334155;
}

.admin-status.reservado {
  background: #fef3c7;
  color: #92400e;
}

.admin-status.pago {
  background: #dcfce7;
  color: #166534;
}

.admin-name {
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.admin-phone {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-phone-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-actions .btn {
  min-height: 44px;
  margin-top: 0;
  padding: 0 10px;
  font-size: 14px;
}

#paidListBox {
  min-height: 260px;
}

.is-copied {
  background: #16a34a !important;
  color: #ffffff !important;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.65);
}

.confirm-box {
  width: 100%;
  max-width: 430px;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  padding: 18px;
}

.confirm-box h2 {
  margin-top: 14px;
}

.confirm-box p {
  color: var(--muted);
  font-weight: 700;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.confirm-actions .btn {
  margin-top: 0;
}

@media (min-width: 1180px) {
  body.admin-page .admin-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  body {
    padding: 8px;
  }

  .card {
    padding: 12px;
  }

  h1 {
    font-size: 27px;
  }

  .grid {
    gap: 6px;
  }

  .num {
    min-height: 44px;
    font-size: 15px;
  }

  .summary-line {
    display: block;
  }

  .summary-line strong {
    display: block;
    margin-top: 4px;
    text-align: left;
  }
}

@media (max-width: 899px) {
  body.admin-page .app {
    max-width: 100%;
  }

  body.admin-page .admin-toolbar {
    grid-template-columns: 1fr;
  }

  body.admin-page .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.admin-page h1 {
    font-size: 28px;
  }

  .admin-item {
    padding: 10px;
  }

  .admin-top,
  .admin-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-number {
    font-size: 22px;
  }

  .admin-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .admin-phone {
    font-size: 12px;
  }

  .admin-phone-link {
    min-height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  .admin-actions .btn {
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.15;
  }
}

@media (max-width: 389px) {
  body.admin-page .admin-list {
    grid-template-columns: 1fr;
  }
}
