@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root,
[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-elevated: #161616;
  --bg-card: #1a1a1a;
  --bg-hover: #222;
  --border: #2e2e2e;
  --border-light: #3a3a3a;
  --text: #e8e8e8;
  --text-muted: #9a9a9a;
  --text-dim: #6a6a6a;
  --silver: #b0b0b0;
  --silver-bright: #d4d4d4;
  --accent: #c8c8c8;
  --accent-hover: #ffffff;
  --link-hover: #ffffff;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --topbar-bg: rgba(14,14,14,.85);
  --hero-fade: rgba(14,14,14,.95);
  --input-bg: #0e0e0e;
  --btn-primary-start: #d8d8d8;
  --btn-primary-end: #a8a8a8;
  --btn-primary-text: #111;
  --theme-color: #1a1a1a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
  --sidebar-w: 260px;
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg: #f3f4f6;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef0f3;
  --border: #e2e5ea;
  --border-light: #cfd4dc;
  --text: #16181d;
  --text-muted: #5c6570;
  --text-dim: #8a939e;
  --silver: #6b7280;
  --silver-bright: #374151;
  --accent: #4b5563;
  --accent-hover: #111827;
  --link-hover: #111827;
  --success: #15803d;
  --warning: #b45309;
  --danger: #dc2626;
  --info: #2563eb;
  --topbar-bg: rgba(255,255,255,.9);
  --hero-fade: rgba(243,244,246,.96);
  --input-bg: #f8f9fb;
  --btn-primary-start: #2a2a2a;
  --btn-primary-end: #111111;
  --btn-primary-text: #ffffff;
  --theme-color: #f3f4f6;
  --shadow: 0 8px 28px rgba(15,23,42,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .2s ease;
}

a { color: var(--silver-bright); text-decoration: none; transition: color .2s; }
a:hover { color: var(--link-hover); }

img { max-width: 100%; display: block; }

/* ─── Auth Layout ─── */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(176,176,176,.06), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(176,176,176,.04), transparent 50%),
    var(--bg);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-logo {
  width: 120px;
  height: auto;
  margin: 0 auto 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
}

[data-theme="light"] .auth-logo {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.12));
}

[data-theme="light"] .hero::before {
  opacity: .08;
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 28px;
}

/* ─── App Shell ─── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand img {
  width: 48px;
  height: auto;
}

.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.sidebar-brand .brand-text strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.sidebar-brand .brand-text span {
  font-size: .65rem;
  color: var(--silver);
  letter-spacing: .18em;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-dim);
  padding: 12px 12px 6px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.nav-link:hover, .nav-link.active {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  opacity: .7;
  flex-shrink: 0;
}

.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
}

.sidebar-footer .user-name {
  color: var(--text);
  font-weight: 600;
  display: block;
}

.sidebar-footer .user-role {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--silver);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 28px;
}

/* ─── Components ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(180deg, var(--btn-primary-start) 0%, var(--btn-primary-end) 100%);
  color: var(--btn-primary-text);
  border-color: var(--border-light);
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: var(--btn-primary-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--silver);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.theme-toggle-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
}

.public-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--silver);
  color: var(--text);
}

.btn-danger {
  background: rgba(248,113,113,.12);
  color: var(--danger);
  border-color: rgba(248,113,113,.3);
}

.btn-danger:hover {
  background: rgba(248,113,113,.22);
}

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-block { width: 100%; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-header h2, .card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--silver), transparent);
}

.stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -.02em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--silver);
  box-shadow: 0 0 0 3px rgba(176,176,176,.15);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239a9a9a'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control { min-height: 100px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.form-check input { accent-color: var(--silver); width: 16px; height: 16px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

table.data th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(255,255,255,.02); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.badge-admin { background: rgba(212,212,212,.15); color: var(--silver-bright); }
.badge-funcionario { background: rgba(96,165,250,.15); color: var(--info); }
.badge-success { background: rgba(74,222,128,.15); color: var(--success); }
.badge-warning { background: rgba(251,191,36,.15); color: var(--warning); }
.badge-danger { background: rgba(248,113,113,.15); color: var(--danger); }
.badge-info { background: rgba(96,165,250,.15); color: var(--info); }
.badge-muted { background: rgba(154,154,154,.12); color: var(--text-muted); }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: .9rem;
  border: 1px solid;
}

.alert-success { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.3); color: var(--success); }
.alert-error { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.3); color: var(--danger); }
.alert-info { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.3); color: var(--info); }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state p { margin-top: 8px; }

.search-bar {
  display: flex;
  gap: 8px;
  max-width: 420px;
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Catalog / Vitrine cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}

.product-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.product-card .thumb {
  aspect-ratio: 4/3;
  background: var(--bg);
  overflow: hidden;
}

.product-card .thumb img,
.product-card .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .body {
  padding: 14px 16px 18px;
}

.product-card .type-tag {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--silver);
  font-weight: 600;
}

.product-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 4px 0 6px;
}

.product-card .price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--silver-bright);
}

.product-card .desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.media-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
}

.media-item img, .media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item .remove-btn {
  position: absolute;
  top: 4px; right: 4px;
}

.extras-list {
  display: grid;
  gap: 8px;
}

.extra-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.extra-item:has(input:checked) {
  border-color: var(--silver);
  background: rgba(176,176,176,.08);
}

.extra-item input { accent-color: var(--silver); }

.extra-item .info { flex: 1; }
.extra-item .info strong { display: block; font-size: .9rem; }
.extra-item .info span { font-size: .78rem; color: var(--text-muted); }
.extra-item .price { font-weight: 700; color: var(--silver-bright); }

#parcelas-group { display: none; }
#parcelas-group.visible { display: block; }

/* Calendar */
.calendar-day {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}

.calendar-day .date {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--silver-bright);
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: .88rem;
}

.slot-row:first-of-type { border-top: none; }

/* Public layout */
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.public-header .logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-header .logo-wrap img { width: 52px; }

.public-nav a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.public-nav a:hover { color: var(--link-hover); }

.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  padding: 60px 32px 80px;
  background:
    linear-gradient(180deg, transparent 30%, var(--hero-fade) 100%),
    radial-gradient(ellipse at 60% 40%, rgba(176,176,176,.08), transparent 55%),
    var(--bg);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    url('../img/logo.jpeg') center 30% / min(420px, 50vw) no-repeat;
  opacity: .12;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 640px;
  animation: fadeUp .8s ease both;
}

.hero-brand {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  margin-bottom: 8px;
}

.hero-brand span {
  display: block;
  font-size: .35em;
  letter-spacing: .28em;
  color: var(--silver);
  font-weight: 500;
  margin-top: 4px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 420px;
  margin: 16px 0 28px;
}

.section {
  padding: 56px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 28px;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.section-header p {
  color: var(--text-muted);
  margin-top: 6px;
}

.public-footer {
  border-top: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in { animation: fadeIn .4s ease both; }

/* Chart bars */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding-top: 10px;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar .bar {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--silver-bright), #555);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .5s ease;
}

.chart-bar .label {
  font-size: .68rem;
  color: var(--text-dim);
  margin-top: 6px;
  font-family: var(--mono);
}

/* Mobile */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 1.1rem;
  line-height: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 90;
}

.sidebar-overlay.show { display: block; }

.public-menu-toggle { display: none; }

.public-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* PWA banners */
.pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 200;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}

.pwa-banner.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pwa-banner.pwa-push { bottom: auto; top: 12px; }

.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.pwa-banner-inner img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

.pwa-banner-text {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-banner-text strong {
  font-size: .95rem;
}

.pwa-banner-text span {
  font-size: .8rem;
  color: var(--text-muted);
}

.pwa-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pwa-ios-tip {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 210;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.pwa-ios-tip p { margin-bottom: 12px; font-size: .9rem; color: var(--text-muted); }

.servicos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.cliente-block {
  border: 1px dashed var(--border-light) !important;
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .topbar {
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .topbar h1 {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions .btn { padding: 8px 12px; }

  .public-header {
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    flex-wrap: nowrap;
    gap: 10px;
    position: relative;
  }
  .public-header-right {
    margin-left: auto;
    gap: 10px;
  }
  .public-menu-toggle { display: inline-flex; }
  .public-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 8px;
    z-index: 60;
  }
  .public-nav.open { display: flex; }
  .public-nav a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
  }
  .public-header { position: sticky; }

  .hero { padding: 36px 16px 56px; min-height: 58vh; }
  .hero-brand { font-size: clamp(2.2rem, 12vw, 3.2rem); }
  .section { padding: 36px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 1.35rem; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -4px; }
  .actions-cell { flex-direction: column; align-items: stretch; }
  .search-bar { max-width: none; width: 100%; }
  .pwa-banner { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .sidebar { width: min(var(--sidebar-w), 86vw); }
}

/* Print / Nota Fiscal */
@media print {
  body { background: #fff; color: #000; }
  .no-print, .pwa-banner, .sidebar, .topbar { display: none !important; }
  .main { margin-left: 0 !important; }
}
