/* ============================================================
   Painel Administrativo — Porteira
   Densidade operacional: tabelas grandes, edição inline, ações em massa.
   ============================================================ */

:root {
  --a-bg: #F4F5F7;
  --a-surface: #FFFFFF;
  --a-border: #E3E6EA;
  --a-text: #16191D;
  --a-muted: #6B7280;
  --a-primary: #8B1E1E;
  --a-accent: #D4A24C;
  --a-success: #15803D;
  --a-warn: #B45309;
  --a-danger: #B91C1C;
  --a-info: #1D4ED8;
  --a-sidebar: #16191D;
  --a-radius: 10px;
  --a-shadow: 0 1px 3px rgba(16,25,40,.09);
  --a-sidebar-w: 244px;
  --a-font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

.adm-body {
  margin: 0; font-family: var(--a-font); background: var(--a-bg);
  color: var(--a-text); font-size: 14px; line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { background: #EEF0F3; padding: 2px 6px; border-radius: 4px; font-size: 12.5px; }

/* ---------------- Layout ---------------- */
.adm-layout { display: flex; min-height: 100vh; }

.adm-sidebar {
  width: var(--a-sidebar-w); background: var(--a-sidebar); color: #E6E8EB;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0;
  z-index: 60; transition: transform .22s; overflow-y: auto;
}
.adm-brand {
  padding: 17px 18px; border-bottom: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.adm-brand img { width: 32px; height: 32px; border-radius: 7px; background: #fff; padding: 2px; }
.adm-brand strong { font-size: 14.5px; display: block; line-height: 1.2; }
.adm-brand span { font-size: 11px; color: rgba(255,255,255,.5); }

.adm-nav { padding: 10px 8px; flex: 1; }
.adm-nav-group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: rgba(255,255,255,.36); padding: 14px 12px 6px; font-weight: 700;
}
.adm-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 8px; font-size: 13.5px; color: rgba(255,255,255,.78);
  margin-bottom: 1px; transition: background .12s;
}
.adm-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.adm-nav a.active { background: var(--a-primary); color: #fff; font-weight: 600; }
.adm-nav a i { width: 17px; text-align: center; font-size: 13px; }
.adm-nav a .badge {
  margin-left: auto; background: rgba(255,255,255,.16); font-size: 10.5px;
  padding: 1px 7px; border-radius: 999px; font-weight: 700;
}

.adm-user {
  padding: 13px 16px; border-top: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.adm-avatar {
  width: 33px; height: 33px; border-radius: 50%; background: var(--a-primary);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
}
.adm-user-info { min-width: 0; flex: 1; }
.adm-user-info strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user-info span { font-size: 10.5px; color: rgba(255,255,255,.5); }

.adm-main { flex: 1; margin-left: var(--a-sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.adm-topbar {
  background: var(--a-surface); border-bottom: 1px solid var(--a-border);
  padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 40;
}
.adm-topbar h1 { font-size: 17px; }
.adm-topbar .spacer { flex: 1; }
.adm-burger { display: none; font-size: 18px; }

.adm-content { padding: 20px; flex: 1; }
.adm-content.wide { padding: 20px 16px; }

/* ---------------- Componentes ---------------- */
.adm-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--a-surface);
  border: 1px solid var(--a-border); color: var(--a-text); white-space: nowrap;
  transition: all .12s;
}
.adm-btn:hover { border-color: var(--a-primary); color: var(--a-primary); }
.adm-btn.primary { background: var(--a-primary); color: #fff; border-color: var(--a-primary); }
.adm-btn.primary:hover { filter: brightness(1.13); color: #fff; }
.adm-btn.danger { background: var(--a-danger); color: #fff; border-color: var(--a-danger); }
.adm-btn.danger:hover { filter: brightness(1.13); color: #fff; }
.adm-btn.sm { padding: 5px 10px; font-size: 12px; }
.adm-btn:disabled { opacity: .45; cursor: not-allowed; }

.adm-card {
  background: var(--a-surface); border: 1px solid var(--a-border);
  border-radius: var(--a-radius); box-shadow: var(--a-shadow); overflow: hidden;
}
.adm-card-head {
  padding: 14px 17px; border-bottom: 1px solid var(--a-border);
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
}
.adm-card-head h2 { font-size: 15px; }
.adm-card-head .spacer { flex: 1; }
.adm-card-body { padding: 17px; }

.adm-grid { display: grid; gap: 14px; }
.adm-grid.c2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.adm-grid.c3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.adm-grid.c4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* KPIs */
.kpi {
  background: var(--a-surface); border: 1px solid var(--a-border);
  border-radius: var(--a-radius); padding: 15px 16px; box-shadow: var(--a-shadow);
}
.kpi-label { font-size: 11.5px; color: var(--a-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .035em; }
.kpi-value { font-size: 25px; font-weight: 800; margin: 5px 0 3px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--a-muted); display: flex; align-items: center; gap: 5px; }
.kpi-sub .up { color: var(--a-success); font-weight: 700; }
.kpi-sub .down { color: var(--a-danger); font-weight: 700; }
.kpi-icon { float: right; font-size: 19px; opacity: .16; }

/* ---------------- Tabelas ---------------- */
.adm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.adm-table th {
  text-align: left; padding: 9px 11px; background: #F8F9FB; font-weight: 700;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--a-muted);
  border-bottom: 1px solid var(--a-border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.adm-table td { padding: 8px 11px; border-bottom: 1px solid #F0F2F4; vertical-align: middle; }
table.adm-table tbody tr:hover { background: #FAFBFC; }
table.adm-table tbody tr.selected { background: #FEF3F2; }
table.adm-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.adm-table .thumb {
  width: 38px; height: 38px; border-radius: 7px; object-fit: cover; background: #EEF0F3;
}
table.adm-table .thumb-none {
  width: 38px; height: 38px; border-radius: 7px; background: #EEF0F3;
  display: grid; place-items: center; color: #B6BCC4; font-size: 13px;
}

/* célula editável inline */
.cell-edit {
  min-width: 60px; padding: 4px 7px; border-radius: 5px; border: 1px solid transparent;
  cursor: text; display: block; transition: border-color .1s;
}
.cell-edit:hover { border-color: var(--a-border); background: #fff; }
.cell-edit:focus { border-color: var(--a-primary); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(139,30,30,.1); }
.cell-edit.saving { border-color: var(--a-info); }
.cell-edit.saved { border-color: var(--a-success); background: #F0FDF4; }
.cell-edit.error { border-color: var(--a-danger); background: #FEF2F2; }

/* pílulas de status */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pill-green { background: #DCFCE7; color: #14532D; }
.pill-red { background: #FEE2E2; color: #7F1D1D; }
.pill-amber { background: #FEF3C7; color: #78350F; }
.pill-blue { background: #DBEAFE; color: #1E3A8A; }
.pill-gray { background: #EEF0F3; color: #4B5563; }
.pill-purple { background: #F3E8FF; color: #6B21A8; }

/* barra de seleção em massa */
.bulk-bar {
  position: sticky; bottom: 0; z-index: 30; background: var(--a-sidebar); color: #fff;
  padding: 11px 16px; display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  border-radius: var(--a-radius); box-shadow: 0 -4px 18px rgba(16,25,40,.2); margin-top: 12px;
}
.bulk-bar[hidden] { display: none; }
.bulk-bar strong { font-size: 13.5px; }
.bulk-bar .adm-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.bulk-bar .adm-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ---------------- Formulários ---------------- */
.adm-field { margin-bottom: 14px; }
.adm-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
.adm-field .hint { font-size: 11.5px; color: var(--a-muted); font-weight: 400; margin-top: 4px; display: block; }
.adm-input, .adm-select, .adm-textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--a-border); border-radius: 8px;
  font: inherit; font-size: 13.5px; background: var(--a-surface); color: var(--a-text);
}
.adm-textarea { resize: vertical; min-height: 72px; }
.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
  border-color: var(--a-primary); outline: none; box-shadow: 0 0 0 3px rgba(139,30,30,.1);
}
.adm-row { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.adm-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; padding: 4px 0; }
.adm-check input { width: 17px; height: 17px; accent-color: var(--a-primary); }

.adm-filters {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding: 13px 17px; background: var(--a-surface); border: 1px solid var(--a-border);
  border-radius: var(--a-radius); margin-bottom: 14px;
}
.adm-filters .adm-input, .adm-filters .adm-select { width: auto; min-width: 135px; }
.adm-filters .grow { flex: 1; min-width: 190px; }

/* ---------------- Modal ---------------- */
.adm-modal-bg {
  position: fixed; inset: 0; background: rgba(16,20,26,.55); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto;
}
.adm-modal-bg.open { display: flex; }
.adm-modal {
  background: var(--a-surface); border-radius: 12px; width: 100%; max-width: 640px;
  box-shadow: 0 18px 50px rgba(16,25,40,.25); margin: auto;
}
.adm-modal.lg { max-width: 940px; }
.adm-modal-head {
  padding: 15px 19px; border-bottom: 1px solid var(--a-border);
  display: flex; align-items: center; gap: 11px;
}
.adm-modal-head h2 { font-size: 16px; flex: 1; }
.adm-modal-body { padding: 19px; max-height: 70vh; overflow-y: auto; }
.adm-modal-foot {
  padding: 13px 19px; border-top: 1px solid var(--a-border);
  display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap;
}

/* ---------------- Utilidades ---------------- */
.adm-empty-state { text-align: center; padding: 52px 20px; color: var(--a-muted); }
.adm-empty-state i { font-size: 38px; color: #D3D8DE; margin-bottom: 13px; }
.adm-empty-state h1, .adm-empty-state h3 { font-size: 17px; color: var(--a-text); margin-bottom: 7px; }

.adm-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; max-width: 340px; }
.adm-toast {
  background: var(--a-sidebar); color: #fff; padding: 12px 15px; border-radius: 9px;
  font-size: 13px; font-weight: 600; box-shadow: 0 6px 20px rgba(16,25,40,.25);
  display: flex; align-items: center; gap: 9px; animation: atin .22s;
}
.adm-toast.success { background: var(--a-success); }
.adm-toast.error { background: var(--a-danger); }
.adm-toast.warn { background: var(--a-warn); }
@keyframes atin { from { opacity: 0; transform: translateX(18px) } }

.adm-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--a-border); margin-bottom: 17px; overflow-x: auto; }
.adm-tab {
  padding: 9px 15px; font-size: 13.5px; font-weight: 600; color: var(--a-muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.adm-tab.active { color: var(--a-primary); border-bottom-color: var(--a-primary); }
.adm-tab:hover { color: var(--a-text); }

.adm-pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.adm-pagination a, .adm-pagination span {
  padding: 6px 11px; border-radius: 7px; font-size: 13px; border: 1px solid var(--a-border); background: var(--a-surface);
}
.adm-pagination .current { background: var(--a-primary); color: #fff; border-color: var(--a-primary); font-weight: 700; }

/* barras de progresso (analytics) */
.bar-row { display: flex; align-items: center; gap: 11px; padding: 7px 0; font-size: 13px; }
.bar-row .bar-label { width: 170px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-track { flex: 1; height: 9px; background: #EEF0F3; border-radius: 999px; overflow: hidden; min-width: 50px; }
.bar-row .bar-fill { height: 100%; background: var(--a-primary); border-radius: 999px; }
.bar-row .bar-value { width: 78px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* funil */
.funnel-step {
  display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid #F0F2F4;
}
.funnel-step:last-child { border-bottom: none; }
.funnel-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--a-primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 12.5px; flex-shrink: 0;
}
.funnel-body { flex: 1; min-width: 0; }
.funnel-name { font-weight: 600; font-size: 13.5px; }
.funnel-track { height: 7px; background: #EEF0F3; border-radius: 999px; margin-top: 5px; overflow: hidden; }
.funnel-fill { height: 100%; background: linear-gradient(90deg, var(--a-primary), var(--a-accent)); border-radius: 999px; }
.funnel-stats { text-align: right; flex-shrink: 0; }
.funnel-stats strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.funnel-stats span { font-size: 11.5px; color: var(--a-muted); }

/* login */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 22px;
  background: linear-gradient(135deg, #16191D, #2C2422);
}
.login-card {
  background: #fff; border-radius: 14px; padding: 30px; width: 100%; max-width: 390px;
  box-shadow: 0 20px 55px rgba(0,0,0,.3);
}
.login-card h1 { font-size: 20px; margin-bottom: 5px; }
.login-card .sub { font-size: 13.5px; color: var(--a-muted); margin-bottom: 22px; }
.login-error {
  background: #FEF2F2; color: #991B1B; padding: 10px 13px; border-radius: 8px;
  font-size: 13px; margin-bottom: 15px; border: 1px solid #FECACA;
}
.login-hint {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--a-border);
  font-size: 11.5px; color: var(--a-muted); line-height: 1.7;
}

/* diff de auditoria */
.diff-old { background: #FEE2E2; color: #7F1D1D; padding: 1px 6px; border-radius: 4px; text-decoration: line-through; }
.diff-new { background: #DCFCE7; color: #14532D; padding: 1px 6px; border-radius: 4px; }

/* QR */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.qr-card {
  background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius);
  padding: 15px; text-align: center; box-shadow: var(--a-shadow);
}
.qr-card svg, .qr-card canvas { width: 130px; height: 130px; margin: 0 auto 10px; display: block; }
.qr-card strong { display: block; font-size: 13px; margin-bottom: 3px; }
.qr-card small { color: var(--a-muted); font-size: 11.5px; }
.qr-actions { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }

/* preview de importação */
.import-steps { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.import-step {
  flex: 1; min-width: 110px; padding: 10px 12px; border-radius: 8px; background: #F8F9FB;
  border: 1px solid var(--a-border); font-size: 12.5px; font-weight: 600; color: var(--a-muted);
}
.import-step.active { background: var(--a-primary); color: #fff; border-color: var(--a-primary); }
.import-step.done { background: #DCFCE7; color: #14532D; border-color: #A7F3D0; }
.import-step .n { font-weight: 800; margin-right: 5px; }

.row-new { background: #F0FDF4 !important; }
.row-update { background: #EFF6FF !important; }
.row-error { background: #FEF2F2 !important; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1023px) {
  .adm-sidebar { transform: translateX(-100%); box-shadow: 8px 0 30px rgba(0,0,0,.2); }
  .adm-sidebar.open { transform: translateX(0); }
  .adm-main { margin-left: 0; }
  .adm-burger { display: block; }
  .adm-content { padding: 15px; }
  .bar-row .bar-label { width: 115px; }
}

@media (max-width: 640px) {
  .adm-topbar h1 { font-size: 15px; }
  .kpi-value { font-size: 21px; }
  .adm-modal-body { max-height: 62vh; }
}

/* ============================================================
   CARDÁPIO UNIFICADO (v2)
   Categoria é o contêiner; o item vive dentro dela.
   ============================================================ */
.menu-toolbar {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.menu-toolbar-right { display: flex; gap: 10px; align-items: center; }

.menu-tree { display: flex; flex-direction: column; gap: 10px; }

/* ---------------- Categoria ---------------- */
.menu-cat {
  background: var(--a-surface); border: 1px solid var(--a-border);
  border-radius: var(--a-radius); box-shadow: var(--a-shadow); overflow: hidden;
}
.menu-cat.is-off { border-left: 3px solid var(--a-warn); }

.mc-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; cursor: pointer; transition: background .15s;
}
.mc-head:hover { background: #FAFBFC; }
.menu-cat.is-open .mc-head { border-bottom: 1px solid var(--a-border); }

.mc-toggle {
  width: 26px; height: 26px; flex: none; border-radius: 6px; color: var(--a-muted);
  display: grid; place-items: center; transition: transform .18s, background .15s;
}
.mc-toggle:hover { background: #EEF0F3; }
.menu-cat.is-open .mc-toggle { transform: rotate(90deg); }

.mc-drag { color: #C6CCD3; cursor: grab; flex: none; }
.mc-title { flex: 1; min-width: 0; }
.mc-name {
  font-size: 15.5px; font-weight: 700; display: inline-block;
  padding: 1px 4px; margin: -1px -4px; border-radius: 4px;
}
.mc-name[contenteditable]:hover { background: #F1F3F5; }
.mc-name[contenteditable]:focus { background: #fff; box-shadow: 0 0 0 2px var(--a-accent); outline: none; }

.mc-sub { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.mc-hours {
  font-size: 12px; font-weight: 600; color: var(--a-muted);
  background: #EEF0F3; padding: 2px 8px; border-radius: 20px;
}
.mc-hours.is-live { background: #DCFCE7; color: #14532D; }
.mc-hours-all { background: transparent; padding-left: 0; }
.mc-count { font-size: 12px; color: var(--a-muted); }

.mc-actions { display: flex; gap: 5px; align-items: center; flex: none; }
.mc-body { list-style: none; margin: 0; padding: 0; }
.mc-empty { padding: 20px 18px; color: var(--a-muted); font-size: 13px; }

/* ---------------- Item ---------------- */
.menu-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 15px; border-bottom: 1px solid #F0F2F4;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #FBFCFD; }
.menu-item.is-hidden { opacity: .58; }
.menu-item.is-out { background: #FEF7F2; }

.mi-drag { color: #CBD1D8; cursor: grab; flex: none; padding: 4px; }
.mi-thumb {
  width: 46px; height: 46px; flex: none; border-radius: 7px;
  object-fit: cover; background: #EEF0F3;
}
.mi-thumb-empty { display: grid; place-items: center; color: #C3C9D0; font-size: 15px; }

.mi-main { flex: 1; min-width: 0; }
.mi-name { display: flex; align-items: center; gap: 7px; }
.mi-star {
  flex: none; width: 24px; height: 24px; border-radius: 5px;
  color: #C3C9D0; display: grid; place-items: center; transition: all .15s;
}
.mi-star:hover { background: #FDF6E7; color: var(--a-accent); }
.mi-star.is-on { color: #E8A33D; }
.mi-star:disabled { opacity: .5; }

.mi-title {
  font-weight: 600; font-size: 14px; padding: 1px 4px; margin: -1px -4px;
  border-radius: 4px; overflow-wrap: anywhere;
}
.mi-title[contenteditable]:hover { background: #F1F3F5; }
.mi-title[contenteditable]:focus { background: #fff; box-shadow: 0 0 0 2px var(--a-accent); outline: none; }
.mi-title.is-saving { opacity: .55; }
.mi-title.is-saved { background: #DCFCE7; }

.mi-desc {
  margin: 2px 0 0; font-size: 12.5px; color: var(--a-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62ch;
}
.mi-meta { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.mi-price { font-size: 13px; font-weight: 700; }
.mi-price s { color: var(--a-muted); font-weight: 500; margin-right: 4px; }
.mi-tag {
  font-size: 11.5px; color: var(--a-muted); background: #F1F3F5;
  padding: 2px 7px; border-radius: 20px; font-weight: 600;
}
.mi-tag-warn { background: #FEF3C7; color: #92400E; }
.mi-badge {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .3px;
}
.mi-badge-out { background: #FEE2E2; color: #991B1B; }
.mi-badge-off { background: #E5E7EB; color: #4B5563; }

.mi-actions { display: flex; gap: 3px; flex: none; }
.mi-btn {
  width: 30px; height: 30px; border-radius: 6px; color: var(--a-muted);
  display: grid; place-items: center; font-size: 12.5px; transition: all .14s;
}
.mi-btn:hover { background: #EEF0F3; color: var(--a-text); }
.mi-btn-danger:hover { background: #FEE2E2; color: var(--a-danger); }
.mi-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- Formulários do editor ---------------- */
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.fld-wide { grid-column: 1 / -1; }
.fld label, .fld-sm { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.fld-sm { margin-top: 9px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chk-sm { font-size: 12px; white-space: nowrap; }
.sect-title {
  font-size: 13.5px; margin: 20px 0 11px; padding-top: 15px;
  border-top: 1px solid var(--a-border); color: var(--a-text);
}
.sect-title i { color: var(--a-muted); margin-right: 6px; }

/* ---------------- Abas ---------------- */
.tabbar {
  display: flex; gap: 3px; border-bottom: 1px solid var(--a-border);
  margin: -4px -4px 18px; padding: 0 4px;
}
.tab {
  padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--a-muted);
  border-bottom: 2px solid transparent; transition: all .15s; white-space: nowrap;
}
.tab:hover { color: var(--a-text); }
.tab.is-on { color: var(--a-primary); border-bottom-color: var(--a-primary); }
.tab i { margin-right: 5px; font-size: 11.5px; }

/* ---------------- Upload de foto ---------------- */
.photo-box { display: flex; gap: 15px; align-items: flex-start; margin-top: 6px; }
.photo-prev {
  width: 104px; height: 104px; flex: none; border-radius: 9px; overflow: hidden;
  background: #EEF0F3; border: 1px solid var(--a-border);
}
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { width: 100%; height: 100%; display: grid; place-items: center; color: #C3C9D0; font-size: 26px; }
.photo-ctl { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.up-prog { font-size: 12px; color: var(--a-info); font-weight: 600; }
.up-ok { font-size: 12px; color: var(--a-success); font-weight: 600; }
.up-err { font-size: 12px; color: var(--a-danger); font-weight: 600; }

/* ---------------- Janelas de horário ---------------- */
.avail-block { margin-top: 6px; }
.avail-head { margin-bottom: 11px; }
.win-row {
  border: 1px solid var(--a-border); border-radius: 9px;
  padding: 12px; margin-bottom: 9px; background: #FAFBFC;
}
.win-times { display: flex; gap: 11px; align-items: flex-end; flex-wrap: wrap; }
.win-times label { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin: 0; }
.win-times .adm-input { width: 118px; }
.win-times .mi-btn { margin-left: auto; }
.win-days { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 11px; }
.day-chip {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--a-border); background: #fff; cursor: pointer;
  color: var(--a-muted); transition: all .14s; user-select: none;
}
.day-chip input { display: none; }
.day-chip:hover { border-color: var(--a-primary); }
.day-chip.is-on { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
/* [hidden] tem especificidade menor que `display:flex`, então
   sem esta regra o bloco de datas continuaria visível. */
[hidden] { display: none !important; }
.win-dates { display: flex; gap: 11px; margin-top: 11px; flex-wrap: wrap; }
.win-dates label { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.win-dates .adm-input { width: 155px; }
.win-dates-toggle { font-size: 11.5px; margin-top: 8px; display: inline-block; }
.adm-link {
  color: var(--a-info); font-size: 12px; font-weight: 600; text-decoration: underline;
  background: none; border: none; padding: 0; cursor: pointer;
}

/* ---------------- Grupos de complementos ---------------- */
.grp-card {
  border: 1px solid var(--a-border); border-radius: 9px;
  padding: 13px; margin-bottom: 11px; background: #FAFBFC;
}
.grp-card.is-shared { background: #F5F8FF; border-color: #C7D7FB; }
.grp-shared-note { margin: 8px 0 0; color: var(--a-info); }
.grp-head { display: flex; gap: 9px; align-items: center; }
.grp-head .grp-name { flex: 1; font-weight: 600; }
.grp-rules { display: flex; gap: 11px; margin-top: 11px; flex-wrap: wrap; }
.grp-rules label { font-size: 12px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.grp-rules .adm-input { width: 92px; }
.grp-rules .adm-select { width: 165px; }
.grp-opts { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.opt-row { display: flex; gap: 7px; align-items: center; }
.opt-row .opt-name { flex: 1; }
.opt-row .opt-price { width: 112px; }
.grp-add-opt { margin-top: 9px; }
.grp-foot { display: flex; gap: 9px; margin-top: 6px; flex-wrap: wrap; }
.pick-list { display: flex; flex-direction: column; gap: 5px; max-height: 340px; overflow-y: auto; }
.pick-row {
  display: flex; gap: 9px; align-items: center; padding: 9px 11px;
  border: 1px solid var(--a-border); border-radius: 7px; font-size: 13px; cursor: pointer;
}
.pick-row:hover { border-color: var(--a-primary); }
.pick-row.is-off { opacity: .5; cursor: default; }
.pick-row em { color: var(--a-muted); font-size: 11.5px; }

/* ---------------- Unidades ---------------- */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 11px; }
.unit-card {
  border: 1px solid var(--a-border); border-radius: 9px; padding: 12px; background: #FAFBFC;
}
.unit-card-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.unit-card-head strong { font-size: 13.5px; }
.switch { position: relative; display: inline-flex; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  width: 38px; height: 21px; border-radius: 20px; background: #CBD1D8;
  display: block; transition: background .18s; position: relative;
}
.switch-dot {
  position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.22);
}
.switch input:checked + .switch-track { background: var(--a-success); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--a-accent); outline-offset: 2px; }

/* ---------------- Disponibilidade rápida ---------------- */
.qa-list { display: flex; flex-direction: column; gap: 7px; }
.qa-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--a-border); border-radius: 8px;
}
.qa-name { flex: 1; font-weight: 600; font-size: 13.5px; }
.qa-state { font-size: 12px; font-weight: 700; color: var(--a-success); }
.qa-state.is-out { color: var(--a-danger); }

.adm-loading { padding: 34px; text-align: center; color: var(--a-muted); font-size: 13.5px; }
.adm-empty { padding: 46px 20px; text-align: center; color: var(--a-muted); }
.adm-empty i { font-size: 32px; color: #D3D8DE; margin-bottom: 12px; display: block; }

@media (max-width: 720px) {
  .fld-grid { grid-template-columns: 1fr; }
  .menu-item { flex-wrap: wrap; }
  .mi-actions { width: 100%; justify-content: flex-end; }
  .mc-actions .adm-btn span { display: none; }
  .photo-box { flex-direction: column; }
}

/* Escopo de unidade da categoria */
.mc-scope {
  font-size: 11.5px; font-weight: 700; color: #1E3A5F;
  background: #DBEAFE; padding: 2px 8px; border-radius: 20px;
}
.cu-grid { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.cu-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--a-border); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--a-muted);
  transition: all .14s; user-select: none;
}
.cu-chip input { display: none; }
.cu-chip:hover { border-color: var(--a-primary); }
.cu-chip.is-on { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.cu-chip i { font-size: 11px; }

/* ============================================================
   REORDENAR E ATUALIZAR NO LUGAR
   ============================================================ */

/* Alças: viram "pegáveis" ao passar o mouse */
.mi-drag, .mc-drag {
  cursor: grab; border-radius: 5px; background: none; border: none;
  transition: background .14s, color .14s;
}
.mi-drag:hover, .mc-drag:hover { background: #EEF0F3; color: var(--a-text); }
.mi-drag:active, .mc-drag:active { cursor: grabbing; }
.mi-drag:focus-visible, .mc-drag:focus-visible {
  outline: 2px solid var(--a-accent); outline-offset: 1px; background: #FDF6E7;
}

/* Elemento sendo arrastado */
.menu-item.is-dragging, .menu-cat.is-dragging {
  opacity: .42; outline: 2px dashed var(--a-primary); outline-offset: -2px;
}
/* Ao arrastar, o alvo de soltar precisa aceitar o ponteiro */
.menu-cat.is-dragging * { pointer-events: none; }

/* Confirmação visual de que a linha foi salva/movida */
@keyframes admFlash {
  0%   { background: #DCFCE7; }
  100% { background: transparent; }
}
.menu-item.just-saved, .menu-cat.just-saved > .mc-head { animation: admFlash 1.6s ease-out; }
.menu-item.just-moved { animation: admFlash .7s ease-out; }

/* Remoção suave em vez de recarregar a página */
.menu-item, .menu-cat { transition: opacity .18s ease; }

/* Dica de teclado ao focar a alça */
.mi-drag:focus-visible::after, .mc-drag:focus-visible::after {
  content: '↑↓ move';
  position: absolute; margin-left: 30px; margin-top: -2px;
  background: var(--a-sidebar); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px; white-space: nowrap; z-index: 5;
}
.menu-item, .mc-head { position: relative; }

/* Arraste inicia só pela alça: o texto continua selecionável/editável */
.menu-cat, .menu-item { -webkit-user-drag: none; }
.mi-drag, .mc-drag { -webkit-user-drag: element; touch-action: none; }
.menu-cat.is-grabbing, .menu-item.is-grabbing { cursor: grabbing; }
.menu-cat.is-grabbing .mc-name,
.menu-item.is-grabbing .mi-title { user-select: none; }
/* Enquanto arrasta a categoria, o cabeçalho não deve virar alvo de clique */
.menu-cat.is-dragging .mc-head { pointer-events: none; }

/* Controles de mover: setas sempre funcionam; arrastar é atalho */
.move-ctl {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 1px; flex: none;
}
.move-btn {
  width: 22px; height: 15px; border-radius: 3px; border: none; background: none;
  color: #B9C0C8; font-size: 9px; cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: all .13s;
}
.move-btn:hover { background: var(--a-primary); color: #fff; }
.move-btn:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 1px; }
.move-ctl .mi-drag, .move-ctl .mc-drag {
  width: 22px; height: 18px; font-size: 10px; padding: 0;
}
/* em telas estreitas as setas bastam; a alça de arraste sai */
@media (max-width: 720px) {
  .move-ctl .mi-drag, .move-ctl .mc-drag { display: none; }
  .move-btn { height: 20px; font-size: 11px; }
}

/* Selos do cardápio no editor de item */
.selo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.selo-chip {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 11px 13px; border: 1px solid var(--a-border); border-radius: 9px;
  background: #fff; transition: all .14s;
}
.selo-chip input { display: none; }
.selo-chip > i { font-size: 16px; color: #C3C9D0; width: 20px; text-align: center; transition: color .14s; }
.selo-chip span { display: flex; flex-direction: column; gap: 1px; }
.selo-chip strong { font-size: 13.5px; font-weight: 700; }
.selo-chip em { font-size: 11.5px; color: var(--a-muted); font-style: normal; }
.selo-chip:hover { border-color: var(--a-primary); }
.selo-chip.is-on { border-color: var(--a-primary); background: #FDF6F6; }
.selo-chip.is-on > i { color: var(--a-primary); }

/* Selos na listagem */
.mi-badge-hot { background: #FED7AA; color: #7C2D12; }
.mi-badge-new { background: #A7F3D0; color: #065F46; }

/* ============================================================
   SELOS — estado explícito (Ativado / Desativado)
   Antes o estado era só uma borda colorida: sem referência, não
   dava para saber se o selo estava ligado.
   ============================================================ */
.selo-chip { position: relative; padding: 12px 13px; }
.selo-ico { font-size: 16px; color: #C3C9D0; width: 20px; text-align: center; flex: none; }
.selo-txt { flex: 1; min-width: 0; }
.selo-sw { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.selo-sw input { position: absolute; opacity: 0; pointer-events: none; }
.selo-estado {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .3px; color: var(--a-muted);
}
.selo-sw .switch-track { width: 36px; height: 20px; background: #CBD1D8; }
.selo-sw .switch-dot { width: 15px; height: 15px; top: 2.5px; left: 2.5px; }
.selo-chip.is-on .switch-track { background: var(--a-success); }
.selo-chip.is-on .switch-dot { transform: translateX(16px); }
.selo-chip.is-on .selo-estado { color: var(--a-success); }
.selo-chip.is-on .selo-ico { color: var(--a-primary); }
.selo-chip input:focus-visible + .switch-track {
  outline: 2px solid var(--a-accent); outline-offset: 2px;
}

/* Selos clicáveis na listagem: desligado fica apagado, ligado colorido */
.mi-toggle {
  cursor: pointer; border: 1px dashed #D3D8DE; background: transparent;
  color: #A8B0B9; transition: all .15s; font-family: inherit;
}
.mi-toggle:hover { border-style: solid; border-color: currentColor; }
.mi-toggle:disabled { opacity: .5; cursor: wait; }
.mi-toggle.is-on { border-style: solid; border-color: transparent; }
.mi-badge-hot.is-on { background: #FED7AA; color: #7C2D12; }
.mi-badge-new.is-on { background: #A7F3D0; color: #065F46; }
/* sem a classe is-on o fundo colorido não se aplica */
.mi-badge-hot:not(.is-on):not(span), .mi-badge-new:not(.is-on):not(span) { background: transparent; }
.mi-toggle:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 1px; }

/* ============================================================
   GALERIA DO BANNER (rodízio de imagens)
   ============================================================ */
.ban-gal {
  display: flex; gap: 9px; flex-wrap: wrap; margin: 7px 0 9px;
  min-height: 74px; padding: 9px; border: 1px dashed var(--a-border);
  border-radius: 9px; background: #FAFBFC;
}
.ban-vazio { margin: 0; color: var(--a-muted); font-size: 12.5px; align-self: center; }
.ban-foto {
  position: relative; width: 116px; height: 58px; border-radius: 7px;
  overflow: hidden; border: 1px solid var(--a-border); background: #EEF0F3; flex: none;
}
.ban-foto img { width: 100%; height: 100%; object-fit: cover; }
.ban-tag, .ban-num {
  position: absolute; top: 3px; left: 3px; font-size: 9.5px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .3px;
}
.ban-tag { background: var(--a-primary); color: #fff; }
.ban-num { background: rgba(0,0,0,.6); color: #fff; }
.ban-btns {
  position: absolute; inset: auto 0 0 0; display: flex; justify-content: center; gap: 3px;
  padding: 3px; background: linear-gradient(transparent, rgba(0,0,0,.6));
  opacity: 0; transition: opacity .15s;
}
.ban-foto:hover .ban-btns, .ban-foto:focus-within .ban-btns { opacity: 1; }
.ban-b {
  width: 20px; height: 20px; border-radius: 4px; border: none; cursor: pointer;
  background: rgba(255,255,255,.9); color: #16191D; font-size: 9px;
  display: grid; place-items: center;
}
.ban-b:hover { background: #fff; }
.ban-x:hover { background: var(--a-danger); color: #fff; }
.ban-gal-acoes { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.ban-prog { font-size: 12px; color: var(--a-info); font-weight: 600; }
.ban-ok { font-size: 12px; color: var(--a-success); font-weight: 600; }
.rot-row { display: flex; align-items: center; gap: 8px; }
.rot-row .adm-input { width: 88px; }
.rot-row span { font-size: 13px; color: var(--a-muted); }
/* contagem de imagens na tabela de banners */
.ban-count {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  font-weight: 700; background: #DBEAFE; color: #1E3A5F;
  padding: 2px 7px; border-radius: 20px; margin-left: 6px;
}

/* ============================================================
   RECORTE DE BANNER
   Moldura 3:1 (desktop) com faixa tracejada marcando o 2:1 do
   celular. Um arraste resolve as duas telas.
   ============================================================ */
.rec-fundo {
  position: fixed; inset: 0; z-index: 1200; background: rgba(12,10,9,.78);
  display: grid; place-items: center; padding: 16px; overflow: auto;
}
.rec-caixa {
  background: var(--a-card, #fff); border-radius: 12px; width: min(820px, 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.4); overflow: hidden;
}
.rec-topo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--a-border, #e5e7eb);
}
.rec-topo strong { font-size: 15px; }
.rec-fechar {
  width: 30px; height: 30px; border: none; background: transparent; cursor: pointer;
  border-radius: 6px; color: var(--a-muted, #6b7280); font-size: 15px;
}
.rec-fechar:hover { background: var(--a-bg, #f3f4f6); }

.rec-palco { position: relative; background: #1a1614; padding: 0; line-height: 0; }
#rec-canvas { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
#rec-canvas.is-grab { cursor: grabbing; }
#rec-canvas:focus-visible { outline: 3px solid var(--a-info, #2563eb); outline-offset: -3px; }

/* guias por cima da moldura, sem capturar o clique */
.rec-guia { position: absolute; inset: 0; pointer-events: none; }
/* a zona segura é o centro 2:1 dentro do 3:1 -> 2/3 da largura */
.rec-segura {
  position: absolute; top: 0; bottom: 0; left: 16.666%; width: 66.667%;
  border-left: 2px dashed rgba(255,255,255,.95);
  border-right: 2px dashed rgba(255,255,255,.95);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.28);
}
.rec-segura span {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
  color: #fff; background: rgba(0,0,0,.66); padding: 3px 9px; border-radius: 20px;
  line-height: 1.4;
}

.rec-dica {
  margin: 0; padding: 11px 16px; font-size: 12.5px; line-height: 1.5;
  color: var(--a-muted, #6b7280); background: var(--a-bg, #f9fafb);
  border-bottom: 1px solid var(--a-border, #e5e7eb);
}
.rec-dica b { color: var(--a-text, #16191D); }

.rec-controles {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px 9px;
}
.rec-controles label { font-size: 12.5px; font-weight: 600; }
#rec-zoom { flex: 1; accent-color: var(--a-primary, #b91c1c); }

.rec-info {
  display: flex; flex-direction: column; gap: 4px; padding: 0 16px 13px;
  font-size: 12px; line-height: 1.5;
}
.rec-info span { display: flex; align-items: center; gap: 6px; }
.rec-orig, .rec-saida { color: var(--a-muted, #6b7280); }
.rec-info b { color: var(--a-text, #16191D); }
.rec-ok { color: var(--a-success, #047857); font-weight: 600; }
.rec-alerta { color: var(--a-warn, #b45309); font-weight: 600; }

.rec-acoes {
  display: flex; justify-content: flex-end; gap: 9px; padding: 12px 16px;
  border-top: 1px solid var(--a-border, #e5e7eb); background: var(--a-bg, #f9fafb);
}

/* miniatura na galeria: marca quem já tem recorte de celular */
.ban-mob {
  position: absolute; bottom: 4px; left: 4px; font-size: 9px; font-weight: 700;
  background: rgba(4,120,87,.92); color: #fff; padding: 2px 6px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 3px;
}
.ban-semmob {
  position: absolute; bottom: 4px; left: 4px; font-size: 9px; font-weight: 700;
  background: rgba(180,83,9,.92); color: #fff; padding: 2px 6px; border-radius: 20px;
}
.ban-res {
  position: absolute; bottom: 4px; right: 4px; font-size: 9px; font-weight: 700;
  background: rgba(0,0,0,.72); color: #fff; padding: 2px 6px; border-radius: 20px;
}
/* dimensões recomendadas em destaque no editor */
.ban-espec {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 7px 0 0;
  padding: 9px 11px; border-radius: 8px; background: #EFF6FF;
  border: 1px solid #BFDBFE; font-size: 12px; line-height: 1.5;
}
.ban-espec b { color: #1E3A5F; }
.ban-espec code {
  background: #fff; border: 1px solid #BFDBFE; border-radius: 4px;
  padding: 1px 5px; font-size: 11.5px; font-weight: 700; color: #1E3A5F;
}
.rec-mover { color: var(--a-info, #2563eb); }
.rec-mover b { color: var(--a-info, #2563eb); }
