:root {
  --font-display: "Fraunces", "Merriweather", Georgia, serif;
  --font-body: "Inter", "Open Sans", system-ui, sans-serif;
  /* Paleta espelhada do site (css/style.css) — este arquivo não importa o style.css */
  --green-900: #26381e;
  --green-800: #354d2b;
  --green-600: #6c914a;
  --border: #dce5cf;
  --radius-lg: 14px;
  --admin-bg: #f5f7f4;
  --admin-card: #ffffff;
  --admin-border: #e0e8d8;
  --admin-text: #2c3730;
  --admin-soft: #6a8c4d;
  --text-soft: #65705b;
  --admin-primary: #5f7f3f;
  --admin-primary-strong: #496730;
  --admin-danger: #c0392b;
  --admin-primary-hover: #6c914a;
  --admin-sidebar-ink: #e9f2e0;
  --admin-sidebar-muted: rgba(233, 242, 224, 0.72);
  --admin-shadow: 0 1px 2px rgba(36, 48, 31, 0.06), 0 8px 24px rgba(36, 48, 31, 0.07);
  --admin-shadow-lg: 0 8px 24px rgba(36, 48, 31, 0.12);
}

* {
  box-sizing: border-box;
}

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

[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(229, 237, 222, 0.6);
  border-radius: 28px;
  padding: 2.2rem 1.7rem 1.6rem;
  box-shadow: 0 18px 44px rgba(44, 55, 48, 0.16);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  color: #26381e;
  font-size: 1.9rem;
  line-height: 1.15;
  text-wrap: balance;
}

.auth-logo {
  display: block;
  width: 78px;
  height: auto;
  margin-bottom: 0.9rem;
}

.auth-subtitle {
  margin: 0;
  color: #65705b;
  font-size: 0.92rem;
  font-weight: 700;
}

/* Campo de senha com botão mostrar/ocultar */
.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 2.8rem;
}

.password-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #54723c;
  font-size: 1rem;
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(84, 114, 60, 0.1);
}

.password-toggle.is-on {
  background: rgba(84, 114, 60, 0.16);
}

/* Estados de erro/sucesso com fundo sólido legível */
.status-message.error {
  display: block;
  background: #fdecea;
  color: #8a2519;
  border: 1px solid #f2c4bd;
}

.auth-card form {
  margin-top: 0.9rem;
}

.auth-card label {
  gap: 0.45rem;
  font-size: 0.92rem;
}

.auth-card input {
  border-radius: 16px;
  padding: 0.88rem 1rem;
  border-width: 1.5px;
  background: rgba(250, 251, 249, 0.95);
}

.auth-card input::placeholder {
  color: #8d9a8b;
}

.auth-card .btn {
  border-radius: 16px;
  min-height: 48px;
}

.auth-card .back-site {
  justify-self: start;
  margin-top: 2.2rem;
  margin-bottom: 0;
  position: static;
  display: inline-block;
}

.auth-switch {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.auth-switch .btn {
  padding: 0.72rem 0.85rem;
  border-radius: 16px;
}

.auth-switch .btn.active {
  background: var(--admin-primary);
  color: #fff;
  border-color: transparent;
}

.auth-card .text-link {
  margin-top: -0.1rem;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: #4d5c50;
  font-weight: 600;
}

.auth-remember input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--admin-primary);
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.admin-sidebar {
  width: 288px;
  min-width: 264px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%);
  color: var(--admin-sidebar-ink);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 2px 0 16px rgba(36, 48, 31, 0.18);
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-title + p {
  margin: 0.15rem 0 0;
  color: var(--admin-sidebar-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-meta {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--admin-sidebar-ink);
}

.admin-meta p {
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}

.admin-meta strong {
  color: #ffffff;
}

.admin-meta span {
  color: var(--admin-sidebar-muted);
}

.tab-menu {
  display: grid;
  gap: 0.5rem;
}

.tab-menu button,
.back-site {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: var(--admin-sidebar-ink);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.tab-menu button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.tab-menu button.active {
  background: var(--green-600);
  border-color: transparent;
  color: #ffffff;
}

.tab-menu button:focus-visible,
.back-site:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.tpolltech-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 32px;
  padding: 0.36rem 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(236, 240, 241, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tpolltech-credit span,
.tpolltech-credit strong {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.tpolltech-credit strong {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.tpolltech-credit:hover {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.tpolltech-credit:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.34);
  outline-offset: 3px;
}

.tpolltech-credit--admin {
  margin-top: auto;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: clamp(1.25rem, 2.5vw, 2.5rem);
  background: var(--admin-bg);
  overflow: visible;
}

.panel-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--admin-shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.purchase-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.purchase-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: rgba(250, 252, 248, 0.95);
}

.purchase-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.purchase-card p {
  margin: 0;
  color: #5f6f62;
  font-size: 0.9rem;
}

.btn,
.btn-small {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  background: var(--admin-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  box-shadow: 0 1px 2px rgba(36, 48, 31, 0.2);
}

.btn:hover,
.btn-small:hover {
  background: var(--admin-primary-strong);
  box-shadow: 0 2px 8px rgba(73, 103, 48, 0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--admin-primary);
  border: 1.5px solid var(--admin-primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--admin-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(95, 127, 63, 0.2);
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--admin-primary);
  padding: 0.2rem 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.text-link:hover {
  color: var(--admin-primary-strong);
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.admin-meta .btn {
  margin-top: 0.45rem;
}

.btn-small.danger,
.btn.danger {
  background: var(--admin-danger);
}

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

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

th,
td {
  border-bottom: 1px solid var(--admin-border);
  padding: 0.75rem 0.85rem;
  text-align: left;
  white-space: nowrap;
  font-size: 0.9rem;
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--admin-soft);
  border-bottom: 2px solid var(--admin-border);
}

/* ─── Ordenação da tabela de materiais ───────────────────────────────────── */

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: -0.25rem -0.35rem;
  padding: 0.25rem 0.35rem;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.th-sort:hover {
  background: rgba(106, 140, 77, 0.12);
}

.th-sort:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.th-sort-indicator {
  font-size: 0.62rem;
  line-height: 1;
}

.th-sort-indicator::before {
  content: "↕";
  opacity: 0.45;
}

.th-sort:hover .th-sort-indicator::before {
  content: "↑";
  opacity: 0.8;
  color: var(--admin-primary);
}

.th-sort.is-active .th-sort-indicator::before {
  content: "↑";
  opacity: 1;
  color: var(--admin-primary);
}

.th-sort.is-active.is-desc .th-sort-indicator::before {
  content: "↓";
}

.th-sort.is-active {
  color: var(--admin-primary-strong);
}

@media (prefers-reduced-motion: reduce) {
  .th-sort {
    transition: none;
  }
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background: rgba(95, 127, 63, 0.04);
}

.actions-cell {
  display: flex;
  gap: 0.4rem;
}

form {
  display: grid;
  gap: 0.9rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--admin-text);
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fafbf9;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  color: var(--admin-text);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--admin-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(95, 127, 63, 0.1);
}

/* Drag and drop para inputs de arquivo */
.file-input-wrapper {
  position: relative;
  display: grid;
  gap: 0.5rem;
}

.file-input-zone {
  border: 2px dashed #dde5d3;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  background: #fafbf9;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #7f8c8d;
  font-size: 0.9rem;
}

.file-input-zone:hover {
  border-color: var(--admin-primary);
  background: #f5f8f1;
  color: var(--admin-primary);
}

.file-input-zone.dragover {
  border-color: var(--admin-primary);
  background: rgba(95, 127, 63, 0.08);
  color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(95, 127, 63, 0.1);
}

.file-input-zone strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--admin-text);
}

.file-input-zone.has-file {
  background: rgba(31, 106, 43, 0.08);
  border-color: #27ae60;
  color: #1f6a2b;
}

.file-name {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(95, 127, 63, 0.1);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--admin-primary);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.check-row {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: var(--admin-text);
  transition: color 0.3s ease;
}

.check-row label:hover {
  color: var(--admin-primary);
}

/* Customize checkbox as toggle switch */
.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 48px;
  height: 28px;
  border: none;
  border-radius: 14px;
  background: #d0d8cc;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
  flex-shrink: 0;
  outline: none;
}

.check-row input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: left 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.check-row input[type="checkbox"]:hover {
  background: #c5cec0;
}

.check-row input[type="checkbox"]:checked {
  background: var(--admin-primary);
}

.check-row input[type="checkbox"]:checked::before {
  left: 22px;
}

.check-row input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 127, 63, 0.25);
}

.status-message {
  margin-top: 0.8rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  display: none;
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.status-message.success {
  display: block;
  background: #e9f9e9;
  color: #1f6a2b;
  border: 1px solid #b7e2bb;
}

.hint {
  margin: 0;
  font-size: 0.82rem;
  color: #647468;
}

.panel-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--admin-text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.panel-card h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--admin-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Estilo para a área de upload */
.upload-area {
  border: 2px dashed #bdc3c7;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: #7f8c8d;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.upload-area:hover {
  background-color: #ecf0f1;
  color: #2c3e50;
}

.upload-area.dragover {
  background-color: #dfe6e9;
  color: #2c3e50;
}

@media (max-width: 1080px) {
  .admin-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .admin-sidebar {
    width: 100%;
    min-width: 0;
    position: static;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--admin-border);
    padding: 1rem;
  }

  .admin-main {
    padding: 1.25rem;
  }

  .panel-card {
    padding: 1.1rem;
  }

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

  .tab-menu {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
  }

  .tab-menu button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .check-row {
    gap: 1rem;
  }
}

@media (max-width: 720px) {
  .admin-main {
    padding: 0.85rem;
  }

  .panel-card {
    border-radius: 14px;
    padding: 0.95rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .admin-meta {
    padding: 0.85rem;
  }

  .tab-menu {
    margin-inline: -0.1rem;
  }

  .tab-menu button,
  .back-site {
    padding: 0.72rem 0.9rem;
    border-radius: 10px;
  }

  th,
  td {
    padding: 0.65rem 0.7rem;
    font-size: 0.84rem;
  }

  .actions-cell {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-small {
    width: 100%;
  }

  .check-row {
    flex-direction: column;
    align-items: stretch;
  }

  .check-row label {
    justify-content: space-between;
    width: 100%;
  }

  .check-row .btn,
  .check-row .btn-outline {
    width: 100%;
  }

  .file-input-zone {
    padding: 1rem;
  }
}

  .vitrine-hero-preview {
    margin: 1rem 0 1.2rem;
    border: 1px solid #dee7d4;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8f6ef 0%, #fbfaf4 55%, #f4f8ec 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    gap: 0.9rem;
    padding: 0.95rem;
  }

  .vitrine-hero-preview-content h3 {
    margin: 0;
    color: #25381f;
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1.14;
  }

  .vitrine-hero-preview-content p {
    margin: 0.55rem 0 0;
    color: #3d4a3f;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .vitrine-hero-preview-actions {
    margin-top: 0.7rem;
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .vitrine-hero-preview-chips {
    margin-top: 0.7rem;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  .vitrine-hero-preview-chips span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #d5e2c8;
    border-radius: 999px;
    padding: 0.28rem 0.52rem;
    background: #f8fbf3;
    font-size: 0.8rem;
    color: #4f5f51;
  }

  .vitrine-hero-preview-chips b {
    font-weight: 700;
  }

  .vitrine-hero-preview-showcase {
    position: relative;
    display: grid;
    place-items: center;
  }

  .vitrine-hero-paper-stack {
    position: relative;
    width: min(260px, 100%);
    aspect-ratio: 0.74 / 1;
  }

  .vitrine-hero-sheet {
    position: absolute;
    inset: 0;
    border: 1px solid #dbe5d0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(38, 56, 31, 0.12);
    padding: 0.7rem;
    overflow: hidden;
  }

  .vitrine-hero-sheet img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .vitrine-hero-sheet.has-custom-image {
    border: 1px solid rgba(145, 165, 125, 0.65);
  }

  .vitrine-hero-sheet-back {
    transform: translate(-18px, 18px) rotate(-8deg);
  }

  .vitrine-hero-sheet-mid {
    transform: translate(16px, 10px) rotate(6deg);
  }

  .vitrine-hero-sheet-front {
    transform: rotate(-1deg);
  }

  .vitrine-hero-sheet-front #vitrineHeroPreviewSheetFrontContent {
    position: relative;
    z-index: 1;
  }

  .vitrine-hero-sheet-front.has-custom-image #vitrineHeroPreviewSheetFrontContent {
    display: none;
  }

  .vitrine-hero-sheet small {
    display: inline-flex;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #f3d7ce;
    color: #9e4f3e;
    font-size: 0.72rem;
    font-weight: 700;
  }

  .vitrine-hero-sheet h4 {
    margin: 0.5rem 0 0;
    color: #26381e;
    font-family: var(--font-display);
    font-size: 1.1rem;
    line-height: 1.12;
  }

  .vitrine-hero-sheet-grid {
    margin-top: 0.6rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .vitrine-hero-sheet-grid span {
    min-height: 42px;
    border-radius: 8px;
    background: #eef3e8;
    display: grid;
    place-items: center;
    color: #36542f;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.08rem;
  }

  .vitrine-hero-preview-showcase em {
    position: absolute;
    right: 0.1rem;
    bottom: 0.25rem;
    padding: 0.28rem 0.54rem;
    border-radius: 8px;
    background: #d96f58;
    color: #fff;
    font-style: normal;
    font-weight: 700;
    font-size: 0.8rem;
  }

  @media (max-width: 1080px) {
    .vitrine-hero-preview {
      grid-template-columns: 1fr;
    }
  }

@media (max-width: 520px) {
  .admin-sidebar {
    padding: 0.85rem;
  }

  .admin-main {
    padding: 0.7rem;
  }

  .panel-card h2 {
    font-size: 1.2rem;
  }

  input,
  textarea,
  select {
    padding: 0.68rem 0.75rem;
  }
}

/* ─── Modal de Compartilhamento ────────────────────────────────────────── */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.share-modal-overlay--visible {
  opacity: 1;
}

.share-modal {
  background: var(--admin-card);
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--admin-shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.share-modal-overlay--visible .share-modal {
  transform: scale(1);
}

.share-modal h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--admin-text);
}

.share-modal-product-name {
  font-size: 0.85rem;
  color: var(--admin-soft);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--admin-border);
}

.share-modal-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.share-modal-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.share-modal-btn:hover {
  background: var(--admin-border);
  border-color: var(--admin-soft);
}

.share-modal-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.share-modal-btn--whatsapp svg {
  color: #25d366;
}

.share-modal-btn--instagram svg {
  color: #e1306c;
}

.share-modal-btn--copy svg {
  color: var(--admin-soft);
}

.share-modal-section {
  margin-bottom: 0.75rem;
}

.share-modal-section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--admin-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}

.share-modal-close {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--admin-soft);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.share-modal-close:hover {
  background: var(--admin-bg);
}

.share-modal-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--admin-primary);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-modal-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-small.share-btn {
  background: var(--admin-soft);
  color: #fff;
  border: none;
}

.btn-small.share-btn:hover {
  background: var(--admin-primary);
}

/* ─── Tabela de materiais: busca, filtro, capa e estados ─────────────────── */

.materials-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.materials-toolbar input[type="search"] {
  flex: 1 1 220px;
  max-width: 340px;
}

.materials-toolbar select {
  width: auto;
  flex: 0 0 auto;
}

.materials-count {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--admin-soft);
}

.material-title-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 220px;
  white-space: normal;
}

/* ─── Cartões-resumo da aba Materiais ─────────────────────────────────────── */

.materials-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.summary-card {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.summary-card strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--green-800);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card span {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* ─── Grupos visuais do formulário Novo Material ───────────────────────────── */

fieldset.form-section {
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 0.2rem 1rem 1rem;
  margin: 0;
  min-width: 0;
  display: grid;
  gap: 0.9rem;
}

fieldset.form-section > legend {
  padding: 0 0.4rem;
  margin-left: 0.4rem;
  color: var(--green-800);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .materials-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card:first-child {
    grid-column: 1 / -1;
  }

  fieldset.form-section > legend {
    font-size: 0.75rem;
  }
}

.material-cover {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  background: var(--admin-bg);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-pill--active {
  background: rgba(108, 145, 74, 0.14);
  color: var(--admin-primary-strong);
}

.status-pill--hidden {
  background: rgba(192, 57, 43, 0.1);
  color: var(--admin-danger);
}

.materials-empty {
  text-align: center;
  padding: 2.4rem 1rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  white-space: normal;
}

.materials-empty--error {
  color: #8a2519;
  font-weight: 600;
}

/* ─── Status inline dos formulários ─────────────────────────────────────────── */

.form-status {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.form-status.is-success {
  background: #e9f9e9;
  color: #1f6a2b;
  border: 1px solid #b7e2bb;
}

.form-status.is-error {
  background: #fdecea;
  color: #8a2519;
  border: 1px solid #f2c4bd;
}

/* ─── Modal de confirmação ──────────────────────────────────────────────────── */

.confirm-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(36, 48, 31, 0.5);
  z-index: 1200;
}

.confirm-modal.is-open {
  display: flex;
}

.confirm-modal[aria-hidden="true"] {
  display: none;
}

.confirm-modal-card {
  width: min(420px, 100%);
  background: var(--admin-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--admin-shadow-lg);
}

.confirm-modal-card h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  color: var(--admin-text);
}

.confirm-modal-card p {
  margin: 0 0 1.2rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ─── Pedidos da loja (visão do dono) ───────────────────────────────────────── */

.orders-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.orders-summary-card {
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: var(--admin-card);
}

.orders-summary-card span {
  display: block;
  color: var(--text-soft);
  font-size: 0.76rem;
  margin-bottom: 0.2rem;
}

.orders-summary-card strong {
  display: block;
  color: var(--admin-text);
  font-size: 1.12rem;
  line-height: 1.2;
}

.orders-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.35fr) minmax(150px, 0.35fr);
  gap: 0.7rem;
  align-items: end;
  margin: 0.9rem 0 0.45rem;
}

.orders-toolbar label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 700;
}

.orders-toolbar input,
.orders-toolbar select {
  width: 100%;
}

.orders-results-count {
  margin: 0.25rem 0 0.8rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.status-pill--pending {
  background: rgba(214, 158, 46, 0.14);
  color: #8a6414;
}

.purchase-card--group {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.purchase-card-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.purchase-card-headline h3 {
  margin: 0;
}

.order-email {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-soft);
}

.purchase-card--group.is-new-sale {
  box-shadow: 0 0 0 2px rgba(91, 137, 59, 0.2), var(--admin-shadow);
}

.order-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(105, 128, 93, 0.12);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.order-badge--new {
  background: rgba(91, 137, 59, 0.16);
  color: #3f6c24;
}

.order-badge--attempts {
  background: rgba(214, 158, 46, 0.14);
  color: #8a6414;
}

.order-badge--error {
  background: rgba(185, 56, 40, 0.1);
  color: #a53325;
}

.order-badge--technical {
  background: rgba(98, 109, 122, 0.12);
  color: #53606c;
}

.order-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.order-actions .btn,
.order-actions .btn-outline {
  min-height: 36px;
  padding: 0.5rem 0.72rem;
  font-size: 0.8rem;
}

.technical-orders {
  margin-top: 1rem;
  border-top: 1px solid var(--admin-border);
  padding-top: 0.8rem;
}

.technical-orders summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--admin-text);
}

.technical-orders summary span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(185, 56, 40, 0.1);
  color: #a53325;
  font-size: 0.74rem;
}

.order-meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.order-items {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.6rem 0 0;
  border-top: 1px dashed var(--admin-border);
  display: grid;
  gap: 0.35rem;
}

.order-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.order-error-help {
  margin-top: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(185, 56, 40, 0.2);
  border-radius: 12px;
  background: rgba(185, 56, 40, 0.07);
  color: var(--admin-text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.order-error-help.is-technical {
  border-color: rgba(214, 158, 46, 0.28);
  background: rgba(214, 158, 46, 0.09);
}

.order-error-help p {
  margin: 0;
}

.order-error-help p + p {
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .orders-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-summary-card:first-child {
    grid-column: span 2;
  }

  .orders-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .orders-search {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .order-item {
    flex-direction: column;
    gap: 0.1rem;
  }

  .order-meta {
    display: grid;
    gap: 0.1rem;
  }

  .orders-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-toolbar {
    grid-template-columns: 1fr;
  }

  .orders-search {
    grid-column: auto;
  }

  .order-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .order-actions .btn,
  .order-actions .btn-outline {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .purchase-card--group {
    transition: none;
  }
}

@media (max-width: 720px) {
  .confirm-modal-actions {
    flex-direction: column-reverse;
  }

  .confirm-modal-actions .btn,
  .confirm-modal-actions .btn-outline {
    width: 100%;
  }

  .materials-count {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confirm-modal,
  .confirm-modal .btn,
  .confirm-modal .btn-outline,
  .form-status {
    transition: none;
  }
}

/* Movimento opcional: desliga transições para quem prefere menos animação */
@media (prefers-reduced-motion: reduce) {
  .tab-menu button,
  .back-site,
  .btn,
  .btn-small,
  input,
  textarea,
  select,
  tbody tr,
  .check-row input[type="checkbox"],
  .check-row input[type="checkbox"]::before {
    transition: none;
  }

  .btn:hover,
  .btn-small:hover,
  .btn-outline:hover,
  .text-link:hover {
    transform: none;
  }
}

/* ─── Clientes e notificações ─────────────────────────────────────────────── */
.tab-menu button {
  position: relative;
}

.tab-count-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  display: inline-grid;
  place-items: center;
  margin-left: .35rem;
  padding: 0 .32rem;
  border-radius: 999px;
  background: #f2d788;
  color: #2b3926;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
}

.customers-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.customers-summary article {
  padding: .95rem 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: rgba(250, 252, 248, .92);
}

.customers-summary span {
  display: block;
  color: var(--admin-soft);
  font-size: .76rem;
  font-weight: 700;
}

.customers-summary strong {
  display: block;
  margin-top: .2rem;
  color: var(--admin-primary-strong);
  font-size: 1.35rem;
}

.customers-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: .7rem 0 1rem;
}

.customers-toolbar label {
  flex: 1;
  max-width: 520px;
}

.customers-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr);
  gap: 1rem;
  align-items: start;
}

.customers-list {
  display: grid;
  gap: .55rem;
}

.customer-list-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: .95rem 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: #fff;
  color: var(--admin-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.customer-list-card:hover {
  border-color: rgba(95, 127, 63, .48);
  background: #fbfcf8;
}

.customer-list-card.is-selected {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px rgba(95, 127, 63, .1);
}

.customer-list-main {
  min-width: 0;
  display: grid;
  gap: .18rem;
}

.customer-list-main strong {
  overflow: hidden;
  color: var(--admin-primary-strong);
  font-size: .98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-list-main small {
  overflow: hidden;
  color: var(--admin-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-list-meta {
  display: grid;
  gap: .14rem;
  color: var(--admin-soft);
  font-size: .74rem;
  text-align: right;
}

.customers-empty,
.customer-detail-empty,
.notifications-empty {
  display: grid;
  gap: .3rem;
  padding: 1rem 0;
  color: var(--admin-soft);
}

.customer-detail-empty strong,
.notifications-empty strong {
  color: var(--admin-text);
}

.customer-detail-panel {
  position: sticky;
  top: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(36, 48, 31, .06);
}

.customer-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.customer-detail-label {
  color: var(--admin-soft);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.customer-detail-head h3 {
  margin: .18rem 0 .2rem;
  color: var(--admin-primary-strong);
  font-size: 1.25rem;
}

.customer-detail-head a {
  color: var(--admin-primary);
  font-size: .86rem;
}

.customer-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin: 1rem 0;
}

.customer-detail-stats div {
  min-width: 0;
  padding: .7rem;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: rgba(250, 252, 248, .92);
}

.customer-detail-stats dt {
  color: var(--admin-soft);
  font-size: .68rem;
  font-weight: 700;
}

.customer-detail-stats dd {
  margin: .15rem 0 0;
  color: var(--admin-text);
  font-size: .82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-owned-materials {
  margin-top: .9rem;
}

.customer-owned-materials h4,
.customer-grant-form h4 {
  margin: 0 0 .55rem;
  color: var(--admin-primary-strong);
  font-size: .95rem;
}

.customer-owned-materials ul {
  max-height: 220px;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--admin-border);
}

.customer-owned-materials li {
  padding: .7rem 0;
  border-bottom: 1px solid var(--admin-border);
}

.customer-owned-materials li div {
  display: grid;
  gap: .12rem;
}

.customer-owned-materials li strong {
  color: var(--admin-text);
  font-size: .86rem;
}

.customer-owned-materials li span {
  color: var(--admin-soft);
  font-size: .74rem;
}

.customer-material-empty {
  color: var(--admin-soft);
  font-size: .84rem;
}

.customer-grant-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--admin-border);
}

.customer-grant-form > div:first-child p {
  margin: -.25rem 0 .7rem;
  color: var(--admin-soft);
  font-size: .82rem;
  line-height: 1.5;
}

.notifications-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.notifications-list {
  display: grid;
  margin-top: 1rem;
  border-top: 1px solid var(--admin-border);
}

.notification-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: .85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--admin-border);
}

.notification-state {
  width: 8px;
  height: 8px;
  margin-top: .38rem;
  border-radius: 50%;
  background: transparent;
}

.notification-item.is-unread .notification-state {
  background: var(--admin-primary);
}

.notification-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.notification-heading strong {
  color: var(--admin-primary-strong);
}

.notification-heading time {
  flex: 0 0 auto;
  color: var(--admin-soft);
  font-size: .72rem;
}

.notification-content p {
  margin: .3rem 0 0;
  color: #5f6f62;
  line-height: 1.55;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: .55rem;
}

.notification-item.is-unread .notification-heading strong {
  font-weight: 900;
}

@media (max-width: 980px) {
  .customers-layout {
    grid-template-columns: 1fr;
  }

  .customer-detail-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .customers-summary {
    grid-template-columns: 1fr;
  }

  .customers-toolbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-list-card {
    grid-template-columns: 1fr;
  }

  .customer-list-meta {
    text-align: left;
  }

  .customer-detail-stats {
    grid-template-columns: 1fr;
  }

  .notification-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
  }

  .notifications-header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .notifications-header-actions .btn {
    width: 100%;
  }
}

/* ─── Web Push / PWA ─────────────────────────────────────────────────────── */
.push-settings {
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--admin-border);
}

.push-settings-copy h3 {
  margin: 0;
  color: var(--admin-primary-strong);
  font-size: 1.05rem;
}

.push-settings-copy p {
  max-width: 70ch;
  margin: .35rem 0 0;
  color: var(--admin-soft);
  line-height: 1.55;
}

.push-settings-status {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  margin-top: 1rem;
  padding: .85rem 0;
  border-top: 1px solid var(--admin-border);
  border-bottom: 1px solid var(--admin-border);
}

.push-status-dot {
  width: 9px;
  height: 9px;
  margin-top: .3rem;
  border-radius: 50%;
  background: #a7ada2;
}

.push-status-dot--active {
  background: #5f7f3f;
  box-shadow: 0 0 0 4px rgba(95, 127, 63, .1);
}

.push-status-dot--prompt,
.push-status-dot--disabled {
  background: #c9a74d;
}

.push-status-dot--blocked,
.push-status-dot--error {
  background: #b35c4d;
}

.push-status-dot--unsupported {
  background: #8d9488;
}

.push-settings-status div {
  display: grid;
  gap: .15rem;
}

.push-settings-status strong {
  color: var(--admin-text);
  font-size: .9rem;
}

.push-settings-status small {
  color: var(--admin-soft);
  line-height: 1.45;
}

.push-device-summary,
.push-ios-hint {
  margin-top: .75rem;
  padding: .7rem 0;
  color: var(--admin-soft);
  font-size: .8rem;
  line-height: 1.5;
}

.push-ios-hint {
  border-top: 1px solid var(--admin-border);
}

.push-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .7rem;
}

@media (max-width: 700px) {
  .push-settings-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .push-settings-actions .btn {
    width: 100%;
  }
}

