/* Layout exclusivo do painel: não afeta o checkout público. */
[hidden] { display: none !important; }

.admin-body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

.admin-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  padding-top: 23px;
}

.sidebar {
  position: sticky;
  top: 23px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 23px);
  padding: 28px 16px 20px;
  border-right: 1px solid var(--line);
  background: var(--card);
}

.sidebar-brand { padding: 0 12px 30px; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; }
.side-nav { display: grid; gap: 5px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.side-nav a:first-letter { color: var(--green); }
.side-nav a:hover,
.side-nav a.active {
  border-color: color-mix(in srgb, var(--green) 28%, transparent);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  color: var(--text);
}
.side-nav a.active { box-shadow: inset 3px 0 var(--green); }
.sidebar-footer {
  margin-top: auto;
  padding: 15px 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1.8;
}
.sidebar-footer small { color: var(--muted); }
.status-dot, .status-pill i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.admin-main { min-width: 0; padding: 0 38px 48px; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 104px;
  border-bottom: 1px solid var(--line);
}
.admin-header h1 { margin: 0; font-size: clamp(23px, 3vw, 30px); letter-spacing: -.035em; }
.admin-header .eyebrow { margin-bottom: 4px; }
.mobile-menu { display: none; }

.button, .copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.button.primary { border-color: var(--green); background: var(--green); color: var(--button-text); }
.button.compact { min-height: 36px; white-space: nowrap; }
.button:hover, .copy-button:hover { filter: brightness(1.08); }

.admin-login { display: grid; place-items: center; min-height: 100vh; padding: 40px 18px; background: var(--bg); }
.login-card { width: min(100%, 430px); }
.login-card h1 { margin: 0 0 8px; font-size: 28px; }
.login-card label { display: grid; gap: 6px; margin: 16px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--field); color: var(--text); font: inherit; }
.login-card button { width: 100%; margin-top: 8px; }
#admin-app { padding-top: 26px; }
.admin-message { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.admin-message.error { border-color: #b74b4b; color: #d87878; }
.admin-message.success { border-color: var(--green); color: var(--green); }
.form-card { max-width: 900px; }
.form-card label { display: grid; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.form-card input, .form-card textarea, .form-card select { width: 100%; min-height: 44px; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--field); color: var(--text); font: inherit; outline: none; }
.form-card input:focus, .form-card textarea:focus, .form-card select:focus { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 22%, transparent); }
.form-card input:invalid:not(:placeholder-shown), .form-card textarea:invalid:not(:placeholder-shown), .form-card select:invalid { border-color: var(--danger); }
.form-card textarea { min-height: 120px; resize: vertical; }
.form-card > label { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.delivery-settings { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.delivery-settings legend { padding: 0 8px; color: var(--text); font-weight: 700; }
.delivery-settings .check-row { display: inline-flex; align-items: center; gap: 8px; margin: 8px 18px 12px 0; color: var(--text); }
.delivery-settings .check-row input { width: auto; min-height: auto; }
.delivery-settings .wide-field { grid-column: 1 / -1; }
.product-general-form,
.product-general-form .form-grid,
.product-general-form > label { min-width: 0; }
.product-general-form { display: grid; gap: 16px; }
.product-general-form .form-grid { grid-template-areas: "name name" "slug price" "kind visibility" "currency currency"; }
.product-general-form .form-grid > label { display: grid; gap: 7px; margin: 0; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.product-general-form .form-grid > label:nth-child(1) { grid-area: name; }
.product-general-form .form-grid > label:nth-child(2) { grid-area: slug; }
.product-general-form .form-grid > label:nth-child(3) { grid-area: kind; }
.product-general-form .form-grid > label:nth-child(4) { grid-area: visibility; }
.product-general-form .form-grid > label:nth-child(5) { grid-area: price; }
.product-general-form .form-grid > label:nth-child(6) { grid-area: currency; max-width: 180px; }
.product-general-form input,
.product-general-form select,
.product-general-form textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; }
.product-general-form > label { display: grid; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.product-general-form > label textarea { height: 100px; resize: none; overflow-y: auto; }
.product-general-form .form-actions { justify-content: flex-end; margin-top: 0; }
.product-picker { display: grid; gap: 8px; margin: 16px 0; }
.product-option { display: grid !important; grid-template-columns: auto 1fr minmax(130px, 180px); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
.product-option input[type="checkbox"] { width: auto; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
code { color: var(--green); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(100%, 360px);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}
.admin-body .search-wrap input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); }

.table-card, .metric-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  overflow: hidden;
}
.table-card { overflow-x: auto; }
.table-head, .link-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(170px, 1fr) minmax(135px, 1fr) 90px 92px 94px minmax(190px, 1.25fr);
  align-items: center;
  min-width: 1090px;
}
.table-head {
  min-height: 44px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--field) 55%, var(--card));
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.link-row {
  min-height: 82px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  gap: 12px;
  font-size: 12px;
}
.link-row > * { min-width: 0; }
.link-name { display: flex; align-items: center; gap: 9px; }
.link-name strong { overflow: hidden; text-overflow: ellipsis; }
.offer-icon { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 4px; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.offer-icon.large { width: 42px; height: 42px; margin-bottom: 12px; }
.url-cell { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.type-pill, .status-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 7px; border-radius: 3px; background: var(--field); color: var(--muted); font-size: 10px; font-weight: 700; }
.status-pill { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); }
.theme-control { display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.admin-body select { min-width: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 3px; font: inherit; }
.action-cell { display: flex; flex-wrap: wrap; gap: 5px; }
.action-cell .copy-button { min-height: 29px; padding: 0 8px; font-size: 10px; }
.preview-button { color: var(--green); }
.table-foot { margin: 12px 2px; font-size: 11px; }

.overview-grid, .content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.section-title { margin: 0 0 2px; font-size: 26px; }
.toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.toolbar-input { min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--field); color: var(--text); font: inherit; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.product-grid.list-view { grid-template-columns: 1fr; }
.product-card { display: grid; grid-template-columns: 1fr; padding: 0; overflow: hidden; }
/* Compact list keeps the 72px row contract; grid-template-columns remains explicit per view. */
/* .product-grid.list-view .product-card { grid-template-columns: 52px minmax(0, 1fr); min-height: 72px; height: 72px; } */
.product-grid.list-view .product-card {
  box-sizing: border-box;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 0;
  height: 72px;
  padding: 0;
  overflow: visible;
}
.product-cover { min-height: 150px; border: 0; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--green) 18%, var(--card)), var(--field)); color: var(--green); cursor: pointer; }
.product-grid.list-view .product-cover {
  box-sizing: border-box;
  width: 52px;
  min-width: 0;
  min-height: 0;
  height: 72px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}
.cover-fallback { display: grid; place-items: center; width: 58px; height: 58px; margin: auto; border: 1px solid color-mix(in srgb, var(--green) 45%, transparent); border-radius: 6px; font-size: 28px; }
.product-card-body { padding: 18px; }
.product-card-top, .detail-heading, .related-row, .product-actions { display: flex; align-items: center; gap: 10px; }
.product-card-top { justify-content: space-between; }
.product-card h2 { margin-top: 14px; }
.product-card p { min-height: 44px; }
.product-actions { flex-wrap: wrap; margin-top: 16px; }
.product-grid.list-view .product-card-body {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 0 16px;
  min-width: 0;
  min-height: 0;
  padding: 6px 12px 6px 14px;
}
.product-grid.list-view .cover-fallback { width: 44px; height: 48px; margin: 0; font-size: 20px; }
.product-grid.list-view .product-card-top { display: contents; }
.product-grid.list-view .product-card-top .muted { display: none; }
.product-grid.list-view .product-card h2 {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}
.product-grid.list-view .product-card p { display: none; }
.product-grid.list-view .product-card .status-pill {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  width: fit-content;
  padding: 1px 5px;
  font-size: 9px;
  line-height: 1.35;
  white-space: nowrap;
}
.product-grid.list-view .product-card .big-price {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}
.product-grid.list-view .product-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  margin: 0;
  flex-wrap: nowrap;
}
.product-grid.list-view .product-actions .button { min-height: 32px; padding-inline: 10px; }
.product-grid.list-view .product-actions .copy-button { display: none; }
.product-detail { display: grid; gap: 18px; }
.detail-header { display: grid; gap: 14px; }
.detail-heading { gap: 14px; }
.detail-heading h2 { margin: 0 0 3px; font-size: 25px; }
.detail-cover, .cover-preview { display: grid; place-items: center; width: 78px; height: 78px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--green); }
.detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.detail-tabs button { padding: 12px 15px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-weight: 700; white-space: nowrap; }
.detail-tabs button.active { border-color: var(--green); color: var(--text); }
.detail-panel { display: grid; gap: 18px; }
.cover-preview { width: 100%; height: 180px; flex-direction: column; }
.cover-preview p { margin: 8px 0 0; color: var(--text); }
.cover-preview small { color: var(--muted); }
.related-list { display: grid; gap: 10px; }
.related-row { justify-content: space-between; flex-wrap: wrap; padding: 16px; }
.related-row > div:first-child { display: grid; gap: 4px; }
.unavailable-panel { max-width: 680px; }
.empty-state { padding: 20px; color: var(--muted); }
.overview-grid { grid-template-columns: minmax(180px, .7fr) minmax(280px, 1.3fr); margin-bottom: 16px; }
.metric-card { padding: 22px; }
.metric-card h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.25; }
.metric-card p { color: var(--muted); }
.metric-number { display: block; margin: 8px 0 0; font-size: 38px; line-height: 1; }
.big-price { display: block; margin: 18px 0; font-size: 24px; }
.callout { margin-top: 16px; }
.settings-card { max-width: 680px; }
.setting-line { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 13px; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .admin-main { padding-inline: 24px; }
  .overview-grid, .content-grid, .product-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .admin-layout { display: block; padding-top: 23px; }
  .sidebar { position: fixed; z-index: 15; inset: 23px auto 0 0; width: min(280px, 88vw); height: auto; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 12px 0 30px color-mix(in srgb, var(--text) 30%, transparent); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { padding: 0 14px 32px; }
  .admin-header { min-height: 82px; }
  .mobile-menu { display: inline-flex; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--text); font-size: 20px; }
  .admin-header > div { flex: 1; }
  .admin-header .button { display: none; }
  #admin-app { padding-top: 18px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-wrap { width: 100%; }
  .toolbar .button { align-self: flex-start; }
  .overview-grid, .content-grid, .product-grid { grid-template-columns: 1fr; }
  .toolbar-actions { justify-content: flex-start; }
  .product-grid.list-view .product-card {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 0;
    height: 72px;
  }
  .product-grid.list-view .product-cover { box-sizing: border-box; width: 44px; height: 72px; border-right: 1px solid var(--line); border-bottom: 0; }
  .product-grid.list-view .product-card-body { grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 8px; }
  .product-grid.list-view .product-card .big-price { grid-column: 2; grid-row: 1; font-size: 12px; }
  .product-grid.list-view .product-actions { grid-column: 2; grid-row: 2; justify-self: end; }
  .product-grid.list-view .product-actions .button { min-height: 27px; padding-inline: 8px; font-size: 11px; }
  .product-grid.list-view .product-actions .button[data-product-tab="checkouts"] { display: none; }
  .product-grid.list-view .cover-fallback { width: 36px; height: 48px; font-size: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .product-general-form .form-grid { grid-template-areas: "name" "slug" "price" "kind" "visibility" "currency"; }
  .product-general-form .form-grid > label:nth-child(6) { max-width: none; }
  .product-general-form .form-actions .button { width: 100%; }
  .form-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.product-feature-panel { max-width: 760px; }
.feature-status { display: inline-flex; margin: 8px 0 12px; }
.feature-context { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
