/* Painel do sorteio */
:root {
  --g-50: #F6FBEF; --g-100: #EAF6DA; --g-200: #D3EDB0; --g-300: #B5E26E; --g-400: #94D13F; --g-500: #78BE20;
  --g-600: #5FA318; --g-700: #3F8314; --g-800: #1E5B1F; --g-900: #0E4D2A; --g-950: #07301A;
  --ink: #0C2416; --ink-2: #3C5446; --ink-3: #6A8072; --line: #E1EAD8; --bg: #F3F7EE;
  --gold: #FFC629; --gold-2: #F2A900; --red: #D93B41; --wa: #25D366;
  --sh: 0 1px 2px rgba(7, 48, 26, .06), 0 6px 20px rgba(7, 48, 26, .06);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--g-700); }
img, svg { max-width: 100%; display: block; }
.ico { display: inline-block; vertical-align: middle; flex: none; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 800; color: var(--g-900); }
h3 { font-size: 1rem; font-weight: 800; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: var(--g-100); padding: .1em .4em; border-radius: 6px; }
code.break { display: block; word-break: break-all; padding: 8px 10px; margin-top: 4px; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.center { text-align: center; }
.txt-err { color: var(--red) !important; }
[hidden] { display: none !important; }

/* Botões */
.btn { --edge: var(--g-800); display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  padding: .7em 1.15em; border-radius: 12px; font: inherit; font-weight: 800; font-size: .92rem; line-height: 1.1; transition: transform .12s, filter .12s, box-shadow .12s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { color: #fff; background: linear-gradient(180deg, var(--g-400), var(--g-600)); box-shadow: 0 3px 0 var(--g-800); }
.btn-gold { color: #3B2700; background: linear-gradient(180deg, #FFDA5C, var(--gold-2)); box-shadow: 0 3px 0 #B57D00; }
.btn-wa { color: #fff; background: linear-gradient(180deg, #3BE37A, #1EBE5A); box-shadow: 0 3px 0 #128C4B; }
.btn-soft { color: var(--g-900); background: var(--g-100); box-shadow: 0 2px 0 var(--g-200); }
.btn-ghost { color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { color: var(--red); box-shadow: inset 0 0 0 1.5px #F3B9BB; }
.btn-danger { color: #fff; background: linear-gradient(180deg, #EC5A5F, #C8282E); box-shadow: 0 3px 0 #8E1F23; }
.btn-sm { padding: .55em .85em; font-size: .84rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }

/* Layout */
.adm { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 20px 14px; color: var(--g-100);
  background: linear-gradient(180deg, var(--g-900), var(--g-950)); }
.side-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px 12px; }
.side-brand span { display: flex; flex-direction: column; line-height: 1; }
.side-brand b { font-size: 1.1rem; font-weight: 900; }
.side-brand small { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--g-300); margin-top: 3px; font-weight: 700; }
.side-nav { display: grid; gap: 4px; }
.side-nav a, .side-foot a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; color: var(--g-100); text-decoration: none; font-weight: 700; }
.side-nav a:hover, .side-foot a:hover { background: rgba(255, 255, 255, .07); }
.side-nav a.on { background: linear-gradient(180deg, var(--g-500), var(--g-700)); color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.side-nav .dot { margin-left: auto; font-style: normal; background: var(--gold); color: #3B2700; font-size: .75rem; font-weight: 900; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { margin-top: auto; display: grid; gap: 4px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(243, 247, 238, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.35rem; font-weight: 900; color: var(--g-900); margin: 0; }
.top-site { margin-left: auto; }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 12px; border: 0; background: #fff; box-shadow: var(--sh); cursor: pointer; padding: 11px 10px; flex-direction: column; justify-content: space-between; }
.menu-btn span { display: block; height: 3px; border-radius: 2px; background: var(--g-900); }
.content { padding: 22px 28px 60px; max-width: 1200px; display: grid; gap: 18px; align-content: start; }
.side-backdrop { display: none; }

@media (max-width: 900px) {
  .adm { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-102%); transition: transform .3s ease; }
  .nav-open .side { transform: none; box-shadow: 20px 0 50px rgba(0, 0, 0, .3); }
  .nav-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(7, 32, 18, .45); }
  .menu-btn { display: flex; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 1.15rem; }
  .content { padding: 16px 16px 60px; }
}

/* Cartões */
.card { background: #fff; border-radius: 18px; padding: 22px; box-shadow: var(--sh); border: 1px solid var(--line); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card-warn { background: #FFF9E6; border-color: #FFE08A; }
.card-danger { border-color: #F6C3C5; }
.card-win { background: linear-gradient(135deg, var(--g-900), var(--g-950)); color: #fff; border: 0; }
.card-win h2 { color: #fff; font-size: 1.5rem; margin: 8px 0 4px; }
.card-win .muted { color: var(--g-200); }
.win-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.win-num { width: 120px; height: 120px; border-radius: 24px; display: grid; place-items: center; font-size: 3rem; font-weight: 900; color: #3B2700;
  background: radial-gradient(circle at 35% 30%, #FFF1B0, var(--gold) 50%, var(--gold-2)); box-shadow: 0 6px 0 #B57D00, 0 0 40px rgba(255, 198, 41, .5); flex: none; }
.grow { flex: 1; min-width: 220px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }
.checklist { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.checklist a { font-weight: 700; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { position: relative; overflow: hidden; background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--sh); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.kpi small { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.kpi b { font-size: 1.9rem; font-weight: 900; color: var(--g-900); line-height: 1.1; }
.kpi b span { font-size: 1rem; color: var(--ink-3); }
.kpi i { position: absolute; left: 0; bottom: 0; height: 5px; width: var(--p); background: linear-gradient(90deg, var(--g-400), var(--g-600)); }
.kpi-money b { font-size: 1.5rem; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi b { font-size: 1.5rem; } }

/* Badges e chips */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; vertical-align: middle; }
.badge-pending { background: #FFF4D6; color: #7A5100; }
.badge-receipt_sent { background: #E3F2FF; color: #0B4F8A; }
.badge-paid { background: var(--g-100); color: var(--g-800); }
.badge-expired, .badge-cancelled { background: #F0F0F0; color: #666; }
.badge-manual { background: #F1ECFF; color: #4B2EA8; }
.badge-gold { background: var(--gold); color: #3B2700; }
.nchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.nchip { padding: 3px 8px; border-radius: 8px; background: var(--g-900); color: #fff; font-weight: 800; font-size: .82rem; }
.nchip.win { background: var(--gold); color: #3B2700; }

/* Pedidos */
.bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.bar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--ink-2); background: #fff; border: 1px solid var(--line); font-size: .88rem; }
.tabs a em { font-style: normal; background: var(--g-100); color: var(--g-800); border-radius: 8px; padding: 1px 7px; margin-left: 4px; font-size: .78rem; }
.tabs a.on { background: var(--g-900); color: #fff; border-color: var(--g-900); }
.tabs a.on em { background: rgba(255, 255, 255, .18); color: #fff; }
.search { display: flex; gap: 6px; }
.search input { padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--line); min-width: 240px; font: inherit; background: #fff; }
.orders { display: grid; gap: 10px; }
.order { display: grid; grid-template-columns: 1fr auto; gap: 14px; background: #fff; border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line); box-shadow: var(--sh); }
.order.hot { border-color: #9CCBF5; box-shadow: 0 0 0 3px rgba(11, 79, 138, .08), var(--sh); }
.o-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.o-name { font-size: 1.02rem; }
.o-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-3); font-size: .84rem; margin-top: 4px; }
.o-meta .warn { color: #8A5A00; font-weight: 700; }
.o-meta .info { color: #0B4F8A; font-weight: 700; }
.o-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.o-amount { font-size: 1.2rem; font-weight: 900; color: var(--g-900); }
.o-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.o-actions form { margin: 0; }
@media (max-width: 700px) {
  .order { grid-template-columns: 1fr; }
  .o-side { align-items: stretch; }
  .o-actions { justify-content: flex-start; }
  .search { width: 100%; } .search input { min-width: 0; flex: 1; }
}
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); background: #fff; border-radius: 18px; border: 1px dashed var(--line); }
.empty .ico { margin: 0 auto 10px; color: var(--g-400); }
.mini-orders { display: grid; gap: 10px; }
.mini-order { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--g-50); border: 1px solid var(--line); }
.mini-order.hot { background: #F2F8FF; border-color: #CFE5FA; }
.mini-order form { margin: 0; flex: none; }
@media (max-width: 520px) { .mini-order { flex-direction: column; align-items: stretch; } }

/* Mapa */
.map { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.map a { display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; font-size: .72rem; font-weight: 800; text-decoration: none; }
.m-a { background: var(--g-50); color: var(--g-700); border: 1px solid var(--g-200); }
.m-r { background: repeating-linear-gradient(135deg, #FFF0C2 0 4px, #FFD873 4px 8px); color: #7A5100; }
.m-p { background: var(--g-800); color: #fff; }
.m-win { background: var(--gold) !important; color: #3B2700 !important; box-shadow: 0 0 0 3px rgba(255, 198, 41, .4); }
.legend-mini { font-size: .78rem; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.legend-mini i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-mini .m-a { border-width: 1px; }

/* Formulários */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span2 { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-weight: 800; font-size: .85rem; color: var(--g-900); }
.fld small { font-weight: 600; color: var(--ink-3); }
.fld-end { justify-content: flex-end; flex-direction: row; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1.5px solid var(--line); background: #FBFDF8; font: inherit; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g-500); box-shadow: 0 0 0 3px rgba(120, 190, 32, .18); background: #fff; }
input[readonly] { background: #F0F2EE; color: var(--ink-3); }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.checks { gap: 10px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; margin-bottom: 10px; }
.chk input { width: 18px; height: 18px; accent-color: var(--g-600); margin-top: 1px; flex: none; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input:not([type=file]), .inline-form select { width: auto; flex: 1; min-width: 200px; }
.smtp-box { padding: 16px; border-radius: 14px; background: var(--g-50); border: 1px solid var(--line); }
.smtp-box.off { opacity: .5; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: 70px; z-index: 5; }
.subnav a { padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: .84rem; color: var(--ink-2); }
.subnav a:hover { background: var(--g-100); }
.card[id] { scroll-margin-top: 130px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .subnav { position: static; } }
.img-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.img-preview { width: 140px; height: 140px; border-radius: 18px; overflow: hidden; background: var(--g-50); border: 1px solid var(--line); display: grid; place-items: center; flex: none; padding: 6px; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.pix-layout { display: grid; grid-template-columns: 1fr 240px; gap: 22px; align-items: start; }
.pix-test { background: var(--g-50); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.qr-box { aspect-ratio: 1; background: #fff; border-radius: 12px; display: grid; place-items: center; padding: 8px; margin-bottom: 10px; text-align: center; }
.qr-box svg { width: 100%; height: 100%; }
@media (max-width: 760px) { .pix-layout { grid-template-columns: 1fr; } .pix-test { max-width: 280px; margin-inline: auto; } }
.progress { height: 14px; border-radius: 99px; background: var(--g-100); overflow: hidden; margin: 10px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--g-400), var(--g-600)); border-radius: 99px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }

/* Alertas */
.alert { padding: 12px 16px; border-radius: 12px; font-weight: 600; border: 1px solid; }
.alert-success { background: var(--g-100); color: var(--g-900); border-color: var(--g-200); }
.alert-error { background: #FDECEC; color: #8E1F23; border-color: #F6C3C5; }

/* Login / instalador */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 80% -10%, rgba(120, 190, 32, .3), transparent 60%), linear-gradient(180deg, #F8FCF2, #E8F4DA); }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 30px 26px; box-shadow: 0 30px 70px rgba(7, 48, 26, .18); display: grid; gap: 14px; }
.auth-card.wide { width: min(720px, 100%); }
.auth-card h1 { font-size: 1.5rem; font-weight: 900; color: var(--g-900); margin: 0; text-align: center; }
.auth-card > .muted { text-align: center; margin: 0; }
.auth-logo { display: grid; place-items: center; }
.auth-card .fld { gap: 6px; }
.req { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.req li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--g-50); font-size: .88rem; }
.req .ok { color: var(--g-700); font-weight: 800; }
.req .no { color: var(--red); font-weight: 800; }
.req .opt { color: #8A5A00; font-weight: 800; }
fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0; display: grid; gap: 12px; }
legend { font-weight: 900; color: var(--g-900); padding: 0 6px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-cards label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; font-size: .88rem; }
.radio-cards label:has(input:checked) { border-color: var(--g-500); background: var(--g-50); }
.radio-cards input { accent-color: var(--g-600); margin-top: 3px; }
@media (max-width: 560px) { .radio-cards { grid-template-columns: 1fr; } }
