:root {
  color-scheme: dark;
  --bg: #07090b;
  --surface: #101418;
  --surface-soft: #151b20;
  --surface-strong: #1d242b;
  --ink: #f7faf9;
  --text: #eef4f2;
  --muted: #98a6ad;
  --line: #27313a;
  --accent: #d6a84f;
  --accent-dark: #f1c76c;
  --danger: #ff776d;
  --danger-bg: #2a1413;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -12%, rgba(214, 168, 79, 0.16), transparent 34%),
    var(--bg);
  color: var(--text);
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

.slug-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 46px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090d10;
  overflow: hidden;
}

.slug-input span {
  padding: 0 10px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.slug-input input {
  min-height: 44px;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.field-status {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.field-status.is-ok {
  color: #7ee0a3;
}

.field-status.is-current {
  color: var(--accent-dark);
}

.field-status.is-error {
  color: var(--danger);
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-shell {
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid rgba(214, 168, 79, 0.14);
  background: rgba(7, 9, 11, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(214, 168, 79, 0.45);
  background: linear-gradient(145deg, #d6a84f, #7a5a20);
  color: #11100d;
  font-size: 0.84rem;
}

.side-nav {
  display: none;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.side-nav::-webkit-scrollbar {
  display: none;
}

.side-nav a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.side-nav a.is-active {
  border-color: rgba(214, 168, 79, 0.2);
  background: rgba(214, 168, 79, 0.16);
  color: var(--accent-dark);
}

.side-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.dashboard-main {
  width: min(100% - 28px, 1180px);
  margin: 0 auto;
  padding: 18px 0 calc(104px + env(safe-area-inset-bottom));
}

.dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.dashboard-header h1,
.panel-heading h2 {
  margin: 0;
  line-height: 1.06;
}

.dashboard-header h1 {
  font-size: clamp(1.45rem, 8vw, 3.4rem);
}

.header-action,
.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius);
  font-weight: 900;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.header-action:hover,
.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.header-action:active,
.primary-button:active,
.ghost-button:active,
.danger-button:active {
  transform: translateY(0);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  transform: none;
  box-shadow: none;
}

.is-loading {
  opacity: 0.72;
  cursor: wait;
}

.header-action {
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid rgba(214, 168, 79, 0.35);
  background: rgba(214, 168, 79, 0.12);
  color: var(--accent-dark);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.summary-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary-card {
  position: relative;
  min-width: 0;
  padding: 16px 12px 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: auto -28px -36px auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(214, 168, 79, 0.08);
  pointer-events: none;
}

.summary-card span,
.hint {
  color: var(--muted);
}

.summary-card span {
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-card .summary-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border: 1px solid rgba(214, 168, 79, 0.2);
  border-radius: var(--radius);
  background: rgba(214, 168, 79, 0.1);
  color: var(--accent-dark);
}

.summary-card strong {
  display: block;
  margin-top: 7px;
  color: var(--accent-dark);
  font-size: clamp(1.55rem, 9vw, 2.1rem);
  line-height: 1;
}

.panel-grid {
  display: grid;
  gap: 12px;
}

.billing-alert {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 119, 109, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 119, 109, 0.1);
}

.billing-alert strong,
.billing-alert span {
  display: block;
}

.billing-alert span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.pix-box {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(214, 168, 79, 0.22);
  border-radius: var(--radius);
  background: rgba(214, 168, 79, 0.08);
}

.pix-box strong,
.pix-box span {
  display: block;
}

.is-payment-locked .side-nav a:not([data-view-link="conta"]),
.is-payment-locked .mobile-tabbar a:not([data-view-link="conta"]) {
  opacity: 0.44;
  pointer-events: none;
}

.panel {
  margin-top: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel-grid .panel {
  margin-top: 0;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  font-size: clamp(1.25rem, 5vw, 1.8rem);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 168, 79, 0.24);
  background: rgba(214, 168, 79, 0.12);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(214, 168, 79, 0.12);
}

.status-pill.is-dirty {
  background: rgba(214, 168, 79, 0.2);
  color: #ffe1a0;
}

.status-pill.is-ok {
  border-color: rgba(126, 224, 163, 0.28);
  background: rgba(126, 224, 163, 0.12);
  color: #9af0ba;
}

.status-pill.is-error {
  border-color: rgba(255, 119, 109, 0.34);
  background: rgba(255, 119, 109, 0.12);
  color: var(--danger);
}

.app-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  position: fixed;
  right: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid rgba(126, 224, 163, 0.28);
  border-radius: var(--radius);
  background: rgba(16, 20, 24, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.app-toast::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9af0ba;
  box-shadow: 0 0 0 4px rgba(126, 224, 163, 0.12);
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.is-error {
  border-color: rgba(255, 119, 109, 0.34);
  color: #ffd1cd;
}

.app-toast.is-error::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 119, 109, 0.12);
}

.image-adjuster {
  width: min(94vw, 620px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.image-adjuster::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.image-adjuster-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compact-icon-button {
  width: 44px;
  padding: 0;
}

.crop-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(214, 168, 79, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, #0c1115 25%, transparent 25%),
    linear-gradient(-45deg, #0c1115 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #0c1115 75%),
    linear-gradient(-45deg, transparent 75%, #0c1115 75%),
    #11171c;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
  cursor: grab;
  touch-action: none;
}

.crop-stage.is-banner {
  aspect-ratio: 8 / 3;
}

.crop-stage.is-dragging {
  cursor: grabbing;
}

.crop-stage canvas {
  width: 100%;
  height: 100%;
}

.crop-guide {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12);
}

.crop-stage.is-logo .crop-guide {
  border-radius: 18px;
}

.range-field {
  display: grid;
  gap: 8px;
}

.range-field input {
  min-height: 28px;
  margin: 0;
  accent-color: var(--accent);
}

.image-adjuster-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid,
.vehicle-form,
.category-form {
  display: grid;
  gap: 12px;
}

label,
legend {
  color: #d9e0df;
  font-size: 0.85rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090d10;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(214, 168, 79, 0.7);
  box-shadow: 0 0 0 3px rgba(214, 168, 79, 0.16);
}

.toggle-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.address-card {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.address-grid {
  display: grid;
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.toggle-row input {
  width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.file-card {
  position: relative;
  display: grid;
  gap: 9px;
  min-height: 120px;
  padding: 13px;
  border: 1px dashed rgba(214, 168, 79, 0.34);
  border-radius: var(--radius);
  background: #090d10;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.file-card:hover {
  border-color: rgba(214, 168, 79, 0.58);
  background: #0c1115;
}

.file-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  background: rgba(214, 168, 79, 0.12);
  color: var(--accent-dark);
  font-weight: 900;
}

.file-card img {
  display: none;
  width: 100%;
  height: 140px;
  border-radius: var(--radius);
  object-fit: cover;
}

.file-card img[src] {
  display: block;
}

#storeBannerPreview {
  height: auto;
  aspect-ratio: 8 / 3;
}

#storeLogoPreview {
  height: auto;
  aspect-ratio: 1 / 1;
}

.spec-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.spec-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
}

.spec-chip input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.spec-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(214, 168, 79, 0.14);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.photo-preview-grid img {
  display: block;
  width: 100%;
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
}

.primary-button {
  border: 0;
  background: linear-gradient(145deg, #f1c76c, #b9822c);
  color: #15100a;
  padding: 0 16px;
  box-shadow: 0 10px 22px rgba(185, 130, 44, 0.18);
}

.primary-button:hover {
  box-shadow: 0 14px 28px rgba(185, 130, 44, 0.26);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 14px;
}

.ghost-button:hover {
  border-color: rgba(214, 168, 79, 0.34);
  background: #1b2228;
}

.danger-button {
  border: 1px solid rgba(255, 119, 109, 0.32);
  background: var(--danger-bg);
  color: var(--danger);
  padding: 0 12px;
}

.danger-button:hover {
  border-color: rgba(255, 119, 109, 0.54);
  background: #331817;
}

.public-link {
  display: grid;
  gap: 8px;
}

.public-link span {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border-radius: var(--radius);
  background: #090d10;
  color: var(--accent-dark);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.hint {
  margin: 12px 0 0;
  line-height: 1.45;
}

.vehicle-form {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.inventory-list,
.category-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.inventory-card,
.category-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.inventory-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 10px;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.inventory-card:hover {
  border-color: rgba(214, 168, 79, 0.25);
  background: #182027;
}

.inventory-thumb {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #242c33;
}

.inventory-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory-body {
  min-width: 0;
}

.inventory-body h3 {
  margin: 0;
  font-size: 1rem;
}

.inventory-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.inventory-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.inventory-specs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(214, 168, 79, 0.1);
  color: #d7dfdc;
  font-size: 0.72rem;
  font-weight: 900;
}

.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.inventory-actions button {
  min-height: 38px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.category-item strong {
  min-width: 0;
}

.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px dashed #3a4650;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
  line-height: 1.45;
}

.brand:focus-visible,
.side-nav a:focus-visible,
.mobile-tabbar a:focus-visible,
.header-action:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.danger-button:focus-visible {
  outline: 3px solid rgba(214, 168, 79, 0.32);
  outline-offset: 3px;
}

.mobile-tabbar {
  position: fixed;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(214, 168, 79, 0.18);
  border-radius: 20px;
  background: rgba(13, 17, 20, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

.mobile-tabbar a {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  border-radius: 15px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.mobile-tabbar span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.mobile-tabbar a.is-active {
  background: linear-gradient(145deg, rgba(241, 199, 108, 0.22), rgba(214, 168, 79, 0.1));
  color: var(--accent-dark);
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: grid;
}

.panel.app-view.is-active {
  display: block;
}

.panel-grid {
  min-height: 0;
}

@media (min-width: 760px) {
  .dashboard-shell {
    display: grid;
    grid-template-columns: 244px 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 22px;
    border-right: 1px solid rgba(214, 168, 79, 0.12);
    border-bottom: 0;
  }

  .side-nav {
    display: grid;
    gap: 6px;
    margin-top: 24px;
    overflow: visible;
  }

  .side-nav a {
    border-radius: var(--radius);
  }

  .dashboard-main {
    width: min(100% - 40px, 1180px);
    padding: 32px 0 48px;
  }

  .mobile-tabbar {
    display: none;
  }

  .app-toast {
    bottom: 24px;
  }

  .summary-grid.app-view,
  .summary-grid.app-view.is-active {
    display: grid;
  }

  .summary-grid {
    gap: 12px;
  }

  .panel-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  }

  .panel {
    padding: 20px;
  }

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

  .address-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .address-grid label:nth-child(1),
  .address-grid label:nth-child(3),
  .address-grid label:nth-child(7) {
    grid-column: span 2;
  }

  .address-grid label:nth-child(2),
  .address-grid label:nth-child(4),
  .address-grid label:nth-child(5),
  .address-grid label:nth-child(6) {
    grid-column: span 3;
  }

  .toggle-group,
  .primary-button {
    align-self: end;
  }

  .public-link {
    grid-template-columns: 1fr auto;
  }

  .category-form {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .billing-alert {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (min-width: 1080px) {
  .vehicle-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .vehicle-form .wide-field {
    grid-column: span 2;
  }

  .vehicle-form .primary-button {
    grid-column: 1 / -1;
    width: 220px;
  }
}
