* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #16181c;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;

  /* Fundo com marca d'água sutil de campo de futebol (linhas de gramado + círculo central) */
  background-color: #eef1ec;
  background-image:
    radial-gradient(circle at 50% 220px, rgba(255,255,255,0.9) 0%, rgba(238,241,236,0) 60%),
    repeating-linear-gradient(0deg, rgba(22,24,28,0.035) 0px, rgba(22,24,28,0.035) 2px, transparent 2px, transparent 46px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Ccircle cx='200' cy='200' r='70' fill='none' stroke='%2316181c' stroke-opacity='0.05' stroke-width='2'/%3E%3Ccircle cx='200' cy='200' r='3' fill='%2316181c' fill-opacity='0.05'/%3E%3Cline x1='200' y1='0' x2='200' y2='400' stroke='%2316181c' stroke-opacity='0.04' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat, no-repeat;
  background-position: top center, top left, top center;
  background-size: 100% 500px, 100% 46px, 500px 500px;
  background-attachment: fixed, fixed, fixed;
}

.header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-left img { height: 44px; width: auto; flex-shrink: 0; }
.header-title { font-size: 15px; font-weight: 700; }
.header-subtitle { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af; }

.btn-admin {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  background: #fff; color: #4b5563; border: 1px solid #d1d5db;
  border-radius: 8px; padding: 8px 12px; flex-shrink: 0;
  cursor: pointer;
}
.btn-admin.active { background: #16181c; color: #fff; border-color: #16181c; }

.pin-row {
  max-width: 560px; margin: 10px auto 0; display: flex; gap: 8px;
}
.pin-row input {
  flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid #d1d5db;
  background: #f9fafb; font-size: 14px;
}
.pin-row button { padding: 10px 14px; border-radius: 8px; border: none; background: #16181c; color: #fff; }

.container { max-width: 560px; margin: 0 auto; padding: 20px 16px; }

.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 4px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.tab { flex: 1; text-align: center; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #6b7280; cursor: pointer; border: none; background: none; }
.tab.active { background: #16181c; color: #fff; }

.date-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); margin-bottom: 8px;
}
.date-nav button { background: none; border: none; padding: 8px; border-radius: 8px; font-size: 20px; cursor: pointer; }
.date-nav button:disabled { opacity: 0.25; }
.date-center { text-align: center; }
.date-center .main { font-weight: 700; font-size: 14px; }
.date-center .sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.hint { font-size: 11px; color: #9ca3af; margin-bottom: 20px; }

.court-block { margin-bottom: 14px; }
.court-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #6b7280; margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.court-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #16181c; }

.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-btn {
  border-radius: 10px; padding: 10px; text-align: left; cursor: pointer;
  background: #fff; border: 1px dashed #d1d5db; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.slot-btn.booked { border: 1px solid #fecaca; border-left: 4px solid #dc2626; border-style: solid; background: #fef2f2; }
.slot-btn.locked { cursor: not-allowed; }
.slot-btn.selected { border: 2px solid #16181c; }
.slot-time { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.slot-time .start { font-size: 14px; font-weight: 700; }
.slot-time .end { font-size: 9px; color: #9ca3af; }
.slot-status { font-size: 12px; color: #9ca3af; }
.slot-status.booked-name { color: #b91c1c; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-valor { font-size: 10px; color: #059669; font-weight: 600; margin-top: 2px; }

.panel {
  margin-top: 16px; border-radius: 12px; border: 2px solid #16181c; background: #fff;
  padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.panel-title { font-size: 14px; font-weight: 700; }
.panel-subtitle { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.panel-close { background: none; border: none; font-size: 18px; color: #9ca3af; cursor: pointer; }

.field { position: relative; margin-bottom: 10px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px 10px 34px; border-radius: 10px; border: 1px solid #d1d5db;
  background: #f9fafb; font-size: 14px; font-family: inherit;
}
.field textarea { resize: none; }
.field .icon { position: absolute; left: 10px; top: 12px; font-size: 14px; color: #9ca3af; }

.warn { font-size: 11px; color: #b45309; margin: -6px 0 10px; }

.btn-confirm {
  width: 100%; padding: 14px; border-radius: 10px; border: none; background: #059669; color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer; margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(5,150,105,0.3);
}
.btn-confirm:disabled { opacity: 0.4; box-shadow: none; }

.optional-hint { font-size: 11px; color: #9ca3af; text-align: center; margin: -4px 0 10px; }

.row-actions { display: flex; gap: 8px; }
.btn-secondary { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #d1d5db; background: #fff; color: #6b7280; font-size: 13px; cursor: pointer; }
.btn-danger { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #fecaca; background: #fff; color: #dc2626; font-size: 13px; cursor: pointer; }

.error-box { margin-top: 14px; border: 1px solid #fca5a5; background: #fef2f2; border-radius: 10px; padding: 10px 12px; }
.error-box p { font-size: 12px; font-weight: 600; color: #b91c1c; word-break: break-word; }

.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; margin: 20px 0 8px; display: flex; align-items: center; gap: 6px; }
.muted { font-size: 13px; color: #9ca3af; padding: 10px 0; }

.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: 10px; border: 1px solid #e5e7eb; border-left: 4px solid #16181c;
  background: #fff; padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
}
.list-item .left { min-width: 0; }
.list-item .left .date { font-size: 11px; color: #9ca3af; }
.list-item .left .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .left .obs { font-size: 11px; color: #9ca3af; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .right { text-align: right; flex-shrink: 0; }
.list-item .right .phone { font-size: 12px; color: #6b7280; }
.list-item .right .valor { font-size: 12px; color: #059669; font-weight: 600; }

.preset-row { display: flex; gap: 8px; margin-bottom: 12px; }
.preset-btn { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; font-size: 12px; font-weight: 500; color: #4b5563; cursor: pointer; }

.date-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.date-range label { font-size: 10px; color: #9ca3af; display: block; margin-bottom: 4px; }
.date-range input { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #d1d5db; font-size: 12px; background: #fff; }

.btn-primary-full { width: 100%; padding: 10px; border-radius: 10px; border: none; background: #16181c; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 12px; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.summary-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.summary-card .label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #9ca3af; }
.summary-card .value { font-size: 18px; font-weight: 700; margin-top: 2px; }
.summary-card .value.money { color: #059669; }

.breakdown { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.breakdown-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.breakdown-row .money { color: #059669; font-weight: 600; }

.btn-export { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid #16181c; background: #fff; color: #16181c; font-weight: 700; font-size: 13px; cursor: pointer; margin-bottom: 14px; }

/* ===== Evoluções v2 ===== */
.slot-btn.blocked { border: 1px solid #fde68a; border-left: 4px solid #b45309; background: #fffbeb; }
.blocked-label { color: #b45309 !important; font-weight: 600; }

.badge-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-noshow { background: #fee2e2; color: #991b1b; }
.badge-recurring { background: #e0e7ff; color: #3730a3; }

.wait-badge { font-size: 10px; color: #b45309; font-weight: 600; margin-top: 3px; }

.wa-link { display: block; text-align: center; font-size: 12px; color: #059669; font-weight: 600; text-decoration: none; margin: -4px 0 10px; padding: 6px; border: 1px solid #a7f3d0; border-radius: 8px; background: #ecfdf5; }
.wa-mini { text-decoration: none; font-size: 16px; display: inline-block; margin-top: 4px; }

.payment-toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; color: #4b5563; }
.pay-toggle-btn { border: none; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pay-toggle-btn.paid { background: #d1fae5; color: #065f46; }
.pay-toggle-btn.pending { background: #fef3c7; color: #92400e; }

.recurring-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.checkbox-row input { width: 16px; height: 16px; }
.small-label { display: block; font-size: 11px; color: #6b7280; margin: 8px 0 4px; }

.btn-block-link { width: 100%; background: none; border: none; color: #b45309; font-size: 12px; text-align: center; padding: 8px; cursor: pointer; text-decoration: underline; }

.breakdown-title { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #9ca3af; margin-bottom: 6px; }

.field-plain { margin-bottom: 8px; }
.field-plain input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #d1d5db; background: #f9fafb; font-size: 14px; }

.admin-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.btn-remove-admin { border: 1px solid #fecaca; color: #dc2626; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

/* ===== Tipo de reserva: pagante / cortesia / liga ===== */
.type-toggle-row { margin-bottom: 10px; }
.type-label { font-size: 12px; color: #4b5563; display: block; margin-bottom: 6px; }
.type-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.type-btn { padding: 8px 4px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; font-size: 11px; font-weight: 600; color: #6b7280; cursor: pointer; }
.type-btn.active[data-type="normal"] { background: #16181c; color: #fff; border-color: #16181c; }
.type-btn.active[data-type="cortesia"] { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; }
.type-btn.active[data-type="liga"] { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.type-btn.active[data-type="campeonato"] { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.badge-courtesy { background: #fce7f3; color: #9d174d; }
.badge-league { background: #dbeafe; color: #1e40af; }
.badge-tournament { background: #fef3c7; color: #92400e; }

/* ===== PIX e comprovante ===== */
.pix-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 14px; margin-bottom: 14px; text-align: center; }
.pix-title { font-size: 13px; font-weight: 700; color: #065f46; margin-bottom: 4px; }
.pix-amount { font-size: 22px; font-weight: 800; color: #059669; margin-bottom: 10px; }
.pix-amount-hint { font-size: 12px; color: #6b7280; margin-bottom: 10px; font-style: italic; }
.pix-key-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #d1fae5; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.pix-key-text { font-size: 13px; font-weight: 600; color: #16181c; word-break: break-all; text-align: left; }
.btn-copy-mini { flex-shrink: 0; margin-left: 8px; border: none; background: #059669; color: #fff; font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.qr-container { display: flex; justify-content: center; margin: 10px 0; min-height: 40px; }
.qr-container img, .qr-container canvas { border-radius: 8px; border: 4px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.pix-hint { font-size: 11px; color: #6b7280; margin-bottom: 8px; }
.pix-payload-text { width: 100%; font-size: 10px; font-family: monospace; padding: 8px; border-radius: 8px; border: 1px solid #d1fae5; background: #fff; resize: none; margin-bottom: 8px; color: #4b5563; }
.btn-copy-full { width: 100%; padding: 10px; border-radius: 8px; border: none; background: #059669; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }

.receipt-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.receipt-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.file-input { width: 100%; font-size: 12px; padding: 8px; border-radius: 8px; border: 1px dashed #d1d5db; background: #fff; }
.receipt-ok { font-size: 12px; color: #059669; font-weight: 600; margin-top: 6px; }
.badge-receipt { background: #e0e7ff; color: #3730a3; }
.badge-flyer { background: #dbeafe; color: #1d4ed8; }
