/* ============================================================
   eHamburguers ADM — Painel Administrativo
   eSysMint - Wesley Fernando Mendonça
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Poppins:wght@500;600;700&display=swap');

:root {
  --adm-sidebar-w:  240px;
  --adm-navbar-h:   60px;
  --adm-bg:         #f0f2f5;
  --adm-surface:    #ffffff;
  --adm-sidebar-bg: #1a1a2e;
  --adm-sidebar-hover: rgba(255,255,255,.08);
  --adm-sidebar-active: rgba(62,180,137,.2);
  --adm-primary:    #3EB489;
  --adm-primary-dk: #2A7A5E;
  --adm-accent:     #FF6B2B;
  --adm-text:       #1c1c1e;
  --adm-text-sec:   #5a5a6e;
  --adm-text-muted: #9a9aaa;
  --adm-border:     #e2e8f0;
  --adm-radius:     12px;
  --adm-radius-sm:  8px;
  --adm-shadow:     0 2px 12px rgba(0,0,0,.06);
  --adm-shadow-md:  0 4px 24px rgba(0,0,0,.10);
  --font-body:      'Nunito', sans-serif;
  --font-head:      'Poppins', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--adm-bg);
  color: var(--adm-text);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.adm-sidebar {
  width: var(--adm-sidebar-w);
  background: var(--adm-sidebar-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s;
}

.adm-sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.adm-sidebar-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--adm-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #fff; flex-shrink: 0;
}

.adm-sidebar-brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .875rem;
  color: #fff;
  line-height: 1.3;
}
.adm-sidebar-brand small {
  display: block;
  font-size: .68rem;
  color: rgba(255,255,255,.45);
  font-weight: 400;
}

.adm-nav { padding: .75rem 0; flex: 1; overflow-y: auto; }

.adm-nav-section {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: .875rem 1rem .375rem;
}

.adm-nav-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem 1rem;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  margin: 1px .5rem;
  transition: all .2s;
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 1rem);
  font-family: var(--font-body);
}

.adm-nav-item .bi { font-size: 1.05rem; flex-shrink: 0; }
.adm-nav-item:hover { background: var(--adm-sidebar-hover); color: #fff; }
.adm-nav-item.active {
  background: var(--adm-sidebar-active);
  color: var(--adm-primary);
}

.adm-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.adm-admin-info {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
}

.adm-admin-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--adm-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}

.adm-admin-name  { font-size: .82rem; font-weight: 700; color: #fff; }
.adm-admin-perfil { font-size: .68rem; color: rgba(255,255,255,.45); }

/* ── Main content ─────────────────────────────────────────── */
.adm-main {
  margin-left: var(--adm-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────── */
.adm-topbar {
  height: var(--adm-navbar-h);
  background: var(--adm-surface);
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--adm-shadow);
}

.adm-topbar-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
}

.adm-topbar-actions { display: flex; align-items: center; gap: .5rem; }

.adm-btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--adm-bg);
  color: var(--adm-text-sec);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.adm-btn-icon:hover { background: var(--adm-primary); color: #fff; }

/* Loja status badge */
.loja-badge {
  display: flex; align-items: center; gap: .375rem;
  font-size: .78rem; font-weight: 700;
  padding: .3rem .875rem;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  transition: all .2s;
  font-family: var(--font-body);
}
.loja-badge.aberta  { background: #dcfce7; color: #166534; }
.loja-badge.fechada { background: #fee2e2; color: #991b1b; }
.loja-badge:hover { opacity: .85; }

/* ── Conteúdo ─────────────────────────────────────────────── */
.adm-content { padding: 1.5rem; flex: 1; }

/* ── Cards de métrica ─────────────────────────────────────── */
.adm-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.adm-metric-card {
  background: var(--adm-surface);
  border-radius: var(--adm-radius);
  padding: 1.25rem;
  border: 1px solid var(--adm-border);
  box-shadow: var(--adm-shadow);
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.adm-metric-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--adm-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.adm-metric-value {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--adm-text);
  line-height: 1.2;
}

.adm-metric-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: .375rem;
}

.adm-metric-sub {
  font-size: .75rem;
  color: var(--adm-text-muted);
  margin-top: .125rem;
}

/* ── Cards genéricos ──────────────────────────────────────── */
.adm-card {
  background: var(--adm-surface);
  border-radius: var(--adm-radius);
  border: 1px solid var(--adm-border);
  box-shadow: var(--adm-shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.adm-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.adm-card-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.adm-card-title .bi { color: var(--adm-primary); }

.adm-card-body { padding: 1.25rem; }

/* ── Tabela ───────────────────────────────────────────────── */
.adm-table-wrap { overflow-x: auto; }

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.adm-table th {
  background: #f8fafc;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--adm-text-muted);
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--adm-border);
  white-space: nowrap;
}

.adm-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--adm-border);
  vertical-align: middle;
}

.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: #f8fafc; }

/* ── Status badges ────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .625rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-aguardando   { background: #fef9c3; color: #854d0e; }
.status-confirmado   { background: #dbeafe; color: #1e40af; }
.status-em_preparo   { background: #ffedd5; color: #9a3412; }
.status-saiu_entrega { background: #f3e8ff; color: #6b21a8; }
.status-entregue     { background: #dcfce7; color: #166534; }
.status-cancelado    { background: #fee2e2; color: #991b1b; }

/* ── Botões ───────────────────────────────────────────────── */
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  font-family: var(--font-body);
  white-space: nowrap;
}

.adm-btn-primary { background: var(--adm-primary); color: #fff; }
.adm-btn-primary:hover { background: var(--adm-primary-dk); }

.adm-btn-danger  { background: #fee2e2; color: #991b1b; }
.adm-btn-danger:hover { background: #ef4444; color: #fff; }

.adm-btn-warning { background: #fef9c3; color: #854d0e; }
.adm-btn-warning:hover { background: #eab308; color: #fff; }

.adm-btn-ghost   { background: var(--adm-bg); color: var(--adm-text-sec); }
.adm-btn-ghost:hover { background: var(--adm-border); }

.adm-btn-sm { padding: .3rem .75rem; font-size: .75rem; }
.adm-btn-lg { padding: .75rem 1.5rem; font-size: .95rem; }

/* ── Formulários ──────────────────────────────────────────── */
.adm-form-group { margin-bottom: 1rem; }

.adm-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--adm-text-sec);
  margin-bottom: .375rem;
}
.adm-label .req { color: #ef4444; }

.adm-input, .adm-select, .adm-textarea {
  width: 100%;
  padding: .6rem .875rem;
  border: 1.5px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  background: #fff;
  color: var(--adm-text);
  font-family: var(--font-body);
  font-size: .875rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(62,180,137,.12);
}

.adm-textarea { resize: vertical; min-height: 80px; }

.adm-input-hint {
  font-size: .72rem;
  color: var(--adm-text-muted);
  margin-top: .25rem;
}

/* ── Flash messages ───────────────────────────────────────── */
.adm-flash {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .75rem 1rem;
  border-radius: var(--adm-radius-sm);
  margin-bottom: 1rem;
  font-size: .875rem;
  font-weight: 600;
}
.adm-flash.success { background: #dcfce7; color: #166534; border-left: 3px solid #22c55e; }
.adm-flash.error   { background: #fee2e2; color: #991b1b; border-left: 3px solid #ef4444; }
.adm-flash.warning { background: #fef9c3; color: #854d0e; border-left: 3px solid #eab308; }
.adm-flash.info    { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }

/* ── Switch toggle ────────────────────────────────────────── */
.adm-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.adm-switch input { opacity: 0; width: 0; height: 0; }
.adm-switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1; border-radius: 50px; transition: .2s;
}
.adm-switch-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.adm-switch input:checked + .adm-switch-slider { background: var(--adm-primary); }
.adm-switch input:checked + .adm-switch-slider::before { transform: translateX(20px); }

/* ── Paginação ────────────────────────────────────────────── */
.adm-pagination {
  display: flex;
  align-items: center;
  gap: .375rem;
  justify-content: center;
  padding: 1rem 0;
}
.adm-page-btn {
  width: 36px; height: 36px;
  border-radius: var(--adm-radius-sm);
  border: 1px solid var(--adm-border);
  background: #fff;
  color: var(--adm-text-sec);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: all .2s;
}
.adm-page-btn:hover, .adm-page-btn.active {
  background: var(--adm-primary);
  color: #fff;
  border-color: var(--adm-primary);
}

/* ── Grid de 2 colunas ────────────────────────────────────── */
.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.adm-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) {
  .adm-grid-2, .adm-grid-3 { grid-template-columns: 1fr; }
}

/* ── Mobile sidebar ───────────────────────────────────────── */
@media (max-width: 768px) {
  .adm-sidebar { transform: translateX(-100%); }
  .adm-sidebar.open { transform: translateX(0); }
  .adm-main { margin-left: 0; }
  .adm-topbar { padding: 0 1rem; }
  .adm-content { padding: 1rem; }
  .adm-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
  }
  .adm-overlay.open { display: block; }
}

/* ── Upload de imagem ─────────────────────────────────────── */
.adm-img-preview {
  width: 100px; height: 100px;
  border-radius: var(--adm-radius-sm);
  border: 2px dashed var(--adm-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  background: var(--adm-bg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
}
.adm-img-preview:hover { border-color: var(--adm-primary); }
.adm-img-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Faturamento chart placeholder ───────────────────────── */
.adm-chart-wrap {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: .5rem 0;
}
.adm-bar {
  flex: 1;
  background: var(--adm-primary);
  border-radius: 4px 4px 0 0;
  opacity: .7;
  transition: opacity .2s;
  position: relative;
}
.adm-bar:hover { opacity: 1; }
.adm-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%; transform: translateX(-50%);
  font-size: .6rem;
  color: var(--adm-text-muted);
  white-space: nowrap;
}

/* ============================================================
   FILTROS DE PERÍODO — Gráfico de Faturamento
   ============================================================ */
.fat-periodo-filtros {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}
.fat-periodo-btn {
  background: var(--adm-bg);
  border: 1px solid var(--adm-border);
  color: var(--adm-text-muted);
  font-size: .75rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.fat-periodo-btn:hover {
  border-color: var(--adm-primary);
  color: var(--adm-primary);
}
.fat-periodo-btn.active {
  background: var(--adm-primary);
  border-color: var(--adm-primary);
  color: #fff;
}

/* ============================================================
   HORÁRIOS DE FUNCIONAMENTO
   ============================================================ */
.horarios-grid {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.horario-dia-row {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .625rem .75rem;
  border-radius: 8px;
  background: var(--adm-bg);
  flex-wrap: wrap;
  transition: opacity .15s;
}
.horario-dia-row.horario-fechado {
  opacity: .6;
}
.horario-dia-toggle {
  width: 40px;
  height: 22px;
}
.horario-dia-toggle .adm-switch-slider::before {
  width: 16px;
  height: 16px;
}
.horario-dia-toggle input:checked + .adm-switch-slider::before {
  transform: translateX(18px);
}
.horario-dia-nome {
  font-weight: 600;
  font-size: .85rem;
  width: 110px;
  flex-shrink: 0;
}
.horario-dia-campos {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 200px;
}
.horario-ate {
  font-size: .8rem;
  color: var(--adm-text-muted);
}
.horario-dia-status {
  margin-left: auto;
}
.adm-input-sm {
  padding: .35rem .6rem;
  font-size: .82rem;
  width: 110px;
}
@media (max-width: 640px) {
  .horario-dia-row { flex-direction: column; align-items: flex-start; }
  .horario-dia-campos { width: 100%; }
  .horario-dia-status { margin-left: 0; }
}

/* ── Modal: confirmar envio de WhatsApp após mudança de status ── */
.wa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: wa-fade-in .15s ease;
}
@keyframes wa-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.wa-modal-box {
  background: var(--adm-surface, #fff);
  border-radius: 16px;
  padding: 1.75rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.wa-modal-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .9rem;
}
.wa-modal-box h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: .25rem;
  color: var(--adm-text, #1a1a1a);
}
.wa-modal-tel {
  font-size: .82rem;
  color: var(--adm-text-muted, #888);
  margin-bottom: 1rem;
}
.wa-modal-preview {
  background: #ECE5DD;
  color: #1a1a1a;
  border-radius: 10px;
  padding: .85rem 1rem;
  font-size: .85rem;
  text-align: left;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.wa-modal-actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.wa-btn-primario {
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .8rem 1rem;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
  transition: filter .15s;
}
.wa-btn-primario:hover { filter: brightness(.93); color: #fff; }
.wa-btn-secundario {
  background: transparent;
  border: 1.5px solid var(--adm-border, #e2e2e2);
  color: var(--adm-text-muted, #888);
  border-radius: 10px;
  padding: .7rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}
.wa-btn-secundario:hover { background: var(--adm-surface2, #f5f5f5); }

