/* Minha Revenda — identidade: rosa-claro, vinho e branco. Mobile first. */
:root {
  --vinho: #7b1e3a;
  --vinho-700: #5a1229;
  --vinho-500: #a3405f;
  --rosa-400: #e59ab2;
  --rosa-200: #f6d6df;
  --rosa-100: #fceef2;
  --rosa-50: #fff7f9;
  --branco: #ffffff;
  --texto: #2b1a20;
  --muted: #7d6670;
  --borda: #f0dde3;
  --ok: #2e7d5b;
  --ok-bg: #e6f4ed;
  --warn: #9a6512;
  --warn-bg: #fdf1dc;
  --danger: #b4233c;
  --danger-bg: #fde6ea;
  --info: #5a3d9a;
  --info-bg: #efe9fb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(90, 18, 41, 0.06), 0 6px 24px rgba(90, 18, 41, 0.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --nav-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--rosa-50);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 1.65rem; color: var(--vinho-700); }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: 0.95rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--vinho); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
:focus-visible { outline: 3px solid rgba(123, 30, 58, 0.35); outline-offset: 2px; border-radius: 6px; }

/* Boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { font-family: var(--serif); font-size: 1.6rem; color: var(--vinho); animation: pulse 1.2s ease-in-out infinite alternate; }
.boot-logo em, .logo em { font-style: italic; color: var(--vinho-500); }
@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }

/* ---------- Layout ---------- */
.layout { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(255, 247, 249, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--borda);
}
.logo { font-family: var(--serif); font-size: 1.3rem; color: var(--vinho); text-decoration: none; white-space: nowrap; }
.topbar .biz { font-size: 0.8rem; color: var(--muted); max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.view { padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--branco); border-top: 1px solid var(--borda); box-shadow: 0 -4px 20px rgba(90, 18, 41, 0.05);
}
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 0.7rem; color: var(--muted); text-decoration: none; border: 0; background: none; cursor: pointer;
}
.bottom-nav .active { color: var(--vinho); font-weight: 650; }
.bottom-nav .active .ic { stroke-width: 2.2; }

@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: 248px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh; padding: 22px 14px;
    background: var(--branco); border-right: 1px solid var(--borda); overflow-y: auto;
  }
  .sidebar .logo { font-size: 1.5rem; padding: 4px 12px 18px; }
  .nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
    color: var(--texto); text-decoration: none; font-weight: 500;
  }
  .nav-link:hover { background: var(--rosa-100); }
  .nav-link.active { background: var(--vinho); color: var(--branco); }
  .nav-link .count { margin-left: auto; }
  .sidebar .user-box { margin-top: auto; padding: 14px 12px; border-top: 1px solid var(--borda); }
  .topbar, .bottom-nav { display: none; }
  .view { padding: 30px 36px 48px; }
}

/* ---------- Componentes ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-tight { padding: 4px 0; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-kpi { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid-kpi.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-kpi.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .grid-kpi.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.kpi {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--branco); border: 1px solid var(--borda); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.kpi-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; padding-right: 26px; }
.kpi-value { font-size: 1.28rem; font-weight: 700; color: var(--vinho-700); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-hint { font-size: 0.78rem; color: var(--muted); }
.kpi-ic { position: absolute; top: 12px; right: 12px; color: var(--vinho-500); opacity: 0.8; }
.kpi-hero { background: linear-gradient(135deg, var(--vinho) 0%, var(--vinho-500) 100%); border: 0; }
.kpi-hero .kpi-label, .kpi-hero .kpi-hint, .kpi-hero .kpi-ic { color: rgba(255, 255, 255, 0.82); }
.kpi-hero .kpi-value { color: #fff; }
.kpi-danger .kpi-value { color: var(--danger); }
.kpi-ok .kpi-value { color: var(--ok); }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--rosa-400); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.92rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--vinho); color: #fff; }
.btn-primary:hover { background: var(--vinho-700); }
.btn-ghost { background: var(--branco); border-color: var(--borda); color: var(--vinho-700); }
.btn-ghost:hover { border-color: var(--rosa-400); background: var(--rosa-100); }
.btn-soft { background: var(--rosa-100); color: var(--vinho-700); }
.btn-soft:hover { background: var(--rosa-200); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-wa { background: #1f8f4e; color: #fff; }
.btn-wa:hover { background: #17733e; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--borda); background: var(--branco); color: var(--vinho-700); cursor: pointer;
}
.icon-btn:hover { background: var(--rosa-100); }
.link-btn { border: 0; background: none; padding: 0; color: var(--vinho); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 650; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #f1eaed; color: var(--muted); }
.badge-vinho { background: var(--vinho); color: #fff; }
.badge-rosa { background: var(--rosa-200); color: var(--vinho-700); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700; display: inline-grid; place-items: center; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.alert + .alert { margin-top: 8px; }
.alert-warn { background: var(--warn-bg); color: #6d470b; }
.alert-danger { background: var(--danger-bg); color: #861a2d; }
.alert-info { background: var(--rosa-100); color: var(--vinho-700); }
.alert-ok { background: var(--ok-bg); color: #1f5a40; }
.alert .btn { margin-left: auto; }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--borda);
  min-width: 0;
}
.list > .row:last-child, .list > li:last-child > .row { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
button.row, a.row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--borda); text-align: left; cursor: pointer; color: inherit; text-decoration: none; }
button.row:hover, a.row:hover { background: var(--rosa-50); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--rosa-200); color: var(--vinho-700); font-weight: 700; font-size: 0.85rem; flex: none; }
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--rosa-100); flex: none; }
.time-pill { min-width: 58px; padding: 6px 8px; border-radius: 10px; background: var(--rosa-100); color: var(--vinho-700); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--borda); text-align: left; white-space: nowrap; }
.table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 650; background: var(--rosa-50); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: var(--rosa-50); }
.table tr.clickable { cursor: pointer; }
.table tfoot td { font-weight: 700; background: var(--rosa-50); }

/* Formulários */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: 0.82rem; font-weight: 600; color: var(--vinho-700); }
.field small { color: var(--muted); font-size: 0.78rem; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid #e6cdd5; background: var(--branco); font-size: 16px;
}
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--vinho-500); box-shadow: 0 0 0 3px rgba(163, 64, 95, 0.15); }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-row.r3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 420px) { .form-row.r3 { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.form-error { color: var(--danger); font-size: 0.88rem; font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }
.check { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--vinho); }
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--rosa-100); border-radius: 999px; flex-wrap: wrap; }
.segmented button, .segmented label { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 0.86rem; color: var(--vinho-700); cursor: pointer; }
.segmented .on, .segmented input:checked + span { background: var(--branco); box-shadow: var(--shadow); }
.segmented label { padding: 0; }
.segmented label span { display: block; padding: 7px 14px; border-radius: 999px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { border: 1px solid var(--borda); background: var(--branco); border-radius: 999px; padding: 7px 14px; font-size: 0.85rem; font-weight: 600; color: var(--vinho-700); cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--vinho); border-color: var(--vinho); color: #fff; }
.search { position: relative; flex: 1; min-width: 180px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }

/* Itens da venda */
.items-box { border: 1px dashed #e6cdd5; border-radius: 12px; padding: 10px; display: grid; gap: 8px; background: var(--rosa-50); }
.item-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: var(--branco); border-radius: 10px; padding: 8px 10px; border: 1px solid var(--borda); }
.total-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; font-weight: 700; color: var(--vinho-700); padding: 4px 2px; }
.preview-inst { font-size: 0.85rem; display: grid; gap: 4px; background: var(--branco); border-radius: 10px; padding: 10px; border: 1px solid var(--borda); }
.preview-inst div { display: flex; justify-content: space-between; gap: 10px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(43, 26, 32, 0.45); animation: fade 0.15s ease;
}
.modal {
  width: 100%; max-height: 92vh; overflow-y: auto; background: var(--branco);
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15); animation: up 0.2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; background: var(--branco); border-bottom: 1px solid var(--borda); }
.modal-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; color: var(--vinho-700); }
.modal-body { padding: 18px; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { max-width: 560px; border-radius: 22px; }
  .modal-wide { max-width: 860px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } }
.confirm-text { margin-bottom: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-grid div { background: var(--rosa-50); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.detail-grid span { display: block; font-size: 0.75rem; color: var(--muted); }
.detail-grid strong { overflow-wrap: anywhere; }

/* Toasts */
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); display: grid; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 960px) { #toasts { bottom: 24px; } }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--vinho-700); color: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2); font-weight: 500; transition: opacity 0.3s, transform 0.3s; }
.toast-error { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* Agenda */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 0.72rem; text-align: center; color: var(--muted); font-weight: 650; text-transform: uppercase; padding: 4px 0; }
.cal-day {
  position: relative; aspect-ratio: 1 / 1; min-height: 38px; border-radius: 12px; border: 1px solid transparent;
  background: var(--rosa-50); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--texto);
}
.cal-day:hover { border-color: var(--rosa-400); }
.cal-day.out { opacity: 0.35; }
.cal-day.today { border-color: var(--vinho); color: var(--vinho); }
.cal-day.sel { background: var(--vinho); color: #fff; }
.cal-dots { display: flex; gap: 2px; height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--vinho-500); }
.cal-day.sel .cal-dots i { background: #fff; }
.agenda-layout { display: grid; gap: 14px; }
@media (min-width: 960px) { .agenda-layout { grid-template-columns: 380px 1fr; align-items: start; } }

/* Produtos */
.product-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.product { display: flex; gap: 12px; align-items: center; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); cursor: pointer; text-align: left; width: 100%; color: inherit; }
.product:hover { border-color: var(--rosa-400); }
.product.low { border-color: #f1b4c0; background: #fff9fa; }
.photo-pick { display: flex; gap: 12px; align-items: center; }
.photo-pick img, .photo-pick .ph { width: 80px; height: 80px; border-radius: 14px; object-fit: cover; background: var(--rosa-100); display: grid; place-items: center; color: var(--vinho-500); }

/* Gráficos */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #f1e2e7; stroke-width: 1; }
.chart .grid.zero { stroke: #d9bcc6; }
.chart .axis { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; gap: 10px; align-items: center; font-size: 0.86rem; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: var(--rosa-100); border-radius: 999px; overflow: hidden; }
.hb-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--vinho-500), var(--vinho)); border-radius: 999px; }
.hb-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.progress { height: 12px; background: var(--rosa-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--rosa-400), var(--vinho)); border-radius: 999px; }

/* Tiles do menu */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--branco); border: 1px solid var(--borda); text-decoration: none; color: var(--vinho-700); font-weight: 650; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--rosa-400); background: var(--rosa-100); }
.tile .tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--rosa-100); }
.tile span.muted { font-weight: 400; font-size: 0.8rem; }

/* Autenticação */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { display: none; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 32px 20px; max-width: 460px; width: 100%; margin: 0 auto; }
.auth-main .logo { font-size: 2rem; margin-bottom: 6px; }
.auth-card { margin-top: 22px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.auth-tabs button { padding: 10px; border: 0; border-bottom: 2px solid var(--borda); background: none; font-weight: 650; color: var(--muted); cursor: pointer; }
.auth-tabs button.on { color: var(--vinho); border-color: var(--vinho); }
.price-box { border-radius: 14px; padding: 14px; background: linear-gradient(135deg, var(--rosa-100), #fff); border: 1px solid var(--rosa-200); }
.price-box strong { font-size: 1.5rem; color: var(--vinho); }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth-hero {
    display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
    background: radial-gradient(circle at 20% 15%, var(--vinho-500), var(--vinho) 45%, var(--vinho-700)); color: #fff;
  }
  .auth-hero .logo { color: #fff; font-size: 1.6rem; }
  .auth-hero .logo em { color: var(--rosa-200); }
  .auth-hero h2 { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; line-height: 1.15; max-width: 460px; }
  .auth-hero ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: rgba(255, 255, 255, 0.88); }
  .auth-hero li { display: flex; gap: 10px; align-items: center; }
}

/* Mensagens de suporte */
.thread { display: grid; gap: 8px; margin: 10px 0; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; font-size: 0.9rem; white-space: pre-wrap; }
.msg small { display: block; font-size: 0.72rem; opacity: 0.75; margin-top: 4px; }
.msg-me { justify-self: end; background: var(--vinho); color: #fff; border-bottom-right-radius: 4px; }
.msg-other { justify-self: start; background: var(--rosa-100); border-bottom-left-radius: 4px; }

.code-box { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; background: var(--rosa-50); border: 1px dashed #e6cdd5; border-radius: 10px; padding: 10px; word-break: break-all; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 26px 16px; text-align: center; color: var(--muted); }
.empty .ic { color: var(--rosa-400); }
.divider { height: 1px; background: var(--borda); margin: 16px 0; }
.stack { display: grid; gap: 10px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 22px; }

/* Painel administrativo */
body.admin { background: #fbf5f7; }
body.admin .sidebar { background: var(--vinho-700); border-right: 0; }
body.admin .sidebar .logo { color: #fff; }
body.admin .sidebar .logo em { color: var(--rosa-200); }
body.admin .nav-link { color: rgba(255, 255, 255, 0.82); }
body.admin .nav-link:hover { background: rgba(255, 255, 255, 0.08); }
body.admin .nav-link.active { background: var(--rosa-100); color: var(--vinho-700); }
body.admin .sidebar .user-box { border-color: rgba(255, 255, 255, 0.15); color: #fff; }
body.admin .sidebar .user-box .muted { color: rgba(255, 255, 255, 0.7); }
.admin-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rosa-200); padding: 0 12px 14px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .btn { display: none !important; }
  .view { padding: 0; }
}
@media (min-width: 560px) { .cal-day { aspect-ratio: auto; height: 52px; } }
[hidden] { display: none !important; }
.grid-2 > *, .grid > *, .agenda-layout > *, .grid-kpi > * { min-width: 0; }
.cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 380px) { .cal-grid { gap: 3px; } .cal-day { min-height: 34px; border-radius: 9px; } .cal.card { padding: 12px; } }


/* Páginas legais */
.legal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; max-width: 860px; margin: 0 auto; }
.legal-head nav a { font-size: 0.9rem; }
.legal { max-width: 860px; margin: 0 auto; padding: 8px 16px 64px; line-height: 1.65; }
.legal h1 { font-size: 2rem; margin-bottom: 4px; }
.legal h2 { font-size: 1.15rem; color: var(--vinho-700); margin: 28px 0 8px; }
.legal h3 { margin: 16px 0 6px; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal-table { margin: 8px 0 12px; background: var(--branco); }
.legal-table td, .legal-table th { white-space: normal; }
.draft-note { background: var(--warn-bg); color: #6d470b; border-radius: 12px; padding: 10px 14px; font-size: 0.9rem; }
.legal-missing { background: #fff0b3; color: #6d470b; border-radius: 4px; padding: 0 4px; font-weight: 600; }
.legal-links { text-align: center; margin-top: 16px; }
.check.consent { align-items: flex-start; font-size: 0.88rem; }
.check.consent input { margin-top: 2px; flex: none; }
