/* =========================================================================
   Agenda MMR — painel administrativo
   Um app utilitário para abrir várias vezes ao dia: segue as convenções do
   próprio iOS (barra de abas, títulos grandes, listas agrupadas, switches)
   para desaparecer no sistema, e usa a cor de cada cliente (a mesma do
   Google Agenda) como a única informação por cor — não como decoração.
   ========================================================================= */

:root {
  --paper: #f5f5f1;
  --surface: #ffffff;
  --surface-2: #fafbf8;
  --ink: #202823;
  --muted: #646d67;
  --faint: #8b938c;
  --line: #e2e6df;
  --line-strong: #cfd7cb;
  --green: #365b47;
  --green-deep: #1d3025;
  --green-strong: #244334;
  --pale: #edf3ed;
  --red: #96382d;
  --red-pale: #f7e9e6;
  --amber: #8a5a12;
  --amber-pale: #f8eeda;
  --shadow-float: 0 10px 30px -12px rgba(29, 48, 37, 0.35);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12160f;
    --surface: #1a201a;
    --surface-2: #202720;
    --ink: #eef2eb;
    --muted: #a2ac9f;
    --faint: #78816f;
    --line: #2b332a;
    --line-strong: #384033;
    --green: #6fae87;
    --green-deep: #0d1710;
    --green-strong: #86c39c;
    --pale: #1f2e24;
    --red: #e2897c;
    --red-pale: #3a231f;
    --amber: #e3b56b;
    --amber-pale: #362b18;
    --shadow-float: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Vários containers abaixo fixam "display" (flex/grid) para o layout interno; sem isto,
   essa mesma regra anularia o atributo padrão "hidden" do HTML nesses elementos. */
[hidden] { display: none !important; }
html, body { height: 100%; }
html { background: var(--green-deep); scroll-padding-top: var(--safe-t); }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
  padding-top: var(--safe-t); padding-bottom: var(--safe-b);
}
body.is-login { background: var(--green-deep); }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
svg.ico { flex: none; display: block; }
::selection { background: var(--pale); }
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- casca do app / abas ---------- */
#appShell { position: fixed; inset: 0; padding-top: var(--safe-t); display: flex; flex-direction: column; }
#pages-root { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--paper); }
.view.active { display: flex; }

.tabbar {
  display: flex; padding: 6px calc(6px + var(--safe-r)) calc(4px + var(--safe-b)) calc(6px + var(--safe-l));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--line); flex: none;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0;
  padding: 6px 2px 4px; color: var(--faint); min-height: 50px; border-radius: 12px;
}
.tab span { font-size: 10.5px; font-weight: 590; letter-spacing: -.1px; }
.tab.active { color: var(--green); }
@media (prefers-color-scheme: dark) { .tab.active { color: var(--green-strong); } }

/* ---------- barra superior + páginas empilhadas ---------- */
.bar { flex: none; padding-top: var(--safe-t); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.view > .bar { padding-top: 4px; }
.bar-row { display: flex; align-items: center; gap: 4px; padding: 6px 8px; min-height: 46px; }
.bar-row.sub { padding-top: 0; gap: 10px; }
.bar-title, .bar-month { font-size: 22px; font-weight: 700; letter-spacing: -.4px; padding: 0 4px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-month { text-align: center; text-transform: capitalize; }
.bar-btn { background: none; border: 0; color: var(--green); display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; flex: none; }
.bar-btn.on { background: var(--pale); }
.bar-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grow { flex: 1 1 auto; }
.pill { border: 0; background: var(--pale); color: var(--green); font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 99px; }

.page { position: absolute; inset: 0; background: var(--paper); display: flex; flex-direction: column; z-index: 10; transform: translateX(100%); transition: transform .32s cubic-bezier(.32,.72,0,1); box-shadow: -6px 0 24px rgba(0,0,0,.12); }
.page.in { transform: translateX(0); }
#pages { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
#pages .page { pointer-events: auto; }
.page-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(28px + var(--safe-b)); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 16px calc(92px + var(--safe-b)); }
.scroll-end { height: 4px; }

/* ---------- formulários: listas agrupadas ao estilo Ajustes do iOS ---------- */
.sect { margin: 0 0 22px; }
.sect-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px 14px; }
.sect-foot { font-size: 12.5px; color: var(--muted); margin: 8px 14px 0; line-height: 1.45; }
.group { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.cell { padding: 11px 14px; border-top: 1px solid var(--line); }
.group > .cell:first-child, .group > *:first-child .cell { border-top: 0; }
.cell-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.cell-value { font-size: 15.5px; }
.field-cell input[type], .field-cell select, .field-cell textarea {
  width: 100%; border: 0; background: none; padding: 3px 0; font-size: 16px; color: var(--ink); appearance: none; -webkit-appearance: none;
}
.field-cell input[type="date"], .field-cell input[type="time"] { color-scheme: light; }
@media (prefers-color-scheme: dark) { .field-cell input[type="date"], .field-cell input[type="time"] { color-scheme: dark; } }
.field-cell textarea { resize: vertical; min-height: 64px; font-family: inherit; }
.field-cell.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-cell.inline-add { display: flex; align-items: center; gap: 10px; }
.field-cell.inline-add input { flex: 1; }
.switch-cell { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch-cell.disabled { opacity: .5; pointer-events: none; }
.cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: background .18s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.select { width: 100%; border: 0; background: none; font-size: 16px; padding: 3px 20px 3px 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23646d67' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; }

.searchbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; color: var(--faint); }
.searchbar input { flex: 1; border: 0; background: none; font-size: 16px; color: var(--ink); }
.searchbar .input-btn { color: var(--faint); }
.input-btn { background: none; border: 0; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; color: var(--muted); }
.input-wrap { display: flex; align-items: center; gap: 4px; }
.input-wrap input { flex: 1; }
.filter-bar { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; }
.filter-bar .field-cell { border-top: 0; }
.filter-shortcuts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 12px; border-top: 1px solid var(--line); }

/* ---------- botões ---------- */
.btn { border: 0; background: var(--green); color: #fff; font-size: 16px; font-weight: 600; padding: 13px 18px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; margin-top: 4px; }
.btn.secondary { background: var(--pale); color: var(--green); }
.btn.ghost { background: none; color: var(--green); border: 1px solid var(--line-strong); }
.btn.ghost.danger { color: var(--red); }
.btn.danger { background: var(--red); }
.btn.small { min-height: 38px; padding: 8px 13px; font-size: 14px; border-radius: 10px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn[disabled], .btn.loading { opacity: .6; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.secondary.loading::after, .btn.ghost.loading::after { border-color: rgba(54,91,71,.25); border-top-color: var(--green); }
.icon-btn { border: 0; background: var(--surface-2); border-radius: 10px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.icon-btn.danger { color: var(--red); }
.link-btn { border: 0; background: none; color: var(--green); font-weight: 600; font-size: 14px; padding: 6px 2px; }
.link-btn[disabled] { color: var(--faint); }
.link-btn.on-dark { color: #cfe3d5; text-decoration: underline; text-underline-offset: 3px; font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.row-links { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); padding: 3px; border-radius: 11px; gap: 2px; }
.seg-btn { border: 0; background: none; padding: 7px 13px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg-btn[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.seg.on-dark { background: rgba(0,0,0,.06); }
.seg.pref-seg { display: flex; margin-top: 4px; }
.seg.pref-seg .seg-btn { flex: 1; }

/* ---------- badges, chips, tags ---------- */
.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--pale); color: var(--green); }
.badge.off { background: var(--surface-2); color: var(--faint); }
.badge.ok { background: var(--pale); color: var(--green); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 99px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.65); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--green)); flex: none; }
.dot.lg { width: 12px; height: 12px; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--pale); color: var(--green); }
.tag.manual { background: var(--amber-pale); color: var(--amber); }
.ref { display: inline-block; margin-top: 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list.col { flex-direction: column; }
.tag-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 6px 5px 12px; font-size: 13px; }
.tag-pill button { border: 0; background: var(--line); color: var(--muted); width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* ---------- estados: vazio, alerta, esqueleto ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--pale); color: var(--green); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty strong { color: var(--ink); font-size: 16px; }
.empty p { font-size: 13.5px; max-width: 30ch; }
.banner { display: flex; align-items: center; gap: 10px; background: var(--pale); color: var(--green-deep); border-radius: 12px; padding: 11px 13px; font-size: 13.5px; margin-bottom: 12px; }
.banner.warn { background: var(--amber-pale); color: var(--amber); }
.banner.error { background: var(--red-pale); color: var(--red); }
.banner span { flex: 1; }
.banner-btn { border: 0; background: rgba(0,0,0,.08); border-radius: 8px; padding: 5px 10px; font-weight: 600; font-size: 12.5px; color: inherit; }
.form-error { color: var(--red); background: var(--red-pale); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; margin: 10px 0; }
.form-warn { color: var(--amber); background: var(--amber-pale); border-radius: 10px; padding: 10px 13px; font-size: 13px; margin-top: 8px; display: flex; align-items: flex-start; gap: 6px; }
.err-slot:empty { display: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.hint.strong { color: var(--ink); font-weight: 600; }
.hint.warn { display: flex; align-items: flex-start; gap: 6px; color: var(--amber); }
.fine { font-size: 11.5px; color: var(--faint); line-height: 1.5; margin-top: 4px; }
.summary { font-size: 13px; color: var(--muted); margin: 2px 2px 12px; }
.skeleton-list, .cal-skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton { height: 64px; border-radius: 14px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--line) 50%, var(--surface-2) 70%); background-size: 220% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton.tall { height: 300px; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---------- cartões genéricos (reservas, eventos) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--green)); border-radius: 13px; padding: 14px 15px; margin-bottom: 10px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .time { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.who { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.card .name { font-weight: 600; margin-top: 8px; }
.card .addr { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 14px; }
.card .addr svg { margin-top: 2px; color: var(--muted); }
.card .compl, .card .muted { color: var(--muted); font-size: 13px; margin-top: 3px; }
.routes { display: flex; align-items: center; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.more { margin-top: 10px; font-size: 13px; }
.more summary { color: var(--green); font-weight: 600; list-style: none; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more dl { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.more dt { font-size: 11px; color: var(--muted); }
.ext-card { background: var(--surface-2); border-left-color: var(--faint); }
.ext-card .name { margin-top: 4px; }

/* ---------- Agenda ---------- */
.cal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 16px; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays span { text-align: center; font-size: 11px; color: var(--faint); padding: 2px 0 8px; font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.day { position: relative; aspect-ratio: 1 / 0.92; border: 0; background: var(--surface-2); color: var(--ink); border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; padding: 4px 2px; }
.day.blank { background: none; }
.day.today b { color: var(--green); }
.day.today.sel b { color: #fff; }
.day.today { box-shadow: inset 0 0 0 1.5px var(--green); }
.day.sel { background: var(--green); color: #fff; }
.day.sel.today { box-shadow: none; }
.day.past:not(.sel) { opacity: .5; }
.day b { font-weight: 600; line-height: 1; }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 100%; min-height: 8px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--green)); display: block; }
.dots i.ext { background: none; border: 1.5px solid var(--faint); }
.day.sel .dots i.ext { border-color: rgba(255,255,255,.75); }
.dots em { font-style: normal; font-size: 8.5px; line-height: 6px; }
.day-panel { padding-bottom: 6px; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.day-head h2 { font-size: 18px; font-weight: 700; text-transform: capitalize; letter-spacing: -.2px; }
.day-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.group-day { margin-bottom: 22px; }
.group-day h3 { font-size: 13.5px; font-weight: 700; text-transform: capitalize; margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.group-day h3.is-today { color: var(--green); }
.fab {
  position: absolute; right: calc(20px + var(--safe-r)); bottom: 20px;
  width: 58px; height: 58px; border-radius: 50%; background: var(--green); color: #fff; border: 0;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-float); z-index: 5;
}
.fab:active { transform: scale(.94); }
#netbar { position: fixed; top: var(--safe-t); left: 0; right: 0; height: 2.5px; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .2s; }
#netbar.on { opacity: 1; }
#netbar i { display: block; height: 100%; width: 40%; background: var(--green); border-radius: 3px; animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

.busy-box { margin: -4px 0 18px; }
.busy-list { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 6px; }
.busy-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.busy-time { font-weight: 600; flex: none; }
.busy-name { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-end-wrap { display: flex; align-items: center; gap: 8px; }
.inline-end { display: flex; align-items: center; gap: 8px; flex: 1; }
.inline-end .sep { color: var(--muted); font-size: 13px; }

/* ---------- Clientes ---------- */
.client-list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.client-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; color: var(--ink); }
.client-row:first-child { border-top: 0; }
.client-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.client-row-name { font-size: 15.5px; font-weight: 600; }
.client-row-sub { font-size: 12.5px; color: var(--muted); }
.client-row > svg { color: var(--faint); flex: none; }

.rule-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 12px; margin-bottom: 10px; }
.rule-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rule-body .field-cell { padding: 0; }
.weekday-chips { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.wd-chip { flex: 1; min-width: 38px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); border-radius: 9px; padding: 8px 0; font-size: 12.5px; font-weight: 600; }
.wd-chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.color-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; background: var(--c); display: flex; align-items: center; justify-content: center; color: #fff; }
.color-swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.color-swatch.none { background: var(--surface-2); border: 1.5px dashed var(--line-strong); color: var(--faint); }
.move-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.move-row small { color: var(--muted); }
.link-box { display: flex; flex-direction: column; gap: 10px; }
.link-value { font-size: 12.5px; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--muted); }
.link-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Relatórios ---------- */
.report-menu { display: flex; flex-direction: column; gap: 10px; }
.report-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 15px; text-align: left; color: var(--ink); }
.report-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--pale); color: var(--green); display: flex; align-items: center; justify-content: center; flex: none; }
.report-text { flex: 1; min-width: 0; }
.report-text strong { font-size: 15.5px; }
.report-text p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.report-card > svg { color: var(--faint); flex: none; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 14px; }
.summary-grid.five { grid-template-columns: repeat(5, 1fr); }
.summary-box { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 10px; text-align: center; }
.summary-box.sm { padding: 9px 4px; }
.summary-box span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; line-height: 1.25; }
.summary-box strong { font-size: 21px; color: var(--green); font-weight: 700; }
.summary-box.sm strong { font-size: 16px; }
.msg-slot:empty { display: none; }

.access-row { width: 100%; display: block; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; margin-bottom: 10px; position: relative; }
.access-row-top { display: flex; align-items: center; gap: 8px; }
.access-row-top strong { font-size: 15.5px; flex: 1; }
.access-row > svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.access-row .hint { margin-top: 3px; }

.timeline { display: flex; flex-direction: column; }
.event-card.danger { border-left-color: var(--red); }
.event-card.muted { border-left-color: var(--faint); }
.event-card .card-top { align-items: flex-start; }
.event-card time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.audit-line { margin: 8px 0 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.mini-grid { margin-top: 11px; background: var(--surface-2); border-radius: 10px; padding: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
.mini-grid .wide { grid-column: 1 / -1; }
.mini-label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 2px; }
.mini-value { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.changes-box { margin-top: 11px; border-top: 1px solid var(--line); padding-top: 9px; font-size: 12.5px; }
.changes-box > strong { display: block; margin-bottom: 6px; font-size: 12px; }
.change-row { display: grid; grid-template-columns: 100px 1fr; gap: 8px; padding: 5px 0; }
.change-row b { color: var(--green); font-weight: 600; }

.month-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 14px; margin-bottom: 12px; }
.month-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.month-card-top strong { font-size: 15.5px; }
.booking-mini { border-top: 1px solid var(--line); padding: 10px 0; }
.month-card .booking-mini:first-of-type { border-top: 0; padding-top: 2px; }
.booking-mini-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.booking-mini-top strong { font-size: 13.5px; }
.booking-mini p { font-size: 13px; margin-top: 3px; }

/* ---------- diálogos e avisos ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 11, 0); display: flex; align-items: flex-end; justify-content: center; z-index: 50; opacity: 0; transition: opacity .2s, background .2s; padding: 16px; padding-bottom: calc(16px + var(--safe-b)); }
.overlay.show { opacity: 1; background: rgba(10, 16, 11, .45); }
@media (min-width: 640px) { .overlay { align-items: center; } }
.dialog { background: var(--surface); border-radius: 18px; padding: 22px 20px; width: 100%; max-width: 400px; transform: translateY(16px) scale(.98); transition: transform .22s cubic-bezier(.32,.72,0,1); box-shadow: var(--shadow-float); }
.overlay.show .dialog { transform: translateY(0) scale(1); }
.dialog h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.dialog p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.dialog-input { width: 100%; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 10px; padding: 12px 13px; font-size: 16px; margin-top: 12px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.dialog-actions .btn { flex: 1; }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(14px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 70; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--paper); font-size: 13.5px; font-weight: 500; padding: 11px 18px; border-radius: 99px; box-shadow: var(--shadow-float); opacity: 0; transform: translateY(10px); transition: opacity .22s, transform .22s; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); color: #fff; }
.toast.ok { background: var(--green-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); } }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 30; background: radial-gradient(120% 90% at 15% -10%, #2f4f3d 0%, var(--green-deep) 55%, #0f1a12 100%); display: flex; flex-direction: column; padding: calc(38px + var(--safe-t)) 26px calc(26px + var(--safe-b)); overflow-y: auto; }
.login-top { text-align: center; margin: 8px 0 26px; flex: none; }
.login-logo { width: min(230px, 62vw); height: auto; display: block; margin: 0 auto; }
.login-sub { color: rgba(238, 242, 235, .68); font-size: 13px; letter-spacing: .2px; margin-top: 10px; }
.login-card { background: var(--surface); border-radius: 22px; padding: 26px 22px 22px; box-shadow: var(--shadow-float); flex: none; }
.login-form h2 { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.login-form .lead { color: var(--muted); font-size: 13.5px; margin: 6px 0 20px; line-height: 1.5; }
.l-field { display: block; margin-bottom: 14px; }
.l-field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.l-field input { width: 100%; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 11px; padding: 13px 14px; font-size: 16px; }
.l-field .input-wrap { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 11px; padding: 2px 6px 2px 14px; }
.l-field .input-wrap input { border: 0; background: none; padding: 11px 0; }
.code-input { width: 100%; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 11px; padding: 15px 14px; font-size: 26px; letter-spacing: 8px; text-align: center; font-weight: 700; margin-bottom: 14px; }
.login-foot { text-align: center; flex: none; margin-top: 20px; }
.muted-on-dark { color: rgba(238, 242, 235, .55); font-size: 12px; margin-top: 10px; }
.install-hint { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #eef2eb; border-radius: 13px; padding: 12px 14px; font-size: 12.5px; text-align: left; line-height: 1.45; }
.install-hint svg { flex: none; color: #cfe3d5; }
.install-hint b { font-weight: 700; }

@media (min-width: 560px) { .login-card, .page, .scroll, .page-body { max-width: 560px; margin-left: auto; margin-right: auto; } .scroll, .page-body { width: 100%; } }
