:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #dbeafe;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(15, 23, 42, .08);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 286px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #111c31;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: #1e293b;
  --brand: #60a5fa;
  --brand-2: #3b82f6;
  --brand-soft: rgba(96, 165, 250, .16);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, var(--brand-soft), transparent 28rem), var(--bg);
  color: var(--text);
}

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

button { cursor: pointer; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
  backdrop-filter: blur(18px);
  z-index: 40;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: var(--shadow);
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -.05em;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .25);
}

.brand-block strong { display: block; font-size: 1.02rem; }
.brand-block small { opacity: .82; }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: .18s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.title-wrap { min-width: 0; flex: 1; }
.title-wrap h1 { margin: 0; line-height: 1.1; font-size: clamp(1.35rem, 2vw, 2rem); }
.title-wrap p { margin: 4px 0 0; color: var(--muted); }

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box {
  min-width: min(30vw, 420px);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 14px;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
}

.content {
  padding: 28px;
}

.icon-btn, .ghost, .primary, .danger, .success, .warning, .soft, .mini-btn {
  border: 0;
  border-radius: 12px;
  transition: .18s ease;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.icon-btn:hover, .ghost:hover, .soft:hover { transform: translateY(-1px); }

.primary, .danger, .success, .warning, .ghost, .soft {
  padding: 11px 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-2); }
.success { background: var(--success); color: #fff; }
.warning { background: var(--warning); color: #111827; }
.danger { background: var(--danger); color: #fff; }
.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.soft { background: var(--brand-soft); color: var(--brand-2); }
.full { width: 100%; }

.mini-btn {
  padding: 7px 9px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card.flat { box-shadow: none; }
.card h2, .card h3 { margin-top: 0; }
.card h2 { font-size: 1.18rem; }
.card h3 { font-size: 1.05rem; }
.card p { color: var(--muted); }

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  right: -45px;
  top: -45px;
  background: var(--brand-soft);
}

.metric-label { color: var(--muted); font-size: .9rem; }
.metric-value { font-size: clamp(1.45rem, 3vw, 2.1rem); font-weight: 900; margin: 8px 0 2px; letter-spacing: -.04em; }
.metric-help { color: var(--muted); font-size: .86rem; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: .83rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
}

tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.green { background: rgba(22, 163, 74, .12); color: var(--success); }
.badge.red { background: rgba(220, 38, 38, .12); color: var(--danger); }
.badge.yellow { background: rgba(245, 158, 11, .16); color: var(--warning); }
.badge.blue { background: var(--brand-soft); color: var(--brand-2); }

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

.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: .88rem; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
}

.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.modal-root:not(:empty) {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 100;
}

.modal {
  width: min(940px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .28);
}

.modal-header, .modal-footer {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 { margin: 0; }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .18s ease;
  max-width: 340px;
}

.toast.show { opacity: 1; transform: translateY(0); }

.empty-state {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong { display: block; color: var(--text); margin-bottom: 5px; }

.kpi-row { display: flex; gap: 8px; flex-wrap: wrap; }

.inline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.inline-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.strong { font-weight: 800; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

.chart-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 95px;
  gap: 10px;
  align-items: center;
  font-size: .9rem;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.shop-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  display: grid;
}

.product-cover {
  height: 138px;
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-2));
  display: grid;
  place-items: center;
  color: var(--brand-2);
  font-size: 2.4rem;
  font-weight: 900;
  overflow: hidden;
}

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

.shop-card-body { padding: 14px; display: grid; gap: 10px; }
.shop-card-body h3 { margin: 0; }
.price { font-weight: 900; font-size: 1.25rem; }

.cart-panel {
  position: sticky;
  top: 92px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-action {
  text-align: left;
  justify-content: flex-start;
  min-height: 76px;
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.search-result-item button { margin-top: 8px; }

.print-only { display: none; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    transform: translateX(-105%);
    transition: .2s ease;
    width: min(86vw, 320px);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 14px; align-items: flex-start; }
  .top-actions { flex: 0 0 auto; }
  .search-box { display: none; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; }
  .quick-actions { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 84px 1fr 75px; }
  .modal-root:not(:empty) { padding: 0; place-items: end center; }
  .modal { border-radius: 24px 24px 0 0; max-height: 94vh; }
}

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .actions, .modal-root, .toast, .no-print { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .print-only { display: block; }
}

/* Banco de dados / Firebase */
.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--soft);
}
.form-grid.compact { gap: 10px; }
.small { font-size: .84rem; }
#syncStatus[data-tone="online"] { color: var(--success); }
#syncStatus[data-tone="error"] { color: var(--danger); }
#syncStatus[data-tone="loading"] { color: var(--warning); }
#syncStatus[data-tone="local"] { color: var(--muted); }
button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
}

/* Tela de login obrigatória para versão cliente */
.app-shell.login-mode {
  display: block;
  min-height: 100vh;
}

.app-shell.login-mode .sidebar,
.app-shell.login-mode .topbar {
  display: none;
}

.app-shell.login-mode .content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-screen {
  width: min(100%, 480px);
}

.login-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 34px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.login-brand .big {
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.login-brand strong {
  display: block;
  font-size: 1.2rem;
}

.login-brand small,
.login-card p,
.login-note,
.login-footer,
.login-loading {
  color: var(--muted);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  letter-spacing: -.04em;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.login-note {
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  line-height: 1.45;
  font-size: .94rem;
}

.login-footer {
  margin-top: 22px;
  font-size: .84rem;
  text-align: center;
}

.login-loading {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

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


/* Mobile app experience */
body { -webkit-tap-highlight-color: transparent; }
button, .nav-item, .mini-btn, .primary, .ghost, .soft, .danger, .success, .warning { touch-action: manipulation; }
.starter-card {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  background: linear-gradient(135deg, var(--surface), var(--brand-soft));
}
.starter-card h2 { margin: 10px 0 6px; letter-spacing: -.03em; }
.starter-card p { margin: 0; }
.starter-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.starter-steps button { min-height: 74px; flex-direction: column; gap: 4px; }
.starter-steps strong { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; }
.mobile-fab { display: none; }

@media (max-width: 820px) {
  :root { --radius: 16px; --radius-sm: 12px; }
  html { scroll-padding-bottom: 110px; }
  body { background: var(--bg); }
  .app-shell {
    display: block;
    min-height: 100vh;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }
  .main { min-height: 100vh; }
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    transform: none !important;
    width: 100%;
    height: auto;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    border-radius: 22px 22px 0 0;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 -18px 45px rgba(15, 23, 42, .12);
    backdrop-filter: blur(18px);
  }
  .brand-block,
  .sidebar-footer { display: none; }
  .nav-list {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 2px 2px 4px;
    scrollbar-width: none;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-item {
    min-width: 76px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 2px;
    padding: 9px 8px;
    border-radius: 16px;
    font-size: 1.16rem;
    min-height: 58px;
  }
  .nav-item span { font-size: .70rem; line-height: 1.05; font-weight: 800; }
  .nav-item.active {
    box-shadow: none;
    color: var(--brand-2);
    background: var(--brand-soft);
  }
  .topbar {
    top: 0;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    align-items: center;
    gap: 10px;
  }
  #menuBtn { display: none; }
  .title-wrap h1 { font-size: 1.18rem; line-height: 1.1; }
  .title-wrap p { font-size: .82rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64vw; }
  .top-actions { margin-left: auto; }
  .top-actions .icon-btn { width: 40px; height: 40px; border-radius: 14px; }
  .content { padding: 14px 12px 26px; }
  .card { padding: 14px; border-radius: 18px; box-shadow: 0 10px 28px rgba(15, 23, 42, .07); }
  .grid { gap: 12px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .metric-card { min-height: 108px; }
  .metric-label { font-size: .78rem; }
  .metric-value { font-size: 1.22rem; margin: 6px 0 2px; word-break: break-word; }
  .metric-help { font-size: .74rem; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .quick-action { min-height: 64px; border-radius: 16px; font-size: .92rem; justify-content: center; text-align: center; }
  .starter-card { margin-top: 12px; }
  .starter-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .starter-steps button { min-height: 66px; padding: 8px 6px; font-size: .84rem; }
  .section-head { margin-bottom: 12px; gap: 10px; }
  .section-head h2 { font-size: 1.05rem; }
  .section-head p { font-size: .86rem; }
  .section-head .actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head .actions button { width: 100%; min-height: 44px; }
  .actions { gap: 8px; }
  .actions .mini-btn, .actions .ghost, .actions .primary, .actions .danger, .actions .soft { min-height: 42px; flex: 1 1 auto; }
  .table-wrap { overflow: visible; border: 0; background: transparent; border-radius: 0; }
  table, thead, tbody, tr, th, td { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tr {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    overflow: hidden;
  }
  td {
    display: grid;
    gap: 4px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
  }
  td:last-child { border-bottom: 0; }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  td[colspan]::before { content: ''; display: none; }
  td .actions { justify-content: stretch; }
  td .actions .mini-btn { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .field label { font-size: .82rem; }
  .field input, .field select, .field textarea {
    min-height: 48px;
    border-radius: 14px;
    font-size: 16px;
    padding: 11px 12px;
  }
  .modal-root:not(:empty) { padding: 0; place-items: end center; }
  .modal {
    width: 100%;
    height: min(92vh, 820px);
    max-height: calc(100vh - env(safe-area-inset-top));
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
  }
  .modal-header, .modal-footer { padding: 14px; }
  .modal-header h2 { font-size: 1.08rem; }
  .modal-body { padding: 14px; overflow: auto; flex: 1; }
  .modal-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); flex-wrap: nowrap; }
  .modal-footer button { flex: 1; min-height: 48px; }
  .inline-list { gap: 8px; }
  .inline-list li { align-items: flex-start; border-radius: 16px; }
  .shop-grid { grid-template-columns: 1fr; }
  .product-cover { height: 128px; }
  .cart-panel { position: static; }
  .bar-row { grid-template-columns: 72px 1fr 70px; font-size: .82rem; }
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    max-width: none;
    text-align: center;
  }
  .mobile-fab {
    display: inline-flex;
    position: fixed;
    right: 14px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 75;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 18px 44px rgba(37, 99, 235, .35);
    font-size: .95rem;
  }
  .mobile-fab span { font-size: 1.15rem; }
  .mobile-fab strong { font-weight: 900; }
}

@media (max-width: 390px) {
  .grid-4 { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr !important; }
  .starter-steps { grid-template-columns: 1fr; }
  .nav-item { min-width: 72px; }
}

@media (display-mode: standalone) and (max-width: 820px) {
  .topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
}
