/* ==========================================================================
   PAINEL ADMINISTRATIVO K.CELL IMPORTS - TEMA CLARO EXECUTIVO (FUNDO BRANCO)
   Layout: Menu Lateral Esquerdo Fixo + Conteúdo Dinâmico à Direita
   ========================================================================== */

/* Corpo e Base do Admin */
.admin-body {
  background-color: #f8fafc;
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: clip;
}

/* Estrutura Principal: Sidebar Fixa à Esquerda + Conteúdo à Direita */
.admin-app {
  display: flex;
  min-height: 100vh;
  background-color: #f8fafc;
  color: #0f172a;
  position: relative;
}

/* --------------------------------------------------------------------------
   MENU LATERAL ESQUERDO FIXO (SIDEBAR)
   -------------------------------------------------------------------------- */
.admin-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.admin-sidebar-header {
  padding: 24px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.admin-sidebar .logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.admin-sidebar .brand-name {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  display: block;
}

.admin-sidebar .brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: #16a34a;
  letter-spacing: 0.8px;
  display: block;
}

.admin-badge {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 4px 9px;
  border-radius: var(--radius-full, 9999px);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Navegação das Abas no Menu Lateral */
.admin-sidebar-nav {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-tab-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.admin-tab-btn i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.18s ease;
}

.admin-tab-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}

.admin-tab-btn:hover i {
  color: #16a34a;
}

.admin-tab-btn.active {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
  font-weight: 700;
}

.admin-tab-btn.active i {
  color: #16a34a;
}

/* Rodapé do Menu Lateral */
.admin-sidebar-footer {
  padding: 18px 16px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-user-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-session-email {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.admin-sidebar-actions {
  display: flex;
  gap: 8px;
}

.admin-sidebar-action-btn,
.admin-sidebar-actions .admin-logout-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-sidebar-action-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.admin-sidebar-actions .admin-logout-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* --------------------------------------------------------------------------
   ÁREA DE CONTEÚDO À DIREITA (MAIN WRAPPER & TOPBAR)
   -------------------------------------------------------------------------- */
.admin-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f8fafc;
}

/* Topbar Superior */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-sidebar-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #334155;
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.admin-sidebar-toggle:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* Fundo escuro da sidebar no celular: existe so para receber o clique que
   fecha o menu. Z-index 999 fica atras da sidebar (1000) e na frente do
   restante do painel. */
.admin-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
  display: none;
}

.admin-sidebar-overlay.open {
  display: block;
}

.admin-page-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.3px;
}

.admin-page-subtitle {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-full, 9999px);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator-dot.online {
  background-color: #22c55e;
}

.admin-btn-reload {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-btn-reload:hover {
  background: #f8fafc;
  color: #16a34a;
  border-color: #cbd5e1;
}

/* Container de Conteúdo */
.admin-container {
  max-width: 1440px;
  width: 100%;
  min-width: 0;
  padding: 32px 36px 60px;
  margin: 0;
  flex: 1;
  box-sizing: border-box;
}

/* Seções de Abas */
.admin-panel-section {
  display: none;
  min-width: 0;
}

.admin-panel-section.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

/* --------------------------------------------------------------------------
   INDICADORES / CARDS DE MÉTRICAS (FUNDO BRANCO CLEAN)
   -------------------------------------------------------------------------- */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.admin-metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease ease;
}

.admin-metric-card:hover {
  transform: translateY(-2px);
}

.admin-metric-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.admin-metric-card strong {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.admin-metric-card small {
  font-size: 12px;
  color: #16a34a;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   CARDS DE CONTEÚDO E TABELAS (FUNDO BRANCO)
   -------------------------------------------------------------------------- */
.admin-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 28px;
  align-items: start;
}

/* Itens de grid/flex com min-width:auto esticam a coluna quando ha tabela
   larga dentro, jogando a barra de rolagem para fora do card. */
.admin-grid-layout > * {
  min-width: 0;
}

.admin-card {
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 26px;
}

.admin-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

.admin-card-title i {
  color: #16a34a;
}

/* Formulários do Admin */
.admin-form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-form-group label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.admin-input,
.admin-select,
.admin-textarea {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 14px;
  color: #0f172a;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease ease;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: #16a34a;
}

.admin-input[readonly],
.admin-input:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.admin-input.is-invalid,
.admin-select.is-invalid,
.admin-textarea.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
  animation: shake 0.35s ease;
}

.admin-textarea {
  resize: vertical;
  min-height: 90px;
}

.admin-input-eye {
  position: relative;
}

.admin-input-eye .admin-input {
  width: 100%;
  padding-right: 40px;
}

.admin-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 4px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}

.admin-eye-btn:hover {
  color: #16a34a;
}

.admin-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-checkbox-row:hover {
  background: #f1f5f9;
}

.admin-checkbox-row label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

/* Tabelas com Fundo Branco */
.admin-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* Barra de rolagem fina e contida dentro do card. */
.admin-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.admin-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.admin-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

/* Pedidos em aberto: borda esquerda colorida pela situacao para o
   administrador enxergar pagou/nao pagou/concluido sem ler o select. */
#adminOrdersTbody tr td:first-child,
#adminOrdersDoneTbody tr td:first-child {
  box-shadow: inset 4px 0 0 transparent !important;
}

#adminOrdersTbody tr.pedido-novo td:first-child {
  box-shadow: inset 4px 0 0 #0ea5e9 !important;
}

#adminOrdersTbody tr.pedido-em-atendimento td:first-child {
  box-shadow: inset 4px 0 0 #f59e0b !important;
}

#adminOrdersTbody tr.pedido-sem-pagamento td:first-child {
  box-shadow: inset 4px 0 0 #dc2626 !important;
}

#adminOrdersTbody tr.pedido-enviado td:first-child {
  box-shadow: inset 4px 0 0 #2563eb !important;
}

#adminOrdersTbody tr.pedido-finalizado td:first-child {
  box-shadow: inset 4px 0 0 #16a34a !important;
}

#adminOrdersTbody tr.pedido-devolucao td:first-child {
  box-shadow: inset 4px 0 0 #9333ea !important;
}

#adminOrdersDoneTbody tr td:first-child {
  box-shadow: inset 4px 0 0 #16a34a !important;
}

.admin-table th {
  background: #f8fafc;
  padding: 14px 16px;
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-prod-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.admin-tag-badge {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 3px 8px;
  border-radius: var(--radius-full, 9999px);
  font-size: 11px;
  font-weight: 700;
}

.admin-locked-badge {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  padding: 3px 8px;
  border-radius: var(--radius-full, 9999px);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-action-btn {
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.admin-btn-edit {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.admin-btn-edit:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.admin-btn-delete {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.admin-btn-delete:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.admin-btn-restore {
  background: #206a0b;
  color: #ffffff;
  border: 1px solid #206a0b;
}

.admin-btn-restore:hover {
  background: #004000;
  color: #ffffff;
  border-color: #004000;
}

/* Alertas Administrativos */
.alert-notice-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  color: #92400e;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 13px;
}

/* Lista de Segurança */
.admin-security-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-security-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #16a34a;
  border-radius: 8px;
  padding: 14px 16px;
}

.admin-security-item strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 6px;
}

.admin-security-item p {
  font-size: 12px;
  color: #475569;
  line-height: 1.7;
  margin: 0;
}

/* Galeria de Fotos e Prévias */
.admin-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.admin-gallery-item {
  position: relative;
  width: 120px;
  height: 120px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.admin-gallery-item--empty {
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  flex-direction: column;
  gap: 6px;
}

.admin-gallery-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 120ms ease;
}

.admin-gallery-remove:hover {
  background: #dc2626;
}

.admin-gallery-capa {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-gallery-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.admin-gallery-help {
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
}

.admin-image-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-image-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.admin-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Rodapé do Painel */
.admin-footer {
  margin-top: auto;
  padding: 24px 36px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.admin-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748b;
}

.admin-footer-content p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   TELA DE LOGIN - FUNDO BRANCO CLEAN & CARD ELEGANTE
   -------------------------------------------------------------------------- */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: #f8fafc;
}

.admin-login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 40px 36px 32px;
}

.admin-login-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
}

.admin-login-subtitle {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.6;
}

.admin-login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.admin-login-field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-login-field label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.admin-login-input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  color: #0f172a;
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}

.admin-login-input:focus {
  border-color: #16a34a;
}

.admin-login-btn {
  width: 100%;
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.admin-login-btn:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.admin-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.admin-login-footer {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.admin-login-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  padding: 11px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  width: 100%;
  text-decoration: none;
  background: #f8fafc;
  transition: all 0.15s ease;
}

.admin-login-back:hover {
  color: #0f172a;
  border-color: #94a3b8;
  background: #ffffff;
}

.admin-login-card .dev-credit {
  display: block;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

.admin-login-card .dev-credit a {
  color: #16a34a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Animações */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes pulseSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   ITENS BLOQUEADOS - o admin ve, mas nao edita.
   Exemplo: termos de uso, politica de privacidade e politica de troca.
   Sao textos com efeito juridico. Quem escreve e o desenvolvedor.
   ========================================================================== */
.admin-tab-btn[data-bloqueado] {
  color: #94a3b8;
  cursor: default;
}

.admin-tab-btn[data-bloqueado] i {
  color: #cbd5e1;
}

.admin-tab-btn[data-bloqueado]:hover {
  background: transparent;
  color: #94a3b8;
}

.admin-tab-btn[data-bloqueado]:hover i {
  color: #cbd5e1;
}

.admin-tab-lock {
  margin-left: auto;
  font-size: 11px;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
}

/* Header Flex dos Cards do Painel */
.admin-card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Cards e Espaçamento de Políticas */
.admin-policy-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-policy-header {
  margin-bottom: 14px;
}

.admin-policy-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-policy-header h3 i {
  color: #16a34a;
}

.admin-policy-header p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* Switch / Toggle Moderno */
.admin-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.admin-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  margin: 0;
}

.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 34px;
}

.admin-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-switch input:checked + .admin-slider {
  background-color: #16a34a;
}

.admin-switch input:checked + .admin-slider:before {
  transform: translateX(22px);
}

.admin-toggle-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

/* Preview de Banner */
.admin-banner-preview-wrap {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 18px;
}

.admin-banner-preview-box {
  width: 100%;
  max-height: 260px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}

.admin-banner-preview-img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.admin-search-wrap {
  min-width: 320px;
  flex: 1 1 380px;
  max-width: 560px;
}

.admin-search-wrap .admin-input {
  width: 100%;
}

#fichaBusca {
  width: 100%;
}

/* ==========================================================================
   DADOS DO CLIENTE PROTEGIDOS
   E-mail e telefone aparecem mascarados. O olho revela na hora, sem
   recarregar a pagina. Clicar no telefone abre o WhatsApp do cliente.
   ========================================================================== */
.admin-reveal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-reveal-value {
  font-variant-numeric: tabular-nums;
}

.admin-reveal-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-reveal-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.admin-reveal-btn.revelado {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.admin-telefone-link {
  color: #15803d;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-telefone-link:hover {
  color: var(--verde-floresta, #206A0B);
}

/* ==========================================================================
   SITUACAO DO PEDIDO
   ========================================================================== */
.admin-status-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  max-width: 160px;
  text-overflow: ellipsis;
}

.admin-status-select:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 1px;
}

.admin-status-select[data-status="novo"] {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.admin-status-select[data-status="em-atendimento"],
.admin-status-select[data-status="em-contato"],
.admin-status-select[data-status="sendo-finalizado"] {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.admin-status-select[data-status="sem-pagamento"] {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.admin-status-select[data-status="enviado"] {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.admin-status-select[data-status="finalizado"] {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.admin-status-select[data-status="devolucao"],
.admin-status-select[data-status="cancelado"] {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.admin-status-select:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ==========================================================================
   MINHA CONTA - nome e senha do administrador
   ========================================================================== */
.admin-conta-aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.6;
}

.admin-conta-aviso i {
  font-size: 14px;
  margin-top: 2px;
}

.admin-card-subtitle {
  margin: 4px 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
  max-width: 720px;
}

.admin-conta-divisor {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 24px 0;
}

/* ==========================================================================
   FILTROS E PAGINACAO DA TABELA DE PRODUTOS
   ========================================================================== */
.admin-filtros-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-selects-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filter-select {
  min-width: 170px;
  cursor: pointer;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.admin-pagination-info {
  font-size: 13px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.admin-pagination-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-pagination-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-pagination-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.admin-pagination-btn.ativo {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.admin-pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   MODAL DE CONFIRMACAO
   Substitui window.confirm(), que some o contexto em tela cheia e nao
   pode ser estilizado. Um unico elemento e reaproveitado.
   ========================================================================== */
.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}

.admin-modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 26px;
}

.admin-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-modal-title i {
  color: #16a34a;
}

.admin-modal-texto {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 22px 0;
}

.admin-modal-rodape {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 14px;
  padding-top: 8px;
  background: #ffffff;
}

.admin-modal-detalhe {
  display: block;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
}

.admin-modal-erro {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  color: #b91c1c;
}

/* ==========================================================================
   EDITOR DE CONTEUDO
   Uma coluna so: menu de blocos a esquerda, campos a direita. Sem grid
   complexo porque cada bloco e um formulario linear de leitura longa.
   ========================================================================== */
.admin-content-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-content-status {
  margin: 14px 0 0 0;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #64748b;
}

.admin-content-status.salvo {
  color: #15803d;
}

.admin-content-status.pendente {
  color: #b45309;
}

.admin-content-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.admin-content-nav {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
}

.admin-content-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-content-nav-btn i {
  width: 16px;
  text-align: center;
  color: #94a3b8;
}

.admin-content-nav-btn:hover {
  background: #f8fafc;
}

.admin-content-nav-btn.ativo {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.admin-content-nav-btn.ativo i {
  color: #16a34a;
}

.admin-content-nav-btn .admin-content-nav-dirty {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  margin-left: auto;
  flex-shrink: 0;
}

.admin-content-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.admin-content-card:last-child {
  margin-bottom: 0;
}

.admin-content-card-header {
  margin-bottom: 18px;
}

.admin-content-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-content-card-header h3 i {
  color: #16a34a;
}

.admin-content-card-header p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.admin-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-content-field.largo {
  grid-column: 1 / -1;
}

.admin-content-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.admin-content-caminho {
  font-size: 11px;
  color: #94a3b8;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-weight: 500;
}

.admin-content-dica {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.5;
}

.admin-json-erro {
  display: none;
  font-size: 12px;
  color: #b91c1c;
  margin-top: 6px;
  font-weight: 600;
}

.admin-content-destaque {
  display: block;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 18px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
    CORES PADRONIZADAS & UI FIXES
    -------------------------------------------------------------------------- */
:root {
  --verde-floresta: #206A0B;
  --verde-escuro: #004000;
  --verde-lima: #8DFB36;
}

.dev-credit, .dev-credit a {
  color: #b1c7b3 !important;
  font-weight: 600;
}

.dev-credit a {
  color: var(--verde-lima) !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dev-credit a:hover {
  color: #ffffff !important;
}

/* Evitar que o texto fique branco ao selecionar (copiar) */
::selection {
  background-color: var(--verde-floresta);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--verde-floresta);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
    RESPONSIVIDADE AVANÇADA (MOBILE & TABLET)
    -------------------------------------------------------------------------- */
@media (max-width: 1024px) {

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.25s ease-in-out;
  }

  .admin-sidebar.open {
    left: 0;
  }

  .admin-sidebar-toggle {
    display: flex !important;
  }

  .admin-main-wrapper {
    width: 100%;
  }

  .admin-container {
    padding: 20px 16px;
  }

  .admin-grid-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .admin-metric-card {
    padding: 16px;
  }

  .admin-metric-card strong {
    font-size: 20px;
  }

  .admin-topbar {
    padding: 12px 16px;
  }

  .admin-page-heading {
    display: flex;
    flex-direction: column;
  }

  .admin-page-title {
    font-size: 16px;
  }

  .admin-page-subtitle {
    display: none;
  }
}

@media (max-width: 480px) {
  .admin-metrics-grid {
    grid-template-columns: 1fr;
  }

  .admin-card {
    padding: 20px 16px;
  }

  .admin-card-header-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-filtros-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-selects-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .admin-search-wrap, .admin-filter-select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .admin-form-group .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .admin-sidebar-actions {
    flex-direction: column;
  }
}


/* Ampliacao da foto do produto (clique na miniatura da galeria) */
.admin-foto-preview {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.82);
}

.admin-foto-preview-box {
  margin: 0;
  max-width: min(90vw, 760px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.admin-foto-preview-box img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.admin-foto-preview-rotulo {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.admin-foto-preview-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease;
}

.admin-foto-preview-close:hover {
  background: #dc2626;
}

.admin-estoque-zerado {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.admin-card-editando {
  border: 2px solid var(--verde-floresta, #206a0b);
}

/* Historico de compras do cliente (modal) */
.admin-historico-box {
  max-width: 580px;
}

.admin-historico-lista {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 4px 0 8px;
}

.admin-historico-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #f8fafc;
}

.admin-historico-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.admin-historico-meta {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.admin-historico-itens {
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
}

/* Produtos do carrinho em grade de 2 colunas: 4 visiveis por dobra e a
   lista interna continua com rolagem quando o cliente tem muitos. */
.admin-historico-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.admin-historico-chip {
  display: block;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.admin-historico-chip strong {
  color: #0f172a;
}

.admin-ficha-resumo {
  background: #f7faf7;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.admin-ficha-linha {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}

.admin-ficha-linha span {
  color: #64748b;
}

.admin-ficha-linha strong {
  color: #0f172a;
  text-align: right;
  word-break: break-word;
}

/* Fechamento do pedido na ficha: separa dos itens com uma linha tracejada. */
.admin-pedido-totais {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

/* Espaco entre os botoes de acao da tabela (editar / excluir). */
.admin-table td .admin-action-btn + .admin-action-btn {
  margin-left: 8px;
}

/* Botoes de acao dos produtos empilhados: um embaixo do outro, com espaco
   entre eles. A regra acima nao vale aqui (mesma classe, especificidade
   maior), senao o botao de baixo ficava deslocado 8px para a direita. */
.admin-actions-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.admin-table td .admin-actions-cell .admin-action-btn + .admin-action-btn {
  margin-left: 0;
}

/* Linha do pedido na tabela: clicar em qualquer lugar (fora do select de
   situacao e dos botoes de revelar dados) abre a ficha completa do pedido. */
#adminOrdersTbody tr[data-pedido] {
  cursor: pointer;
}

#adminOrdersTbody tr[data-pedido]:hover td {
  background: #f8fafc;
}

/* O card do formulario de produto ocupa a largura toda, mas os campos ficam
   numa faixa legivel em vez de esticar ate o fim da tela. */
#adminProductForm {
  max-width: 760px;
}

.admin-input-group {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.admin-input-group .admin-input {
  flex: 1;
  min-width: 0;
}

.admin-input-group .admin-action-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .admin-input-group {
    flex-direction: column;
  }
}

/* Pedidos: colunas secundarias somem por etapas antes de a tabela
   precisar da rolagem lateral (o "arrastar" grudado na borda). */
@media (max-width: 1450px) {
  .admin-table .col-whatsapp {
    display: none;
  }
}

@media (max-width: 1300px) {
  .admin-table .col-pagamento {
    display: none;
  }
}

@media (max-width: 1030px) {
  .admin-table .col-produtos {
    display: none;
  }
}
