/* ==========================================================================
   InvisaCook Admin — Design System
   Light mode (padrão, sidebar clara) + Dark mode via [data-theme="dark"]
   ========================================================================== */

/* Tipografia oficial: Roboto Light (peso principal) + Roboto Regular (destaque).
   Arquivos reais em /public/Fonte Admin Ecommerce/Roboto — nenhum peso Bold é usado. */
@font-face {
  font-family: "Admin Roboto";
  src: url("/Fonte%20Admin%20Ecommerce/Roboto/Roboto-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Admin Roboto";
  src: url("/Fonte%20Admin%20Ecommerce/Roboto/Roboto-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Admin Roboto";
  src: url("/Fonte%20Admin%20Ecommerce/Roboto/Roboto-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Admin Roboto";
  src: url("/Fonte%20Admin%20Ecommerce/Roboto/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --admin-font-light: "Admin Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --admin-font-regular: "Admin Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --admin-weight-light: 300;
  --admin-weight-regular: 400;
  --admin-weight-semibold: 600;
  --admin-weight-bold: 700;

  --admin-bg: #f6f5f3;
  --admin-surface: #ffffff;
  --admin-surface-hover: #faf9f7;
  --admin-surface-2: #f1f0ec;
  --admin-border: #ebe9e4;
  --admin-border-strong: #ddd9d1;
  --admin-text: #17181a;
  --admin-muted: #77746c;
  --admin-muted-2: #a6a29a;
  --admin-text-muted: var(--admin-muted);

  --admin-accent: #ea5a2b;
  --admin-accent-hover: #d24a1e;
  --admin-accent-soft: rgba(234, 90, 43, 0.09);
  --admin-accent-soft-strong: rgba(234, 90, 43, 0.16);
  --admin-accent-contrast: #ffffff;

  --admin-success: #067647;
  --admin-success-soft: #e7f6ee;
  --admin-warning: #b54708;
  --admin-warning-soft: #fef3e6;
  --admin-danger: #b42318;
  --admin-danger-soft: #fdeeec;
  --admin-info: #175cd3;
  --admin-info-soft: #eaf1fd;
  --admin-neutral-soft: #eeece7;

  --admin-radius: 12px;
  --admin-radius-sm: 9px;
  --admin-radius-btn: 10px;
  --admin-radius-btn-sm: 8px;
  --admin-radius-pill: 999px;
  --admin-shadow: 0 12px 32px rgba(30, 25, 20, 0.06);
  --admin-shadow-sm: 0 1px 2px rgba(30, 25, 20, 0.04);
  --admin-shadow-focus: 0 0 0 3px rgba(234, 90, 43, 0.16);

  /* Sidebar clara no light mode — nada de bloco preto */
  --sidebar-bg: #ffffff;
  --sidebar-text: #3a3835;
  --sidebar-text-muted: #918d84;
  --sidebar-active-bg: var(--admin-accent-soft);
  --sidebar-active-text: #1a1a1a;
  --sidebar-hover-bg: var(--admin-surface-2);
  --sidebar-border: var(--admin-border);
  --sidebar-shadow: 1px 0 0 var(--admin-border);

  --admin-transition: 170ms cubic-bezier(0.4, 0, 0.2, 1);
  /*
   * 1320px é o alvo de largura EFETIVA do conteúdo (não o antigo
   * 1440px, que nunca chegava a se aplicar de verdade: a coluna de
   * conteúdo já é viewport - sidebar, então em qualquer monitor até
   * ~1670px de largura o max-width antigo era maior que o espaço
   * disponível e nunca entrava em ação). Usado sempre via min() em
   * .admin-content — ver comentário lá.
   */
  --admin-content-max-width: 1320px;
  --sidebar-width: 232px;
  --sidebar-width-collapsed: 72px;
}

[data-theme="dark"] {
  --admin-bg: #0b0b0d;
  --admin-surface: #17171b;
  --admin-surface-hover: #1d1d22;
  --admin-surface-2: #121215;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-strong: rgba(255, 255, 255, 0.14);
  --admin-text: #f1f0ee;
  --admin-muted: #9a98a1;
  --admin-muted-2: #6f6d76;
  --admin-text-muted: var(--admin-muted);

  --admin-accent: #f0602f;
  --admin-accent-hover: #ff7c46;
  --admin-accent-soft: rgba(240, 96, 47, 0.16);
  --admin-accent-soft-strong: rgba(240, 96, 47, 0.26);
  --admin-accent-contrast: #ffffff;

  --admin-success: #4ade80;
  --admin-success-soft: rgba(74, 222, 128, 0.12);
  --admin-warning: #fbbf24;
  --admin-warning-soft: rgba(251, 191, 36, 0.12);
  --admin-danger: #f87171;
  --admin-danger-soft: rgba(248, 113, 113, 0.12);
  --admin-info: #60a5fa;
  --admin-info-soft: rgba(96, 165, 250, 0.12);
  --admin-neutral-soft: rgba(255, 255, 255, 0.06);

  --admin-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --admin-shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
  --admin-shadow-focus: 0 0 0 3px rgba(240, 96, 47, 0.26);

  /* Sidebar chumbo/preta real no dark mode */
  --sidebar-bg: #111114;
  --sidebar-text: #cfceda;
  --sidebar-text-muted: #85838d;
  --sidebar-active-bg: var(--admin-accent-soft);
  --sidebar-active-text: #ffffff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--admin-font-regular);
  font-weight: var(--admin-weight-regular);
  background: var(--admin-bg);
  color: var(--admin-text);
  transition: background-color var(--admin-transition), color var(--admin-transition);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--admin-accent-soft);
  color: var(--admin-text);
}

a {
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--admin-weight-semibold);
}

strong, b {
  font-weight: var(--admin-weight-semibold);
}

:focus-visible {
  outline: 2px solid var(--admin-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   Login
   ========================================================================== */

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--admin-bg);
}

.admin-login__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--admin-surface);
  padding: 32px 28px 26px;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  overflow: hidden;
  animation: admin-fade-up 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-login__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--admin-accent), #ffb27a);
}

.admin-login__logo {
  display: block;
  height: 32px;
  width: auto;
  margin-bottom: 22px;
}

[data-theme="dark"] .admin-login__logo {
  filter: invert(1) brightness(1.9);
}

.admin-login__brand {
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
  color: var(--admin-muted);
}

.admin-login h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.admin-login__subtitle {
  margin: 0 0 24px;
  color: var(--admin-muted);
  line-height: 1.5;
  font-size: 14px;
  font-weight: var(--admin-weight-light);
}

.admin-login__form {
  display: grid;
  gap: 18px;
}

.admin-login__form label {
  display: grid;
  gap: 8px;
  font-weight: 400;
  font-size: 13.5px;
  color: var(--admin-muted);
}

.admin-login__form input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface);
  color: var(--admin-text);
  font: inherit;
  font-size: 14px;
  transition: border-color var(--admin-transition), box-shadow var(--admin-transition);
}

.admin-login__form input:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: var(--admin-shadow-focus);
}

.admin-login__form button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--admin-radius-btn);
  background: var(--admin-accent);
  color: var(--admin-accent-contrast);
  font: inherit;
  font-size: 14px;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.admin-login__form button:hover:not(:disabled) {
  background: var(--admin-accent-hover);
  box-shadow: 0 8px 20px var(--admin-accent-soft);
}

.admin-login__form button:active:not(:disabled) {
  transform: translateY(1px);
}

.admin-login__form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.admin-login__message {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
}

.admin-login__message.is-error {
  color: var(--admin-danger);
}

.admin-login__message.is-success {
  color: var(--admin-success);
}

.admin-login__theme {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.admin-theme-toggle.admin-login__theme {
  color: var(--admin-muted);
  border-color: var(--admin-border-strong);
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
}

.admin-theme-toggle.admin-login__theme:hover {
  color: var(--admin-text);
  background: var(--admin-surface-hover);
}

@keyframes admin-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Shell / Sidebar
   ========================================================================== */

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  background: var(--admin-bg);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 14px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  box-shadow: var(--sidebar-shadow);
  transition: background-color var(--admin-transition), width 200ms cubic-bezier(0.4, 0, 0.2, 1), padding 200ms cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
}

.admin-sidebar__top {
  display: flex;
  align-items: center;
  padding: 10px 10px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--sidebar-border);
}

.admin-sidebar__brand-link {
  display: block;
  text-decoration: none;
}

.admin-sidebar__logo {
  display: block;
  height: 27px;
  width: auto;
}

[data-theme="dark"] .admin-sidebar__logo {
  filter: invert(1) brightness(1.9);
}

.admin-sidebar__label {
  margin: 3px 10px 0;
  font-size: 11.5px;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-nav {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.admin-nav__group {
  display: grid;
  gap: 1px;
  padding-top: 14px;
}

.admin-nav__group:first-child {
  padding-top: 0;
}

.admin-nav__group + .admin-nav__group {
  margin-top: 4px;
  border-top: 1px solid var(--sidebar-border);
}

.admin-nav__group-label {
  margin: 0 10px 6px;
  font-size: 10px;
  font-weight: var(--admin-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sidebar-text-muted);
  opacity: 0.75;
}

.admin-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--admin-radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.admin-nav a svg {
  flex: none;
  width: 16px;
  height: 16px;
  opacity: 0.65;
  color: var(--sidebar-text-muted);
  transition: color 150ms ease, opacity 150ms ease;
}

.admin-nav a:hover {
  background: var(--sidebar-hover-bg);
  transform: translateX(1px);
}

.admin-nav a:hover svg {
  opacity: 0.9;
}

.admin-nav a.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: var(--admin-weight-semibold);
  box-shadow: inset 0 0 0 1px var(--admin-accent-soft-strong);
}

.admin-nav a.is-active svg {
  opacity: 1;
  color: var(--admin-accent);
}

.admin-nav a.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--admin-accent);
}

.admin-sidebar__footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.admin-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--admin-radius-sm);
  border: 1px solid var(--sidebar-border);
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 400;
  transition: background-color var(--admin-transition), color var(--admin-transition), border-color var(--admin-transition);
}

.admin-theme-toggle:hover {
  background: var(--sidebar-hover-bg);
}

.admin-theme-toggle svg {
  width: 15px;
  height: 15px;
}

.admin-theme-toggle__icon--dark {
  display: none;
}

[data-theme="dark"] .admin-theme-toggle__icon--light {
  display: none;
}

[data-theme="dark"] .admin-theme-toggle__icon--dark {
  display: inline-flex;
}

.admin-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--admin-radius-sm);
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  transition: background-color var(--admin-transition), color var(--admin-transition), border-color var(--admin-transition);
}

.admin-logout svg {
  width: 15px;
  height: 15px;
}

.admin-logout:hover {
  background: var(--admin-danger-soft);
  border-color: transparent;
  color: #c0392b;
}

[data-theme="dark"] .admin-logout:hover {
  color: #f26a5e;
}

/* ==========================================================================
   Sidebar — sticky + recolhível (Fase 2)
   ========================================================================== */

.admin-sidebar__top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.admin-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--admin-radius-btn-sm);
  background: transparent;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.admin-sidebar-toggle:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
}

.admin-sidebar-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Sino de notificações — global, disponível em toda página admin
   ========================================================================== */

.admin-notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--admin-radius-btn-sm);
  background: transparent;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.admin-notif-bell:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
}

.admin-notif-bell svg {
  width: 16px;
  height: 16px;
}

.admin-notif-bell__badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--admin-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--sidebar-bg);
}

.admin-notif-panel {
  position: fixed;
  width: min(360px, calc(100vw - 24px));
  max-height: min(480px, calc(100vh - 24px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  padding: 0;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  box-shadow: var(--admin-shadow);
  z-index: 130;
  animation: admin-menu-in 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-notif-panel[hidden] {
  display: none;
}

.admin-notif-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-notif-panel__header strong {
  font-size: 13.5px;
  font-weight: var(--admin-weight-semibold);
}

.admin-notif-panel__markall {
  border: 0;
  background: none;
  color: var(--admin-accent);
  font: inherit;
  font-size: 12px;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
  padding: 2px 4px;
}

.admin-notif-panel__markall:hover:not(:disabled) {
  text-decoration: underline;
}

.admin-notif-panel__markall:disabled {
  opacity: 0.5;
  cursor: default;
}

.admin-notif-panel__list {
  display: grid;
  gap: 1px;
  padding: 6px;
  overflow-y: auto;
}

.admin-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: var(--admin-radius-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  transition: background-color 120ms ease;
}

.admin-notif-item:hover {
  background: var(--admin-surface-hover);
}

.admin-notif-item__dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--admin-accent);
}

.admin-notif-item--read .admin-notif-item__dot {
  background: transparent;
}

.admin-notif-item__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-notif-item__title {
  font-size: 13px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
}

.admin-notif-item--read .admin-notif-item__title {
  font-weight: 400;
  color: var(--admin-text-muted);
}

.admin-notif-item__meta {
  font-size: 11.5px;
  color: var(--admin-text-muted);
}

.admin-notif-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 16px;
  color: var(--admin-text-muted);
  text-align: center;
  font-size: 13px;
}

/* Tooltip — elemento único, position:fixed via JS (sidebar.js), para não
   ser cortado pelo overflow-y:auto da sidebar recolhida. */
.admin-tooltip-float {
  position: fixed;
  transform: translateY(-50%);
  background: var(--admin-text);
  color: var(--admin-bg);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease;
  z-index: 200;
}

.admin-tooltip-float.is-visible {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 961px) {
  html.sidebar-collapsed .admin-shell {
    grid-template-columns: var(--sidebar-width-collapsed) 1fr;
  }

  html.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-width-collapsed);
    padding-left: 10px;
    padding-right: 10px;
  }

  html.sidebar-collapsed .admin-sidebar__top {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  html.sidebar-collapsed .admin-sidebar__brand-link {
    display: none;
  }

  html.sidebar-collapsed .admin-sidebar__top-actions {
    flex-direction: column;
    margin-left: 0;
    gap: 6px;
  }

  html.sidebar-collapsed .admin-sidebar-toggle {
    margin-left: 0;
  }

  html.sidebar-collapsed .admin-sidebar-toggle svg {
    transform: rotate(180deg);
  }

  html.sidebar-collapsed .admin-sidebar__label,
  html.sidebar-collapsed .admin-nav__group-label,
  html.sidebar-collapsed .admin-nav__label {
    display: none;
  }

  html.sidebar-collapsed .admin-nav a {
    justify-content: center;
    padding: 9px;
  }

  html.sidebar-collapsed .admin-nav a.is-active::before {
    left: -10px;
  }

  html.sidebar-collapsed .admin-user-menu__trigger {
    justify-content: center;
    padding: 6px;
  }
}

/* ==========================================================================
   Área do usuário — bloco fixo no rodapé da sidebar
   ========================================================================== */

.admin-user-menu {
  position: relative;
}

.admin-user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--admin-radius-sm);
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.admin-user-menu__trigger:hover,
.admin-user-menu__trigger[aria-expanded="true"] {
  background: var(--sidebar-hover-bg);
}

.admin-user-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--admin-accent), #ffb17a);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
}

.admin-user-menu__info {
  display: grid;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.admin-user-menu__name {
  font-size: 13px;
  font-weight: var(--admin-weight-semibold);
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-menu__role {
  font-size: 11px;
  color: var(--sidebar-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-menu__chevron {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--sidebar-text-muted);
  transition: transform 150ms ease;
}

.admin-user-menu__trigger[aria-expanded="true"] .admin-user-menu__chevron {
  transform: rotate(180deg);
}

.admin-user-menu__dropdown {
  position: fixed;
  width: 240px;
  padding: 6px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  box-shadow: var(--admin-shadow);
  display: grid;
  gap: 1px;
  animation: admin-menu-in 150ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 120;
}

.admin-user-menu__dropdown[hidden] {
  display: none;
}

@keyframes admin-menu-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-user-menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--admin-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.admin-user-menu__item svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--admin-muted);
}

.admin-user-menu__item:hover:not(:disabled) {
  background: var(--admin-surface-2);
}

.admin-user-menu__item:disabled {
  cursor: default;
  color: var(--admin-muted);
  opacity: 0.7;
}

.admin-user-menu__item--danger {
  color: var(--admin-danger);
}

.admin-user-menu__item--danger svg {
  color: var(--admin-danger);
}

.admin-user-menu__item--danger:hover {
  background: var(--admin-danger-soft);
}

.admin-user-menu__soon {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--admin-radius-pill);
  background: var(--admin-neutral-soft);
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-user-menu__divider {
  height: 1px;
  margin: 5px 2px;
  background: var(--admin-border);
}

/* O toggle de tema reaproveita `.admin-theme-toggle`, mas dentro do menu
   deve se comportar como um item de lista, não como um botão isolado. */
.admin-theme-toggle.admin-user-menu__item {
  border: 0;
  padding: 8px 9px;
  font-size: 13px;
  justify-content: flex-start;
}

.admin-theme-toggle.admin-user-menu__item:hover {
  background: var(--admin-surface-2);
}

/* ==========================================================================
   Mobile topbar / drawer
   ========================================================================== */

.admin-mobile-topbar {
  display: none;
}

.admin-sidebar-overlay {
  display: none;
}

/* ==========================================================================
   Content
   ========================================================================== */

.admin-content {
  width: 100%;
  /*
   * min() garante as duas coisas pedidas ao mesmo tempo:
   * - em telas "normais" (até ~1670px), nunca deixa menos que 64px de
   *   respiro total (32px de cada lado) mesmo que a coluna inteira
   *   caiba menos que --admin-content-max-width;
   * - em monitores grandes/ultrawide, trava em 1320px e o espaço
   *   extra vira margem externa (via margin-inline: auto), nunca
   *   tamanho extra de componente.
   */
  max-width: min(var(--admin-content-max-width), 100% - 64px);
  margin-inline: auto;
  padding: 20px 0 40px;
  min-width: 0;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-header h1,
.admin-panel h2,
.admin-form-section h2 {
  margin: 0;
  letter-spacing: -0.01em;
}

.admin-header h1 {
  font-size: 23px;
}

.admin-eyebrow {
  margin: 0 0 5px;
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--admin-radius-pill);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  font-size: 13.5px;
  font-weight: var(--admin-weight-semibold);
}

.admin-user::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(135deg, var(--admin-accent), #ffb17a);
}

/* ==========================================================================
   Quick stats — painel único, denso, com divisores internos
   ========================================================================== */

.admin-quickstats {
  padding: 0;
  overflow: hidden;
}

.admin-quickstats__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-quickstats__item {
  position: relative;
  padding: 22px 24px;
  transition: background-color var(--admin-transition);
}

.admin-quickstats__item:hover {
  background: var(--admin-surface-hover);
}

.admin-quickstats__item + .admin-quickstats__item {
  border-left: 1px solid var(--admin-border);
}

.admin-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
  margin-bottom: 12px;
}

.admin-stat__icon svg {
  width: 17px;
  height: 17px;
}

.admin-quickstats__item span {
  display: block;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 400;
}

.admin-quickstats__item strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  letter-spacing: -0.01em;
}

#apiStatus {
  font-size: 18px;
}

#apiStatus[data-state="ok"] {
  color: var(--admin-success);
}

#apiStatus[data-state="down"] {
  color: var(--admin-danger);
}

.admin-panel > h2:first-child {
  margin-bottom: 16px;
}

.admin-panel {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
}

.admin-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Dashboard: atalhos compactos com ícone + título + descrição + seta */

.admin-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  color: var(--admin-text);
  text-decoration: none;
  background: var(--admin-surface);
  transition: border-color var(--admin-transition), transform var(--admin-transition), background-color var(--admin-transition);
}

.admin-shortcut:hover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
  transform: translateY(-1px);
}

.admin-shortcut__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
  flex: none;
}

.admin-shortcut__icon svg {
  width: 17px;
  height: 17px;
}

.admin-shortcut__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-shortcut__body strong {
  font-size: 14px;
}

.admin-shortcut__body span {
  color: var(--admin-muted);
  font-size: 12.5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-shortcut__arrow {
  margin-left: auto;
  flex: none;
  color: var(--admin-muted);
  transition: transform var(--admin-transition), color var(--admin-transition);
}

.admin-shortcut__arrow svg {
  width: 15px;
  height: 15px;
  display: block;
}

.admin-shortcut:hover .admin-shortcut__arrow {
  transform: translateX(2px);
  color: var(--admin-accent);
}

/* ==========================================================================
   Buttons / links
   ========================================================================== */

.admin-primary-link,
.admin-form-submit button,
.admin-order__summary > button,
.admin-form__actions button:not(.admin-button-secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--admin-radius-btn);
  background: var(--admin-accent);
  color: var(--admin-accent-contrast);
  text-decoration: none;
  font: inherit;
  font-weight: var(--admin-weight-semibold);
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.admin-primary-link:hover,
.admin-form-submit button:hover:not(:disabled),
.admin-order__summary > button:hover:not(:disabled),
.admin-form__actions button:not(.admin-button-secondary):hover:not(:disabled) {
  background: var(--admin-accent-hover);
  box-shadow: 0 8px 20px var(--admin-accent-soft);
}

.admin-primary-link:active,
.admin-form-submit button:active:not(:disabled),
.admin-order__summary > button:active:not(:disabled),
.admin-form__actions button:not(.admin-button-secondary):active:not(:disabled) {
  transform: translateY(1px);
}

.admin-form-submit button:disabled,
.admin-order__summary > button:disabled,
.admin-form__actions button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.admin-secondary-link,
.admin-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px !important;
  border: 1px solid var(--admin-border-strong) !important;
  border-radius: var(--admin-radius-btn);
  color: var(--admin-text) !important;
  text-decoration: none;
  background: var(--admin-surface) !important;
  font: inherit;
  font-weight: var(--admin-weight-semibold);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.admin-secondary-link:hover,
.admin-button-secondary:hover {
  border-color: var(--admin-text) !important;
}

/*
 * Modificador exclusivo dos links "Voltar" (nunca aplicado a outros
 * usos de .admin-secondary-link, como o "Cancelar" de admin/banners) —
 * adiciona só o ícone de seta, mesmo ícone de src/styles/main.css
 * (.shop-header__back) e src/styles/minha-conta.css (.mc-back), nunca
 * o caractere Unicode "←".
 */
.admin-back-link { gap: 6px; }
.admin-back-link::before {
  content: '';
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M12.5 4l-6 6 6 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M12.5 4l-6 6 6 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

/* ==========================================================================
   Table panel toolbar (contagem + ação primária dentro do painel)
   ========================================================================== */

.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-table-toolbar__info {
  color: var(--admin-muted);
  font-size: 13.5px;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.admin-table-wrap {
  position: relative;
  width: 100%;
  margin-top: 16px;
  overflow-x: auto;
  border-radius: var(--admin-radius-sm);
}

/* Sinalizador visual de scroll horizontal em telas estreitas — evita que
   colunas sejam cortadas sem indicação (ex.: tabela de cupons no mobile). */
@media (max-width: 700px) {
  .admin-table-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 22px;
    background: linear-gradient(90deg, transparent, var(--admin-surface));
    pointer-events: none;
  }
}

/* Paginação de tabela — só no frontend (fatia uma lista já carregada
   por inteiro); não implica paginação real na API. */
.admin-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--admin-border);
}

.admin-table-pagination__info {
  font-size: 12.5px;
  color: var(--admin-muted);
}

.admin-table-pagination__controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-table-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--admin-radius-sm);
  background: transparent;
  color: var(--admin-text);
  font: inherit;
  font-size: 13px;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.admin-table-pagination__btn:hover:not(:disabled):not(.is-active) {
  background: var(--admin-surface-2);
}

.admin-table-pagination__btn.is-active {
  background: var(--admin-accent-soft);
  border-color: var(--admin-accent-soft-strong);
  color: var(--admin-accent);
}

.admin-table-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-table-pagination__ellipsis {
  padding: 0 4px;
  color: var(--admin-muted-2);
  font-size: 13px;
}

@media (max-width: 640px) {
  .admin-table-pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--admin-border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table tbody tr {
  transition: background-color var(--admin-transition);
}

.admin-table tbody tr:hover {
  background: var(--admin-surface-hover);
}

.admin-table th {
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: var(--admin-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-table td {
  font-size: 13.5px;
}

.admin-table--dense th,
.admin-table--dense td {
  padding: 8px 10px;
  font-size: 12.5px;
}

.admin-table--dense th {
  font-size: 10.5px;
}

.admin-table--dense .admin-pdf-action {
  width: 26px;
  height: 26px;
}

.admin-table--dense .admin-pdf-action svg {
  width: 13px;
  height: 13px;
}

.admin-table--dense .admin-table-actions {
  gap: 8px;
}

.admin-table__muted {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 12px;
  white-space: normal;
}

.admin-table-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--admin-text);
  font: inherit;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
}

.admin-table-button:hover {
  color: var(--admin-accent);
}

.admin-table-button:disabled {
  color: var(--admin-muted-2);
  cursor: not-allowed;
}

.admin-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.admin-edit-link {
  color: var(--admin-accent);
  font-weight: var(--admin-weight-semibold);
  text-decoration: none;
}

.admin-edit-link:hover {
  text-decoration: underline;
}

/* Avatar/inicial decorativo em linhas de tabela */

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-row-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
}

.admin-row-avatar--square {
  border-radius: 8px;
}

.admin-row__body {
  min-width: 0;
  white-space: normal;
}

.admin-row__body > strong {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .admin-row__body > strong {
    max-width: 60vw;
  }
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--admin-radius-pill);
  font-size: 12px;
  font-weight: var(--admin-weight-semibold);
  white-space: nowrap;
  line-height: 1.5;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--neutral {
  background: var(--admin-neutral-soft);
  color: var(--admin-muted);
}

.badge--success {
  background: var(--admin-success-soft);
  color: var(--admin-success);
}

.badge--warning {
  background: var(--admin-warning-soft);
  color: var(--admin-warning);
}

.badge--danger {
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
}

.badge--info {
  background: var(--admin-info-soft);
  color: var(--admin-info);
}

.badge--accent {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

/* ==========================================================================
   Toolbar de tabela — busca + filtros (Fase 3)
   ========================================================================== */

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-toolbar__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 280px;
}

.admin-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--admin-muted);
  pointer-events: none;
}

.admin-search input {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 32px;
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-btn);
  background: var(--admin-surface);
  color: var(--admin-text);
  font: inherit;
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.admin-search input:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: var(--admin-shadow-focus);
}

.admin-search__clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--admin-muted);
  cursor: pointer;
}

.admin-search__clear svg {
  position: static;
  transform: none;
  width: 13px;
  height: 13px;
}

.admin-search.has-value .admin-search__clear {
  display: inline-flex;
}

.admin-search.has-value input {
  padding-right: 30px;
}

.admin-filter-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-btn);
  background: var(--admin-surface);
  color: var(--admin-text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.admin-filter-select:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: var(--admin-shadow-focus);
}

/* ==========================================================================
   Empty states
   ========================================================================== */

.admin-empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 40px 20px;
  text-align: center;
  color: var(--admin-muted);
}

/* Dentro de uma tabela com scroll horizontal (mobile), o <td colspan> pode
   ser mais largo que a viewport — mantém o empty state centralizado na
   área visível em vez de centralizado na largura total da tabela. */
.admin-table-wrap .admin-empty-state {
  position: sticky;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 64px);
}

.admin-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--admin-surface-2);
  border: 1px dashed var(--admin-border);
  color: var(--admin-muted-2);
}

.admin-empty-state__icon svg {
  width: 21px;
  height: 21px;
}

.admin-empty-state__title {
  font-size: 13.5px;
  color: var(--admin-text);
}

.admin-empty-state__text {
  font-size: 12.5px;
  max-width: 320px;
}

/* Compatibilidade: telas existentes usam essa classe para o mesmo padrão */
.admin-dashboard-empty {
  margin: 0;
  padding: 24px 0;
  color: var(--admin-muted);
  font-size: 13px;
  text-align: center;
}

/* ==========================================================================
   Skeleton / loading
   ========================================================================== */

@keyframes admin-skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.admin-skeleton {
  display: inline-block;
  border-radius: 5px;
  background: var(--admin-surface-2);
  animation: admin-skeleton-pulse 1.3s ease-in-out infinite;
}

.admin-skeleton-row td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.admin-skeleton-line {
  height: 11px;
  width: 100%;
  max-width: 140px;
}

.admin-skeleton-line--sm {
  max-width: 70px;
}

.admin-skeleton-line--lg {
  max-width: 190px;
}

.admin-skeleton-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
}

.admin-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.7;
  animation: admin-spin 700ms linear infinite;
}

@keyframes admin-spin {
  to { transform: rotate(360deg); }
}

.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--admin-accent-contrast);
  opacity: 0.9;
  animation: admin-spin 700ms linear infinite;
}

.admin-secondary-link.is-loading::after,
.admin-button-secondary.is-loading::after {
  color: var(--admin-text);
}

/* ==========================================================================
   Upload de arquivo — componente compacto reutilizável
   ========================================================================== */

.admin-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px dashed var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface-2);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.admin-upload:hover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.admin-upload__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--admin-surface);
  color: var(--admin-muted);
}

.admin-upload__icon svg {
  width: 15px;
  height: 15px;
}

.admin-upload__body {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.admin-upload__name {
  font-size: 12.5px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-upload__hint {
  font-size: 11px;
  color: var(--admin-muted);
}

.admin-upload--success {
  border-style: solid;
  border-color: var(--admin-success);
  background: var(--admin-success-soft);
}

.admin-upload--success .admin-upload__icon {
  background: transparent;
  color: var(--admin-success);
}

.admin-upload--error {
  border-style: solid;
  border-color: var(--admin-danger);
  background: var(--admin-danger-soft);
}

.admin-upload--error .admin-upload__icon {
  background: transparent;
  color: var(--admin-danger);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form__grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--admin-muted);
}

.admin-form label[hidden] {
  display: none;
}

.admin-field-hint {
  margin-top: -4px;
  font-size: 11.5px;
  font-weight: var(--admin-weight-light);
  color: var(--admin-muted-2);
}

.admin-field-error {
  margin-top: -4px;
  font-size: 11.5px;
  color: var(--admin-danger);
}

.admin-form input,
.admin-form select {
  height: 36px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface);
  color: var(--admin-text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.admin-form textarea {
  padding: 10px 12px;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: var(--admin-shadow-focus);
}

.admin-form input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.admin-form textarea {
  resize: vertical;
}

.admin-checkbox {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  color: var(--admin-text) !important;
  font-weight: 400 !important;
}

.admin-checkbox input {
  width: auto;
}

.admin-form__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 800px) {
  .admin-form__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-product-form {
  display: grid;
  gap: 18px;
}

/* Formulário de produto em grid de 2 colunas de cards */
.admin-product-form--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.admin-product-form__col {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-form-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-form-section h2 {
  font-size: 17px;
}

.admin-form-submit {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 0 32px;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .admin-product-form--grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Images grid
   ========================================================================== */

.admin-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.admin-image-card {
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface);
  transition: border-color var(--admin-transition), transform var(--admin-transition);
}

.admin-image-card:hover {
  border-color: var(--admin-border-strong);
  transform: translateY(-1px);
}

.admin-image-card__preview {
  aspect-ratio: 4 / 3;
  background: var(--admin-surface-2);
}

.admin-image-card__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-image-card__body {
  display: grid;
  gap: 5px;
  padding: 11px;
}

.admin-image-card__body span,
.admin-image-card__body small {
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-images-empty {
  color: var(--admin-muted);
}

.admin-image-actions {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.admin-image-action {
  padding: 8px 10px;
  border: 1px solid var(--admin-border-strong);
  border-radius: 7px;
  background: var(--admin-surface);
  color: var(--admin-text);
  font: inherit;
  font-size: 12px;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
  transition: border-color var(--admin-transition);
}

.admin-image-action:hover {
  border-color: var(--admin-text);
}

.admin-image-action--danger {
  color: var(--admin-danger);
  border-color: var(--admin-danger-soft);
}

.admin-image-action:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ==========================================================================
   Detalhe do pedido — barra de resumo + grid 2 colunas
   ========================================================================== */

.admin-order__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-order__summary-main {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-order__summary-main label {
  min-width: 0;
}

.admin-order__summary-main select,
.admin-order__summary-main input {
  width: auto;
  min-width: 190px;
}

/*
 * "Pagamento" passou a mostrar forma + gateway + parcelas (ex.:
 * "Cartão de crédito · Asaas · 12x"), mais longo que os valores
 * anteriores ("Pago"/"-") que cabiam no min-width genérico acima.
 */
.admin-order__summary-main #paymentStatus {
  min-width: 260px;
}

.admin-order__summary-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--admin-muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.admin-order__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.admin-order__main,
.admin-order__side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-order__main .admin-panel,
.admin-order__side .admin-panel {
  margin-top: 0;
  min-width: 0;
}

@media (max-width: 960px) {
  .admin-order__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--admin-shadow);
  }

  .admin-sidebar-toggle {
    display: none;
  }

  body.is-nav-open .admin-sidebar {
    transform: translateX(0);
  }

  body.is-nav-open {
    overflow: hidden;
  }

  .admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 12, 10, 0.45);
    opacity: 0;
    transition: opacity 220ms ease;
  }

  body.is-nav-open .admin-sidebar-overlay {
    display: block;
    opacity: 1;
  }

  .admin-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .admin-mobile-topbar__logo {
    height: 21px;
    width: auto;
  }

  [data-theme="dark"] .admin-mobile-topbar__logo {
    filter: invert(1) brightness(1.9);
  }

  .admin-mobile-topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .admin-mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--admin-radius-sm);
    border: 1px solid var(--sidebar-border);
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
  }

  .admin-mobile-menu-btn svg {
    width: 19px;
    height: 19px;
  }

  .admin-mobile-topbar__actions .admin-notif-bell {
    width: 36px;
    height: 36px;
    border-radius: var(--admin-radius-sm);
    border: 1px solid var(--sidebar-border);
  }

  .admin-mobile-topbar__actions .admin-notif-bell svg {
    width: 18px;
    height: 18px;
  }

  .admin-content {
    padding: 20px 16px 48px;
  }

  .admin-quickstats__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-quickstats__item + .admin-quickstats__item {
    border-left: 0;
    border-top: 1px solid var(--admin-border);
  }

  .admin-shortcuts {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-product-form--grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-order__summary {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ========================================================
   CONFIGURAÇÕES DA LOJA
   ======================================================== */

.admin-settings-switches {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-setting-card {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  justify-content: space-between;
  gap: 24px !important;
  padding: 20px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.admin-setting-card:hover {
  border-color: var(--admin-accent);
  transform: translateY(-1px);
}

.admin-setting-card > div:first-child {
  display: grid;
  gap: 5px;
}

.admin-setting-card strong {
  font-size: 14px;
}

.admin-setting-card span {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.admin-switch {
  position: relative;
  flex: 0 0 auto;
}

.admin-switch input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-switch__track {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--admin-border);
  transition:
    background 180ms ease;
}

.admin-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 1px 4px rgba(0,0,0,.18);
  transition:
    transform 180ms ease;
}

.admin-switch input:checked +
.admin-switch__track {
  background: var(--admin-accent);
}

.admin-switch input:checked +
.admin-switch__track::after {
  transform: translateX(20px);
}

.admin-settings-info {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-settings-info > div {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
}

.admin-settings-info span {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 800px) {
  .admin-settings-switches,
  .admin-settings-info {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ========================================================
   DASHBOARD COMERCIAL
   ======================================================== */

/* Hero do dashboard */

.admin-dashboard-hero {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.admin-dashboard-hero__accent {
  flex: none;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--admin-accent), var(--admin-accent) 40%, transparent);
  align-self: stretch;
}

.admin-dashboard-hero__text {
  min-width: 0;
}

.admin-dashboard-hero .admin-eyebrow {
  margin: 0 0 4px;
}

.admin-dashboard-hero h1 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: var(--admin-weight-semibold);
  letter-spacing: -0.015em;
}

.admin-dashboard-date {
  margin: 3px 0 0;
  color: var(--admin-muted);
  font-size: 12.5px;
  font-weight: 400;
}

.admin-dashboard-metrics {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-metric-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.admin-metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--admin-accent);
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.25);
}

.admin-metric-card:hover .admin-stat__icon {
  color: var(--admin-accent);
  transform: scale(1.05);
}

.admin-stat__icon {
  transition:
    color 160ms ease,
    transform 160ms ease;
}

/* Animação de entrada do dashboard: aplicada via JS (dashboard.js) com uma
   classe temporária removida logo após terminar, para não deixar o elemento
   permanentemente promovido a uma camada de composição própria — isso já
   causou um bug real de empilhamento (dropdown do usuário renderizando atrás
   de cards do dashboard) quando a animação ficava presa via
   animation-fill-mode nesses elementos indefinidamente. */
.admin-dashboard-anim-in {
  animation: admin-dashboard-fade-up 220ms ease both;
  animation-delay: var(--admin-anim-delay, 0ms);
}

@keyframes admin-dashboard-fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-metric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-metric-card__header > span {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 400;
}

.admin-metric-card > strong {
  font-size: clamp(22px, 2vw, 30px);
  font-weight: var(--admin-weight-bold);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.admin-metric-card > small {
  color: var(--admin-muted);
  font-size: 12px;
}

/* Comparação percentual do KPI (Fase de redesign — só exibida quando
   existe dado real suficiente para calcular; nunca é inventada). */
.admin-metric-card__compare {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: var(--admin-weight-semibold);
}

.admin-metric-card__compare svg {
  width: 13px;
  height: 13px;
}

.admin-metric-card__compare--up {
  color: var(--admin-success);
}

.admin-metric-card__compare--down {
  color: var(--admin-danger);
}

.admin-metric-card__compare--flat {
  color: var(--admin-muted);
}

.admin-metric-card__compare-label {
  color: var(--admin-muted);
  font-weight: 400;
}

/* ==========================================================================
   Selo de dado mockado (DEV) — usado SOMENTE em seções visuais que ainda
   não têm fonte de dado real (ex.: funil de vendas). Nunca deve aparecer
   em uma seção alimentada por API real. Fácil de identificar e remover:
   toda vez que o dado real existir, a seção correspondente perde esta tag.
   ========================================================================== */
.admin-dev-mock-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--admin-radius-pill);
  background: var(--admin-warning-soft);
  color: var(--admin-warning);
  font-size: 10.5px;
  font-weight: var(--admin-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Funil de vendas (visual — dados mock DEV até existir analytics real) */
.admin-funnel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.admin-funnel__stage {
  display: grid;
  grid-template-columns: 120px 1fr 64px;
  align-items: center;
  gap: 14px;
}

.admin-funnel__label {
  font-size: 13px;
  color: var(--admin-text);
  font-weight: var(--admin-weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-funnel__track {
  position: relative;
  height: 28px;
  border-radius: 7px;
  background: var(--admin-surface-2);
  overflow: hidden;
}

.admin-funnel__fill {
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--admin-accent), var(--admin-accent-hover));
  transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-funnel__count {
  font-size: 13px;
  font-weight: var(--admin-weight-semibold);
  text-align: right;
  color: var(--admin-text);
}

.admin-funnel__drop {
  grid-column: 2 / 3;
  margin: -2px 0 0;
  font-size: 11px;
  color: var(--admin-muted);
}

.admin-dashboard-operation {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-dashboard-operation article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
}

.admin-dashboard-operation span {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 400;
}

.admin-dashboard-operation strong {
  font-size: 22px;
}

/* Saudação no topo do dashboard */

.admin-dashboard-greeting {
  margin: 8px 0 0;
  color: var(--admin-text);
  font-size: 14.5px;
  font-weight: 400;
}

.admin-dashboard-greeting strong {
  font-weight: var(--admin-weight-semibold);
}

/* Pendências operacionais */

.admin-pendencies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--admin-border);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-pendency {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--admin-surface);
  color: inherit;
  text-decoration: none;
  transition: background-color 150ms ease;
}

a.admin-pendency:hover {
  background: var(--admin-surface-hover);
}

.admin-pendency__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.admin-pendency__icon svg {
  width: 15px;
  height: 15px;
}

.admin-pendency--warn .admin-pendency__icon {
  background: var(--admin-warning-soft);
  color: var(--admin-warning);
}

.admin-pendency--danger .admin-pendency__icon {
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
}

.admin-pendency.is-active .admin-pendency__value {
  font-weight: var(--admin-weight-bold);
}

.admin-pendency--warn.is-active .admin-pendency__value {
  color: var(--admin-warning);
}

.admin-pendency--danger.is-active .admin-pendency__value {
  color: var(--admin-danger);
}

.admin-pendency.is-active:not(.admin-pendency--warn):not(.admin-pendency--danger) .admin-pendency__value {
  color: var(--admin-accent);
}

.admin-pendency__body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.admin-pendency__value {
  font-size: 18px;
  letter-spacing: -0.01em;
}

.admin-pendency__label {
  font-size: 11.5px;
  color: var(--admin-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cartões de gráfico */

.admin-chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.admin-period-toggle {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-btn);
  background: var(--admin-surface-2);
}

.admin-period-toggle button {
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--admin-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.admin-period-toggle button.is-active {
  background: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-shadow-sm);
}

.admin-chart-wrap {
  position: relative;
  width: 100%;
  margin-top: 12px;
}

.admin-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.admin-chart-line {
  fill: none;
  stroke: var(--admin-accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-chart-area {
  fill: var(--admin-accent);
  opacity: 0.07;
}

.admin-chart-grid line {
  stroke: var(--admin-border);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.admin-chart-axis text {
  fill: var(--admin-muted);
  font-size: 10px;
  font-family: var(--admin-font-regular);
}

.admin-chart-dot {
  fill: var(--admin-surface);
  stroke: var(--admin-accent);
  stroke-width: 2;
  opacity: 0;
  transition: opacity 120ms ease;
}

.admin-chart-hit:hover + .admin-chart-dot,
.admin-chart-dot.is-visible {
  opacity: 1;
}

.admin-chart-hit {
  fill: transparent;
}

.admin-chart-tooltip {
  position: absolute;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--admin-text);
  color: var(--admin-bg);
  font-size: 11.5px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 5;
}

.admin-chart-tooltip.is-visible {
  opacity: 1;
}

.admin-chart-tooltip strong {
  display: block;
  font-size: 12.5px;
  font-weight: var(--admin-weight-semibold);
}

/* Pedidos por status — barras horizontais */

.admin-status-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-status-bar__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-status-bar__label {
  flex: 0 0 108px;
  font-size: 12px;
  color: var(--admin-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-status-bar__track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--admin-surface-2);
  overflow: hidden;
}

.admin-status-bar__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--admin-accent);
  transition: width 300ms ease;
}

.admin-status-bar__fill--success { background: var(--admin-success); }
.admin-status-bar__fill--warning { background: var(--admin-warning); }
.admin-status-bar__fill--danger { background: var(--admin-danger); }
.admin-status-bar__fill--neutral { background: var(--admin-muted-2); }

.admin-status-bar__count {
  flex: 0 0 26px;
  text-align: right;
  font-size: 12.5px;
}

.admin-chart-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 30px 10px;
  color: var(--admin-muted);
  text-align: center;
}

.admin-chart-empty svg {
  width: 22px;
  height: 22px;
  padding: 12px;
  box-sizing: content-box;
  border-radius: 50%;
  border: 1px dashed var(--admin-border);
  color: var(--admin-muted-2);
}

.admin-chart-empty span {
  font-size: 12.5px;
  max-width: 260px;
}

.admin-chart-skeleton {
  height: 140px;
  border-radius: var(--admin-radius-sm);
}

@media (max-width: 700px) {
  .admin-pendencies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(320px, .65fr);
  gap: 18px;
}

.admin-dashboard-grid .admin-panel {
  margin: 0;
  min-width: 0;
}

.admin-dashboard-link {
  color: var(--admin-accent);
  font-size: 13px;
  font-weight: var(--admin-weight-semibold);
  text-decoration: none;
}

.admin-dashboard-link:hover {
  text-decoration: underline;
}

.admin-order-link {
  display: block;
  color: inherit;
  font-weight: var(--admin-weight-semibold);
  text-decoration: none;
}

.admin-order-link:hover {
  color: var(--admin-accent);
}

.admin-table-secondary {
  display: block;
  margin-top: 4px;
  color: var(--admin-muted);
  font-size: 11px;
}

.admin-top-products {
  display: grid;
}

.admin-top-product {
  display: grid;
  grid-template-columns:
    32px
    minmax(0, 1fr)
    auto;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom:
    1px solid var(--admin-border);
}

.admin-top-product:last-child {
  border-bottom: 0;
}

.admin-top-product__rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    color-mix(
      in srgb,
      var(--admin-accent) 12%,
      transparent
    );
  color: var(--admin-accent);
  font-size: 12px;
  font-weight: 400;
}

.admin-top-product__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-top-product__body strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-top-product__body span,
.admin-top-product__metrics span {
  color: var(--admin-muted);
  font-size: 11px;
}

.admin-top-product__metrics {
  display: grid;
  gap: 4px;
  text-align: right;
}

.admin-top-product__metrics strong {
  font-size: 13px;
}

.admin-dashboard-empty {
  margin: 0;
  padding: 24px 0;
  color: var(--admin-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1100px) {
  .admin-dashboard-metrics {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .admin-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  .admin-dashboard-metrics,
  .admin-dashboard-operation {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-metric-card {
    padding: 18px;
  }
}

/* CLIENTES */


/* ========================================================
   FICHA DO CLIENTE
   ======================================================== */

.admin-customer-metrics {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-customer-detail-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.5fr)
    minmax(300px, .5fr);
  gap: 18px;
  align-items: start;
}

.admin-customer-detail-main,
.admin-customer-detail-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-customer-detail-grid .admin-panel {
  margin: 0;
  min-width: 0;
}

.admin-customer-address {
  padding: 16px 0;
  border-bottom:
    1px solid var(--admin-border);
}

.admin-customer-address:first-child {
  padding-top: 0;
}

.admin-customer-address:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-customer-address__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-customer-address p {
  margin: 3px 0;
  color: var(--admin-text);
  font-size: 13px;
  line-height: 1.45;
}

.admin-customer-address small {
  display: block;
  margin-top: 8px;
  color: var(--admin-muted);
}

.admin-customer-meta {
  display: grid;
  gap: 16px;
}

.admin-customer-meta > div {
  display: grid;
  gap: 4px;
}

.admin-customer-meta span {
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-customer-meta strong {
  font-size: 13px;
}

.admin-header .admin-eyebrow a {
  color: inherit;
  text-decoration: none;
}

.admin-header .admin-eyebrow a:hover {
  color: var(--admin-accent);
}

@media (max-width: 1100px) {
  .admin-customer-metrics {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .admin-customer-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  .admin-customer-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ========================================================
   AÇÕES DO HEADER / BOTÕES ADMIN
   ======================================================== */

.admin-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.admin-button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  height: 36px;
  padding: 0 16px;

  border: 0;
  border-radius: var(--admin-radius-btn);

  background: var(--admin-accent);
  color: var(--admin-accent-contrast);

  font-family: inherit;
  font-size: 13.5px;
  font-weight: var(--admin-weight-semibold);
  line-height: 1;

  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;

  transition:
    background-color 200ms ease,
    transform 200ms ease,
    box-shadow 200ms ease;
}

.admin-button-primary:hover:not(:disabled) {
  background: var(--admin-accent-hover);
  box-shadow: 0 6px 16px -4px var(--admin-accent-soft-strong);
  transform: translateY(-1px);
}

.admin-button-primary:active:not(:disabled) {
  background: var(--admin-accent-hover);
  box-shadow: 0 2px 6px -2px var(--admin-accent-soft-strong);
  transform: translateY(0) scale(0.98);
}

.admin-button-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.admin-header__actions .admin-user {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .admin-header {
    align-items: flex-start;
  }

  .admin-header__actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .admin-button-primary {
    min-height: 38px;
    padding-inline: 14px;
  }
}

/* PDF DO PEDIDO */

#downloadOrderPdf {
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .admin-header__actions {
    align-items: stretch;
  }

  #downloadOrderPdf {
    width: 100%;
  }
}

/* ========================================================
   BANNERS
   ======================================================== */

.admin-page-description {
  margin: 5px 0 0;
  color: var(--admin-text-muted);
  font-size: 13px;
}

.admin-banner-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-surface);
  font-size: 13px;
}

.admin-banner-message.is-success {
  border-color: rgba(30, 140, 75, .25);
}

.admin-banner-message.is-error {
  border-color: rgba(190, 50, 50, .3);
}

.admin-banner-table-wrap {
  overflow-x: auto;
}

.admin-banner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-banner-table th,
.admin-banner-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--admin-border);
  text-align: left;
  vertical-align: middle;
}

.admin-banner-table th {
  color: var(--admin-text-muted);
  font-size: 11px;
  font-weight: var(--admin-weight-semibold);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-banner-table td strong,
.admin-banner-table td small {
  display: block;
}

.admin-banner-table td small {
  margin-top: 4px;
  color: var(--admin-text-muted);
}

.admin-banner-thumb {
  display: block;
  width: 112px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface-2);
}

.admin-banner-thumb--empty {
  display: grid;
  place-items: center;
  color: var(--admin-text-muted);
}

.admin-banner-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
}

.admin-banner-status.is-active {
  background: rgba(30, 140, 75, .10);
  color: #23834b;
}

.admin-banner-status.is-inactive,
.admin-banner-status.is-ended {
  background: rgba(120, 120, 120, .10);
  color: var(--admin-text-muted);
}

.admin-banner-status.is-scheduled {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.admin-banner-period {
  min-width: 150px;
}

.admin-banner-edit {
  border: 0;
  background: transparent;
  color: var(--admin-accent);
  font: inherit;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
}

.admin-banner-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--admin-text-muted);
}

.admin-banner-editor {
  margin-top: 18px;
}

.admin-banner-editor__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-banner-editor__header h2 {
  margin: 2px 0 0;
}

.admin-banner-cancel {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.admin-banner-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-banner-field {
  display: grid;
  gap: 7px;
}

.admin-banner-field--wide {
  grid-column: 1 / -1;
}

.admin-banner-field > span {
  font-size: 12px;
  font-weight: 400;
}

.admin-banner-field input,
.admin-banner-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--admin-border);
  border-radius: 9px;
  background: var(--admin-surface);
  color: var(--admin-text);
  padding: 10px 12px;
  font: inherit;
}

.admin-banner-field textarea {
  resize: vertical;
}

.admin-banner-switch-row {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--admin-border);
}

.admin-banner-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.admin-banner-switch input {
  margin-top: 3px;
}

.admin-banner-switch strong,
.admin-banner-switch small {
  display: block;
}

.admin-banner-switch small {
  margin-top: 4px;
  color: var(--admin-text-muted);
  font-size: 12px;
}

.admin-banner-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 22px;
}

.admin-banner-image-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
}

.admin-banner-image-card strong,
.admin-banner-image-card small {
  display: block;
}

.admin-banner-image-card small {
  margin-top: 4px;
  color: var(--admin-text-muted);
  font-size: 11px;
}

.admin-banner-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 7;
  border: 1px dashed var(--admin-border);
  border-radius: 10px;
  background: var(--admin-surface-2);
  color: var(--admin-text-muted);
  font-size: 12px;
}

.admin-banner-preview--mobile {
  aspect-ratio: 4 / 3;
}

.admin-banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-banner-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--admin-border);
}

.admin-banner-delete {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(190, 50, 50, .25);
  border-radius: 9px;
  background: transparent;
  color: #bd3636;
  font: inherit;
  font-size: 12px;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
}

@media (max-width: 760px) {
  .admin-banner-form-grid,
  .admin-banner-images {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-banner-field--wide {
    grid-column: auto;
  }

  .admin-banner-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-banner-form-actions button {
    width: 100%;
  }
}

/* ========================================================
   HISTÓRICO DE NOTIFICAÇÕES DO PEDIDO
   ======================================================== */

.admin-order-notifications {
  margin-top: 18px;
}

.admin-order-notifications__message {
  color: var(--admin-text-muted);
  font-size: 13px;
}

.admin-order-notifications__list {
  display: grid;
  gap: 10px;
}

.admin-order-notification {
  padding: 14px 15px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-surface);
}

.admin-order-notification__main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-order-notification__main strong,
.admin-order-notification__main span {
  display: block;
}

.admin-order-notification__main > div > span {
  margin-top: 3px;
  color: var(--admin-text-muted);
  font-size: 12px;
}

.admin-order-notification__status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.admin-order-notification__status.is-registered {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.admin-order-notification__status.is-pending {
  background: rgba(210, 150, 30, .12);
  color: #a66a00;
}

.admin-order-notification__status.is-sent {
  background: rgba(30, 140, 75, .11);
  color: #23834b;
}

.admin-order-notification__status.is-failed {
  background: rgba(190, 50, 50, .11);
  color: #bd3636;
}

.admin-order-notification__status.is-skipped {
  background: rgba(120, 120, 120, .10);
  color: var(--admin-text-muted);
}

.admin-order-notification__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 11px;
  color: var(--admin-text-muted);
  font-size: 11px;
}

.admin-order-notification__meta strong {
  color: var(--admin-text);
}

.admin-order-notification__error {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(190, 50, 50, .08);
  color: #bd3636;
  font-size: 11px;
}

@media (max-width: 700px) {
  .admin-order-notification__main {
    flex-direction: column;
  }
}

/* ========================================================
   NOTA FISCAL DO PEDIDO
   ======================================================== */

.admin-order-invoice {
  margin-top: 18px;
}

.admin-order-invoice__description {
  margin: 5px 0 0;
  color: var(--admin-text-muted);
  font-size: 12px;
}

.admin-invoice-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
}

.admin-invoice-status.is-not-issued {
  background: rgba(210, 150, 30, .12);
  color: #a66a00;
}

.admin-invoice-status.is-issued {
  background: rgba(30, 140, 75, .11);
  color: #23834b;
}

.admin-invoice-status.is-cancelled {
  background: rgba(190, 50, 50, .11);
  color: #bd3636;
}

.admin-order-invoice__message {
  margin-bottom: 16px;
  color: var(--admin-text-muted);
  font-size: 13px;
}

.admin-order-invoice__message.is-success {
  color: #23834b;
}

.admin-order-invoice__message.is-error {
  color: #bd3636;
}

.admin-order-invoice__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-order-invoice__grid label {
  display: grid;
  gap: 7px;
}

.admin-order-invoice__grid label > span {
  font-size: 12px;
  font-weight: 400;
}

.admin-order-invoice__grid input,
.admin-order-invoice__grid select,
.admin-order-invoice__grid textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 9px;
  background: var(--admin-surface);
  color: var(--admin-text);
  font: inherit;
}

.admin-order-invoice__grid textarea {
  resize: vertical;
}

.admin-order-invoice__wide {
  grid-column: 1 / -1;
}

.admin-order-invoice__documents {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.admin-invoice-document {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 11px;
}

.admin-invoice-document strong,
.admin-invoice-document small {
  display: block;
}

.admin-invoice-document small {
  margin-top: 4px;
  color: var(--admin-text-muted);
  font-size: 11px;
}

.admin-invoice-document input[type="file"] {
  max-width: 100%;
  font-size: 12px;
}

.admin-invoice-document__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-invoice-secondary,
.admin-invoice-download {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
}

.admin-invoice-secondary {
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.admin-invoice-download {
  border: 1px solid var(--admin-accent);
  background: transparent;
  color: var(--admin-accent);
}

.admin-order-invoice__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--admin-border);
}

@media (max-width: 760px) {
  .admin-order-invoice__grid,
  .admin-order-invoice__documents {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-order-invoice__wide {
    grid-column: auto;
  }

  .admin-order-invoice__footer {
    justify-content: stretch;
  }

  .admin-order-invoice__footer button {
    width: 100%;
  }
}

/* PDF DIRETO NA LISTA DE PEDIDOS */

.admin-pdf-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  height: 30px;

  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-btn-sm);

  background: var(--admin-surface);
  color: var(--admin-muted);

  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.admin-pdf-action svg {
  width: 15px;
  height: 15px;
}

.admin-pdf-action:hover:not(:disabled) {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.admin-pdf-action.is-disabled,
.admin-pdf-action:disabled {
  border-color: var(--admin-border);
  color: var(--admin-muted);
  background: transparent;
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-pdf-action--danger:hover:not(:disabled) {
  border-color: var(--admin-danger);
  color: var(--admin-danger);
  background: var(--admin-danger-soft);
}

/* ==========================================================================
   EXCLUSÃO SEGURA DE PEDIDOS (Admin Master Dev) — modal de confirmação
   ========================================================================== */

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 13, 10, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.admin-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.admin-modal-overlay[hidden] {
  display: none;
}

.admin-modal {
  width: min(440px, 100%);
  background: var(--admin-surface);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
  padding: 24px;
  transform: translateY(8px) scale(0.98);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-modal-overlay.is-open .admin-modal {
  transform: translateY(0) scale(1);
}

.admin-modal h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
}

.admin-modal__warning {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 18px;
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
  padding: 10px 12px;
  border-radius: var(--admin-radius-sm);
}

.admin-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--admin-muted);
  margin-bottom: 8px;
}

.admin-modal__field input {
  font-family: inherit;
  font-size: 15px;
  padding: 9px 12px;
  border-radius: var(--admin-radius-btn-sm);
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.admin-modal__field input:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: var(--admin-shadow-focus);
}

.admin-modal__error {
  font-size: 13px;
  color: var(--admin-danger);
  margin: 10px 0 0;
}

.admin-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.admin-button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  height: 36px;
  padding: 0 16px;

  border: 0;
  border-radius: var(--admin-radius-btn);

  background: var(--admin-danger);
  color: #ffffff;

  font-family: inherit;
  font-size: 13.5px;
  font-weight: var(--admin-weight-semibold);
  line-height: 1;

  cursor: pointer;
  transition: background-color 200ms ease, transform 200ms ease, opacity 200ms ease;
}

.admin-button-danger:hover:not(:disabled) {
  background: #9a1c10;
}

.admin-button-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-button-danger[hidden] {
  display: none;
}

/* ==========================================================================
   REDESIGN V2 — piloto Dashboard / Pedidos / Cupons
   Composição nova (page header, faixa de KPIs, grids com hierarquia de
   largura, funil+status agrupados, atalhos como chips). Classes exclusivas
   a este bloco para não afetar Produtos/Clientes/Categorias/Banners/
   Configurações/Usuários, que continuam no padrão anterior até aprovação.
   ========================================================================== */

.admin-pageheader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-pageheader__text h1 {
  margin: 0;
  font-size: 21px;
  font-weight: var(--admin-weight-semibold);
  letter-spacing: -0.015em;
}

.admin-pageheader__sub {
  margin: 4px 0 0;
  color: var(--admin-muted);
  font-size: 13px;
}

.admin-pageheader__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-pageheader__date {
  color: var(--admin-muted-2);
  font-size: 12px;
}

@media (max-width: 700px) {
  .admin-pageheader {
    align-items: flex-start;
  }

  .admin-pageheader__actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Faixa única de KPIs — um só painel dividido, não quatro cards soltos */

.admin-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-sm);
  overflow: hidden;
}

.admin-kpi-strip__item {
  padding: 13px 18px;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-kpi-strip__item + .admin-kpi-strip__item {
  border-left: 1px solid var(--admin-border);
}

.admin-kpi-strip__label {
  font-size: 11px;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-kpi-strip__value {
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: var(--admin-weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.admin-kpi-strip__caption {
  font-size: 11px;
  color: var(--admin-muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 800px) {
  .admin-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-kpi-strip__item {
    border-left: 0 !important;
    border-top: 1px solid var(--admin-border);
  }

  .admin-kpi-strip__item:nth-child(1),
  .admin-kpi-strip__item:nth-child(2) {
    border-top: 0;
  }

  .admin-kpi-strip__item:nth-child(even) {
    border-left: 1px solid var(--admin-border) !important;
  }

  .admin-kpi-strip__caption {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Painéis compactos (pendências, operação) — menos respiro que .admin-panel padrão */

.admin-panel--tight {
  padding: 10px 14px;
}

.admin-panel--tight .admin-panel__header {
  margin-bottom: 4px;
}

/* Pendências operacionais mais enxutas dentro do novo layout */

.admin-panel--tight .admin-pendencies {
  border: 0;
  background: transparent;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.admin-panel--tight .admin-pendency {
  padding: 8px 10px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-panel--tight .admin-pendency__icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.admin-panel--tight .admin-pendency__icon svg {
  width: 13px;
  height: 13px;
}

.admin-panel--tight .admin-pendency__value {
  font-size: 15px;
}

.admin-panel--tight .admin-pendency__label {
  font-size: 10.5px;
}

/* Grid 60/40 para Status por pedido + Funil de vendas, agrupados numa
   única linha compacta em vez de duas seções empilhadas */

.admin-grid-ops {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.admin-grid-ops .admin-panel {
  margin: 0;
  min-width: 0;
}

@media (max-width: 1100px) {
  .admin-grid-ops {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Funil compacto lado a lado (label | barra | contagem numa linha só) */

.admin-funnel--compact {
  gap: 7px;
  margin-top: 10px;
}

.admin-funnel--compact .admin-funnel__stage {
  grid-template-columns: 82px 1fr 46px;
  gap: 10px;
}

.admin-funnel--compact .admin-funnel__track {
  height: 20px;
  border-radius: 5px;
}

.admin-funnel--compact .admin-funnel__label {
  font-size: 12px;
}

.admin-funnel--compact .admin-funnel__count {
  font-size: 12px;
}

.admin-funnel--compact .admin-funnel__drop {
  display: none;
}

/* Atalhos como chips discretos, não cards grandes */

.admin-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.admin-quicklink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-pill);
  background: var(--admin-surface);
  color: var(--admin-text);
  font-size: 12.5px;
  font-weight: var(--admin-weight-semibold);
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.admin-quicklink svg {
  width: 14px;
  height: 14px;
  color: var(--admin-accent);
}

.admin-quicklink:hover {
  background: var(--admin-accent-soft);
  border-color: var(--admin-accent-soft-strong);
  transform: translateY(-1px);
}

/* Cupons — separar claramente criação (painel recolhível) de listagem */

.admin-coupon-formpanel[hidden] {
  display: none;
}

.admin-coupon-formpanel {
  animation: admin-dashboard-fade-up 180ms ease both;
}


/* Orçamentos — drawer de detalhe (somente leitura) */

.admin-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(15, 13, 10, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.admin-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.admin-drawer-overlay[hidden] {
  display: none;
}

.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: var(--admin-surface);
  border-left: 1px solid var(--admin-border);
  box-shadow: -12px 0 32px rgba(30, 25, 20, 0.14);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-drawer-overlay.is-open .admin-drawer {
  transform: translateX(0);
}

.admin-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--admin-border);
  flex: none;
}

.admin-drawer__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-drawer__title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
}

.admin-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--admin-radius-btn-sm);
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
  flex: none;
}

.admin-drawer__close:hover {
  background: var(--admin-surface-2);
  color: var(--admin-text);
}

.admin-drawer__close svg {
  width: 16px;
  height: 16px;
}

.admin-drawer__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.admin-drawer__section {
  margin-bottom: 22px;
}

.admin-drawer__section:last-child {
  margin-bottom: 0;
}

.admin-drawer__section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-muted);
  margin: 0 0 10px;
}

.admin-drawer__list {
  margin: 0;
}

.admin-drawer__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--admin-border);
}

.admin-drawer__row:last-child {
  border-bottom: 0;
}

.admin-drawer__row dt {
  color: var(--admin-muted);
  flex: none;
}

.admin-drawer__row dd {
  margin: 0;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
  text-align: right;
  word-break: break-word;
}

.admin-drawer__row dd.is-muted {
  font-weight: var(--admin-weight-regular);
  color: var(--admin-muted-2);
}

.admin-drawer__items {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-drawer__items th,
.admin-drawer__items td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.admin-drawer__items th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-muted);
  font-weight: var(--admin-weight-semibold);
}

.admin-drawer__items td.is-num {
  text-align: right;
  white-space: nowrap;
}

.admin-drawer__ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.admin-drawer__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-muted);
  border-radius: var(--admin-radius-btn-sm);
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.admin-drawer__copy:hover {
  background: var(--admin-surface-2);
  color: var(--admin-text);
}

.admin-drawer__copy svg {
  width: 13px;
  height: 13px;
}

.admin-drawer__tech {
  background: var(--admin-surface-2);
  border-radius: var(--admin-radius-sm);
  padding: 12px 14px;
}

@media (max-width: 700px) {
  .admin-drawer {
    width: 100%;
  }
}

/* ==========================================================================
   Pedido manual — /admin/pedidos/novo/ (criação) e bloco de pagamentos
   manuais em /admin/pedidos/detalhe/ (pedido já existente)
   ========================================================================== */

/*
 * Inputs/selects/textarea de TODO o formulário de pedido manual —
 * mesma receita de .admin-form (admin.css), duplicada aqui porque
 * este form não carrega essa classe (mesmo padrão já usado por
 * .admin-order-invoice__grid). type=radio/checkbox ficam fora do
 * width:100% — são os seletores de endereço, nunca campos de texto.
 */
.admin-manual-order label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: var(--admin-weight-regular);
  color: var(--admin-muted);
}

.admin-manual-order input,
.admin-manual-order select,
.admin-manual-order textarea {
  box-sizing: border-box;
  width: 100%;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface);
  color: var(--admin-text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.admin-manual-order textarea {
  height: auto;
  padding: 10px 13px;
  resize: vertical;
}

.admin-manual-order input:focus,
.admin-manual-order select:focus,
.admin-manual-order textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: var(--admin-shadow-focus);
}

.admin-manual-order input:disabled,
.admin-manual-order select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-manual-order input[type="radio"],
.admin-manual-order input[type="checkbox"] {
  width: auto;
  height: auto;
  accent-color: var(--admin-accent);
}

.admin-manual-order__wide {
  grid-column: 1 / -1;
}

.admin-manual-order__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--admin-muted);
}

/* ── Campo monetário: prefixo "R$" dentro do próprio input ────── */

.admin-money-field {
  position: relative;
}

.admin-money-field::before {
  content: "R$";
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-muted-2);
  pointer-events: none;
}

.admin-money-field input {
  padding-left: 36px !important;
}

/* ── Cliente: alternância existente/novo ───────────────────────── */

.admin-manual-order__toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--admin-surface-2);
  border-radius: var(--admin-radius-btn);
}

.admin-manual-order__toggle-btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--admin-radius-btn-sm);
  background: transparent;
  color: var(--admin-muted);
  font-family: var(--admin-font-regular);
  font-size: 13px;
  font-weight: var(--admin-weight-semibold);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.admin-manual-order__toggle-btn:hover {
  color: var(--admin-text);
}

.admin-manual-order__toggle-btn.is-active {
  background: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-shadow-sm);
}

/* ── Busca / cadastro de cliente ───────────────────────────────── */

.admin-manual-order__search-results {
  margin-top: 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--admin-shadow-sm);
}

.admin-manual-order__search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-surface);
  text-align: left;
  font-family: var(--admin-font-regular);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.admin-manual-order__search-item:last-child {
  border-bottom: none;
}

.admin-manual-order__search-item:hover {
  background: var(--admin-surface-hover);
}

.admin-manual-order__search-item strong {
  font-size: 13.5px;
  color: var(--admin-text);
  font-weight: var(--admin-weight-semibold);
}

.admin-manual-order__search-item span {
  font-size: 12px;
  color: var(--admin-muted);
}

.admin-manual-order__search-empty {
  padding: 18px;
  font-size: 13px;
  color: var(--admin-muted);
  text-align: center;
}

.admin-manual-order__selected-customer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface-2);
}

.admin-manual-order__selected-customer-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-manual-order__selected-customer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-manual-order__selected-customer-info strong {
  font-size: 14px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
}

.admin-manual-order__selected-customer-info span {
  font-size: 12px;
  color: var(--admin-muted);
}

/* ── Endereço de entrega: cartões selecionáveis ────────────────── */

.admin-manual-order__address-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-manual-order__address-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.admin-manual-order__address-option:hover {
  background: var(--admin-surface-hover);
}

.admin-manual-order__address-option:has(input:checked) {
  border-color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.admin-manual-order__address-option input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.admin-manual-order__address-option-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13.5px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
}

.admin-manual-order__address-option-body p {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--admin-text);
}

.admin-manual-order__address-option-body small {
  display: block;
  margin-top: 4px;
  color: var(--admin-muted);
}

/* ── Seletor de produto/variante e de pagamento: cartão-ferramenta ── */

.admin-manual-order__item-picker,
.admin-manual-order__payment-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--admin-surface-2);
}

.admin-manual-order__item-picker button,
.admin-manual-order__payment-picker button {
  height: 38px;
}

@media (max-width: 760px) {
  .admin-manual-order__item-picker,
  .admin-manual-order__payment-picker {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Lista de itens/pagamentos vazia ────────────────────────────── */

.admin-manual-order__empty-row,
.admin-manual-order__empty-state {
  text-align: center;
  color: var(--admin-muted);
  font-size: 13px;
  padding: 28px 0;
}

/* ── Cartões de pagamento — identificação visual recebido/pendente ── */

.admin-payment-cards {
  display: grid;
  gap: 10px;
}

.admin-payment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--admin-border);
  border-left: 3px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface);
}

.admin-payment-card--paid {
  border-left-color: var(--admin-success);
  background: var(--admin-success-soft);
}

.admin-payment-card--pending {
  border-left-color: var(--admin-warning);
}

.admin-payment-card--cancelled {
  border-left-color: var(--admin-danger);
  opacity: 0.75;
}

.admin-payment-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--admin-surface-2);
  color: var(--admin-muted);
}

.admin-payment-card--paid .admin-payment-card__icon {
  background: var(--admin-success-soft);
  color: var(--admin-success);
}

.admin-payment-card--pending .admin-payment-card__icon {
  background: var(--admin-warning-soft);
  color: var(--admin-warning);
}

.admin-payment-card--cancelled .admin-payment-card__icon {
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
}

.admin-payment-card__icon svg {
  width: 16px;
  height: 16px;
}

.admin-payment-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.admin-payment-card__body strong {
  font-size: 13.5px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
}

.admin-payment-card__body span {
  font-size: 12px;
  color: var(--admin-muted);
}

.admin-payment-card__amount {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: var(--admin-weight-semibold);
  color: var(--admin-text);
  white-space: nowrap;
}

.admin-payment-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .admin-payment-card {
    flex-wrap: wrap;
  }

  .admin-payment-card__amount {
    order: 1;
    margin-left: 48px;
  }

  .admin-payment-card__actions {
    order: 2;
    width: 100%;
    margin-left: 48px;
  }
}

/* ── Resumo financeiro destacado (criação e detalhe do pedido) ──── */

.admin-manual-order__totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--admin-radius);
  background: var(--admin-surface-2);
}

.admin-manual-order__totals div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-manual-order__totals span {
  font-size: 11px;
  font-weight: var(--admin-weight-semibold);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.admin-manual-order__totals strong {
  font-size: 18px;
  color: var(--admin-text);
}

.admin-manual-order__totals-grand {
  padding-left: 16px;
  border-left: 1px solid var(--admin-border);
}

.admin-manual-order__totals-grand strong {
  color: var(--admin-accent);
}

@media (max-width: 640px) {
  .admin-manual-order__totals-grand {
    border-left: none;
    padding-left: 0;
    padding-top: 12px;
    border-top: 1px solid var(--admin-border);
  }
}

.admin-manual-order__message {
  margin: 16px 0;
  padding: 13px 16px;
  border-radius: var(--admin-radius-sm);
  font-size: 13px;
  background: var(--admin-surface-2);
  color: var(--admin-text);
}

.admin-manual-order__message.is-error {
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
}

.admin-manual-order__message.is-success {
  background: var(--admin-success-soft);
  color: var(--admin-success);
}

.admin-manual-order__submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 24px;
}

.admin-manual-order__submit button {
  min-width: 180px;
  height: 42px;
}

/* ── Painel financeiro em /admin/pedidos/detalhe/ ──────────────── */

.admin-manual-order-finance {
  margin-top: 14px;
}

.admin-manual-order__inventory-warning {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-danger);
  background: var(--admin-danger-soft);
  color: var(--admin-danger);
  font-size: 13px;
  line-height: 1.6;
}

.admin-manual-order__inventory-warning strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.admin-manual-order__inventory-warning-actions {
  margin-top: 12px;
}

.admin-manual-order__inventory-warning-message {
  margin: 10px 0 0;
  font-size: 12px;
}

.admin-manual-order-finance__balance-note {
  font-size: 13px;
  color: var(--admin-muted);
}

.admin-manual-order-finance__summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: var(--admin-radius);
  background: var(--admin-surface-2);
}

.admin-manual-order-finance__summary div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-manual-order-finance__summary span {
  font-size: 11px;
  font-weight: var(--admin-weight-semibold);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.admin-manual-order-finance__summary strong {
  font-size: 18px;
  color: var(--admin-text);
}

.admin-manual-order-finance__summary .is-balance {
  padding-left: 16px;
  border-left: 1px solid var(--admin-border);
}

.admin-manual-order-finance__summary .is-balance strong {
  color: var(--admin-accent);
}

@media (max-width: 640px) {
  .admin-manual-order-finance__summary .is-balance {
    border-left: none;
    padding-left: 0;
    padding-top: 12px;
    border-top: 1px solid var(--admin-border);
  }
}
