:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,0.08);
  --card2: rgba(255,255,255,0.12);
  --text: #eaf0ff;
  --muted: rgba(234,240,255,0.72);
  --primary: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --ring: rgba(34,197,94,0.35);
  --shadow: 0 18px 48px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 12px;
  --max: 1100px;
  --fontFamily: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, \"Apple Color Emoji\",\"Segoe UI Emoji\";
  --bgTexture: none;
  --bgTextureOpacity: 0;
\}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--fontFamily);
  background: radial-gradient(1000px 800px at 15% 0%, rgba(99,102,241,0.35), transparent 55%),
              radial-gradient(900px 700px at 90% 10%, rgba(14,165,233,0.30), transparent 55%),
              radial-gradient(900px 700px at 70% 90%, rgba(34,197,94,0.22), transparent 55%),
              var(--bg);
  color:var(--text);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  background-image: var(--bgTexture);
  background-repeat: repeat;
  background-size: 520px auto;
  opacity: var(--bgTextureOpacity);
  pointer-events:none;
  z-index:-1;
}

a{color:inherit; text-decoration:none}
.container{max-width:var(--max); margin:0 auto; padding:18px}

.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,0.65);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.topbar__inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
}
.brand{display:flex; align-items:center; gap:12px}
.brand__logo{
  width:42px; height:42px; border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(34,197,94,0.25), rgba(14,165,233,0.25));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
}
.brand__logo img{width:100%;height:100%;object-fit:cover;border-radius:14px;display:block;}
.brand__name{font-weight:800; letter-spacing:.2px}
.brand__subtitle{font-size:12px; color:var(--muted)}

.topnav{display:flex; gap:10px; align-items:center}
.topnav a{
  font-size:14px; color:var(--muted);
  padding:8px 10px; border-radius:12px;
}
.topnav a:hover{background: rgba(255,255,255,0.06); color:var(--text)}

.footer{
  margin-top:28px;
  padding:22px 0;
  border-top:1px solid rgba(255,255,255,0.10);
  background: rgba(11,18,32,0.45);
}
.footer__inner{display:flex; justify-content:space-between; align-items:center; gap:12px}
.muted{color:var(--muted)}
.small{font-size:12px}

.hero{padding:16px 2px 14px}
.hero--compact{padding:10px 2px 6px}
.hero h1{margin:0 0 6px; font-size:28px}
.hero p{margin:0}

/* =========================
   Horário de funcionamento (widget)
   ========================= */
.open-widget{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:12px;padding:12px 14px;border-radius:var(--radius2);background:var(--card);border:1px solid rgba(2,6,23,.10)}
.open-widget__left{display:flex;flex-direction:column;gap:2px}
.open-widget__status{font-weight:900;letter-spacing:.2px}
.open-widget__today{font-size:12px}
.open-widget__right{text-align:right}
.open-widget__count-label{font-size:12px}
.open-widget__count{font-weight:900;font-size:16px}

@media (max-width: 720px){
  .open-widget{flex-direction:column;align-items:flex-start}
  .open-widget__right{text-align:left}
}

.card{
  background: linear-gradient(180deg, var(--card2), var(--card));
  border:1px solid var(--card2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}
.card__head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:12px;
}
.card__head h2{margin:0; font-size:18px}
.row{display:flex; gap:10px; align-items:center}

.grid2{
  display:grid; grid-template-columns: 1.2fr 0.8fr;
  gap:16px;
}
.grid3{
  display:grid; grid-template-columns: repeat(3, 1fr);
  gap:16px;
}
@media (max-width: 980px){
  .grid2{grid-template-columns: 1fr; }
  .grid3{grid-template-columns: 1fr; }
  .topnav{flex-wrap:wrap; justify-content:flex-end}
}

.btn{
  border:0; cursor:pointer;
  padding:10px 14px;
  border-radius: 14px;
  font-weight:700;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.14);
}
.btn:hover{background: rgba(255,255,255,0.12)}
.btn:focus{outline:2px solid var(--ring); outline-offset:2px}
.btn--primary{
  background: linear-gradient(135deg, rgba(34,197,94,0.95), rgba(34,197,94,0.70));
  border: 1px solid rgba(34,197,94,0.60);
  color:#06200f;
}
.btn--primary:hover{filter:brightness(1.03)}
.btn--ghost{
  background: transparent;
}
.btn--full{width:100%}

.pill{
  font-size:12px; padding:6px 10px; border-radius:999px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color:var(--muted);
}

.sep{
  border:0; height:1px;
  background: rgba(255,255,255,0.12);
  margin:14px 0;
}

.empty{
  padding:12px;
  border-radius: 14px;
  border:1px dashed rgba(255,255,255,0.20);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}
.hidden{display:none !important}

/* =========================
   Utilitários responsivos
   ========================= */
.only-mobile{display:none}
.only-desktop{display:block}
@media (max-width: 720px){
  .only-mobile{display:block}
  .only-desktop{display:none}
}

.flash-area{margin-bottom:12px}
.flash{
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  margin-bottom:10px;
}
.flash--danger{border-color: rgba(239,68,68,0.55); background: rgba(239,68,68,0.10)}
.flash--success{border-color: rgba(34,197,94,0.55); background: rgba(34,197,94,0.10)}

.menu{display:flex; flex-direction:column; gap:14px}
.cat{padding:12px; border-radius: 16px; background: rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.10)}
.cat__title{font-weight:800; margin:0 0 10px}
.items{display:flex; flex-direction:column; gap:10px}
.item{
  display:flex; gap:12px; align-items:flex-start; justify-content:space-between;
  padding:10px; border-radius: 14px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
}
.item__info{flex:1}
.item__name{font-weight:800; margin:0 0 2px}
.item__desc{margin:0; color:var(--muted); font-size:13px}
.item__right{display:flex; gap:10px; align-items:center}
.price{font-weight:800}

.cart{display:flex; flex-direction:column; gap:10px; margin-bottom:12px}
.cart-item{
  display:flex; justify-content:space-between; gap:10px; align-items:center;
  padding:10px; border-radius: 14px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
}
.cart-item__name{font-weight:800}
.cart-item__meta{color:var(--muted); font-size:12px}
.qty{
  display:flex; align-items:center; gap:8px;
}
.qty button{
  width:32px; height:32px; border-radius: 10px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color:var(--text);
  cursor:pointer;
}
.qty span{min-width:22px; text-align:center; font-weight:800}

.form{display:flex; flex-direction:column; gap:10px; margin-bottom:12px}
.form__row{display:grid; grid-template-columns: 1fr 1fr; gap:10px}
.form__col{display:flex; flex-direction:column; gap:8px}
@media (max-width: 600px){
  .form__row{grid-template-columns:1fr}
}
.label{font-size:13px; color:var(--muted); font-weight:700}
.input{
  width:100%;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color:var(--text);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  background-image: var(--bgTexture);
  background-repeat: repeat;
  background-size: 520px auto;
  opacity: var(--bgTextureOpacity);
  pointer-events:none;
  z-index:-1;
}
.input:focus{outline:2px solid var(--ring); outline-offset:2px}

.totals{display:flex; flex-direction:column; gap:8px; margin:10px 0 12px}
.totals__row{display:flex; justify-content:space-between; align-items:center}
.totals__row--big strong{font-size:18px}

.segmented{
  display:flex; gap:8px;
  padding:6px; border-radius: 16px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
.segmented__btn{
  flex:1; padding:10px; border-radius: 14px;
  border:1px solid transparent;
  background: transparent;
  color:var(--muted);
  cursor:pointer;
  font-weight:800;
}
.segmented__btn.is-active{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.14);
  color:var(--text);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  background-image: var(--bgTexture);
  background-repeat: repeat;
  background-size: 520px auto;
  opacity: var(--bgTextureOpacity);
  pointer-events:none;
  z-index:-1;
}

.tabs{display:flex; flex-wrap:wrap; gap:8px; margin: 10px 0 14px}
.tab{
  padding:10px 12px; border-radius: 14px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color:var(--muted);
  cursor:pointer;
  font-weight:800;
}
.tab.is-active{color:var(--text); border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.12)}

.orders{display:flex; flex-direction:column; gap:12px}
.order{
  border-radius: 16px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.14);
  padding:12px;
}
.order__top{display:flex; justify-content:space-between; align-items:flex-start; gap:10px}
.order__id{font-weight:900; font-size:16px}
.badge{
  font-size:12px; padding:6px 10px; border-radius: 999px;
  border:1px solid rgba(255,255,255,0.14);
  color:var(--muted);
}
.badge--new{border-color: rgba(14,165,233,0.35); background: rgba(14,165,233,0.12); color: #cfeaff}
.badge--preparing{border-color: rgba(245,158,11,0.40); background: rgba(245,158,11,0.14); color: #ffe6b8}
.badge--ready{border-color: rgba(34,197,94,0.40); background: rgba(34,197,94,0.14); color: #c9f7db}
.badge--cancelled{border-color: rgba(239,68,68,0.45); background: rgba(239,68,68,0.12); color: #ffd0d0}

.order__meta{margin-top:6px; color:var(--muted); font-size:12px}
.order__items{margin-top:10px; display:flex; flex-direction:column; gap:8px}
.order__line{display:flex; justify-content:space-between; gap:10px; font-size:14px}
.order__addons{margin-top:-4px; margin-left:12px; display:flex; flex-direction:column; gap:4px}
.order__addon{display:flex; justify-content:space-between; gap:10px; font-size:12px; color:var(--muted)}
.order__actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px}

.kpi{padding:18px}
.kpi__label{color:var(--muted); font-weight:800; font-size:12px}
.kpi__value{font-size:26px; font-weight:900; margin-top:6px}

.list{display:flex; flex-direction:column; gap:10px}
.list-item{
  display:flex; justify-content:space-between; gap:10px; align-items:center;
  padding:10px; border-radius: 14px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.14);
}
.list-item strong{font-weight:900}

.stock{display:flex; flex-direction:column; gap:10px}
.stock-item{
  display:flex; justify-content:space-between; gap:10px; align-items:center;
  padding:10px; border-radius: 14px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.14);
}
.stock-item.low{
  border-color: rgba(239,68,68,0.40);
  background: rgba(239,68,68,0.10);
}
.big-number{
  font-size:46px; font-weight:1000;
  letter-spacing:1px;
  margin:8px 0;
}
.actions{margin-top:10px; display:flex; gap:10px; flex-wrap:wrap}

.auth{min-height: calc(100vh - 160px); display:grid; place-items:center}
.auth__card{max-width:420px; width:100%}
code{background: rgba(255,255,255,0.10); padding:2px 6px; border-radius: 8px}

/* Fix: ensure <select> options are visible in dark theme (admin products/categories) */
select.input option,
select.input optgroup {
  background: #0b1220;
  color: #e5e7eb;
}


.theme-rustic .btn,
.theme-rustic .pill{
  border: 1px solid rgba(0,0,0,0.14);
}

.theme-rustic .btn--primary{
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.10)),
    var(--primary);
}

.theme-rustic .topbar{
  background: rgba(0,0,0,0.10);
}

.theme-cordel .brand__logo{
  border: 1px solid rgba(0,0,0,0.14);
}


/* === THEME OVERRIDES: NORDESTE (SERTÃO PESADO) === */
/* Aplica fundo "papel/terra" (sem o glow moderno) somente nos temas nordestinos */
body.theme-nordeste{
  background: var(--bg) !important;
  color: var(--text);
}
body.theme-nordeste::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  /* vinheta + luz de "sol" */
  background:
    radial-gradient(1200px 800px at 15% 15%, rgba(255,220,150,0.28), transparent 55%),
    radial-gradient(900px 700px at 85% 20%, rgba(180,56,12,0.18), transparent 58%),
    radial-gradient(1200px 900px at 50% 95%, rgba(59,31,14,0.20), transparent 60%),
    radial-gradient(100% 80% at 50% 50%, rgba(0,0,0,0.22), transparent 62%);
  mix-blend-mode:multiply;
  z-index:-1;
}
/* Cordel: textura mais presente e um pouco menor */
body.theme-cordel::before{
  background-size: 420px auto !important;
  opacity: var(--bgTextureOpacity);
}

/* Cards (admin/público) mais "raiz": contraste maior, borda quente */
body.theme-rustic .card,
body.theme-rustic .panel,
body.theme-rustic .pedido-card,
body.theme-rustic .pedido,
body.theme-rustic .box{
  background: rgba(255, 248, 235, 0.90);
  border: 1px solid rgba(59,31,14,0.20);
  box-shadow: 0 14px 34px rgba(59,31,14,.18);
}

/* Títulos com cara de "cordel" (sem depender de fonte externa) */
body.theme-rustic h1,
body.theme-rustic h2,
body.theme-rustic .page-title{
  letter-spacing: .2px;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}

/* Botões mais rústicos (somente nos temas rústicos) */
body.theme-rustic .btn,
body.theme-rustic button,
body.theme-rustic input[type="submit"]{
  background: linear-gradient(180deg, var(--primary), #8A2E0A);
  color:#fff;
  border:none;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(59,31,14,0.55);
}
body.theme-rustic .btn:hover,
body.theme-rustic button:hover,
body.theme-rustic input[type="submit"]:hover{
  filter: brightness(1.04);
}
body.theme-rustic .btn:active,
body.theme-rustic button:active,
body.theme-rustic input[type="submit"]:active{
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(59,31,14,0.55);
}

/* Tabs/pílulas mais "barro" */
body.theme-rustic .pill,
body.theme-rustic .tab,
body.theme-rustic .tabs button{
  border: 1px solid rgba(59,31,14,0.22);
  background: rgba(255,248,235,0.75);
}
body.theme-rustic .pill.is-active,
body.theme-rustic .tab.is-active,
body.theme-rustic .tabs button.is-active,
body.theme-rustic .tabs button.active{
  background: rgba(185,56,12,0.18);
  border-color: rgba(185,56,12,0.35);
}

/* ✅ Pedido: texto das categorias NÃO selecionadas deve ser escuro (não branco) */
body.theme-rustic .pill:not(.is-active),
body.theme-rustic .tab:not(.is-active),
body.theme-rustic .tabs button:not(.is-active):not(.active),
body.theme-rustic .tabs a:not(.is-active):not(.active){
  color: #2B1A12 !important;
}



/* =========================================================
   FIX: Campos (input/textarea) estourando a largura do card
   - Mantém o layout existente, só evita overflow em telas pequenas
   ========================================================= */
.input{
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.form__row{
  flex-wrap: wrap;
}

.form__col{
  min-width: 0;
}

/* =========================
   Animações de status (tela de sucesso)
   ========================= */
.status-anim{margin-top:14px;padding:14px;border-radius:var(--radius2);background:var(--card);border:1px solid rgba(2,6,23,.10);display:flex;align-items:center;justify-content:center;min-height:92px;overflow:hidden}
.status-anim__row{display:flex;align-items:center;justify-content:center;gap:12px;font-weight:900;font-size:18px;letter-spacing:.2px}
.status-anim__muted{font-weight:700;font-size:13px;color:var(--muted);margin-top:6px;text-align:center}
.status-anim__stack{display:flex;flex-direction:column;align-items:center;justify-content:center}

.pulse{animation:pulse 1.2s ease-in-out infinite}
.spin{animation:spin 1.1s linear infinite}
.shake{animation:shake .9s ease-in-out infinite}

.runner{position:relative;width:min(420px,92%);height:40px;border-radius:999px;background:rgba(2,6,23,.06);border:1px dashed rgba(2,6,23,.18);overflow:hidden}
.runner__obj{position:absolute;left:-60px;top:50%;transform:translateY(-50%);font-size:26px;animation:run 2.4s linear infinite}
.runner__dest{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-size:22px;opacity:.85}

@keyframes pulse{0%,100%{transform:scale(1);opacity:.92}50%{transform:scale(1.04);opacity:1}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}
@keyframes run{0%{transform:translate(-10px,-50%)}100%{transform:translate(calc(100% + 60px),-50%)}}
