/* TarkovBook — tema escuro com acento cáqui, inspirado na UI do jogo. */

:root {
  --bg: #14161a;
  --bg-2: #191c21;
  --bg-3: #1f232a;
  --panel: #16191e;
  --line: #2a2f38;
  --line-soft: #23272f;
  --text: #d6d9de;
  --text-dim: #8d949f;
  --text-mute: #666d78;
  --accent: #9a8866;
  --accent-hi: #c4ab7a;
  --ok: #7ba05b;
  --ok-dim: #4d6b3a;
  --danger: #b4564e;
  --kappa: #b08d57;
  --radius: 6px;
  --side-w: 340px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* O `display` do user-agent para [hidden] perde para qualquer regra de autor —
   e várias abaixo definem display. Sem isto, esconder pelo atributo não
   funciona (campo de confirmar senha, filtros, telas de login/app). */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Segoe UI", Roboto, system-ui, sans-serif;
  overflow: hidden;
}

a { color: var(--accent-hi); }

kbd {
  font: 11px/1 ui-monospace, Consolas, monospace;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 2px 5px;
  color: var(--text-dim);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2e343d; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3b434e; }

.fatal { padding: 40px; font-size: 16px; }
.muted { color: var(--text-mute); font-weight: 400; }
.hint { color: var(--text-mute); font-size: 12.5px; }
.ok { color: var(--ok); }

/* ───────────────────────── Login ───────────────────────── */

.auth {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1000px 600px at 50% -10%, #23282f 0%, transparent 70%),
    var(--bg);
  z-index: 50;
  padding: 20px;
  overflow: auto;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.auth-logo, .brand, .welcome h2 {
  font-family: "Bahnschrift", "Segoe UI Semibold", sans-serif;
  letter-spacing: .5px;
}

.auth-logo {
  margin: 0;
  font-size: 30px;
  text-align: center;
  color: var(--text);
}
.auth-logo span, .brand span, .welcome h2 span { color: var(--accent); }

.auth-sub {
  margin: 6px 0 22px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-3);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.auth-tab {
  background: none;
  border: 0;
  color: var(--text-dim);
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.auth-tab.is-active { background: var(--bg); color: var(--text); }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-mute);
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  padding: 8px 14px;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #16181c;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hi); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-block { width: 100%; padding: 10px; margin-top: 4px; }

.auth-error {
  background: rgba(180, 86, 78, .12);
  border: 1px solid rgba(180, 86, 78, .4);
  color: #e2938c;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 12.5px;
  margin: 0 0 12px;
}

.auth-users { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.auth-users-label { font-size: 12px; color: var(--text-mute); width: 100%; }
.auth-user {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.auth-user:hover { border-color: var(--accent); color: var(--text); }

.auth-note {
  margin: 20px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-mute);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

/* ───────────────────────── Layout ───────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100%;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}

.brand { font-size: 19px; margin-right: auto; }

.sync {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  cursor: default;
  transition: color .2s, background .2s;
}
.sync-pending { color: var(--text-mute); }
.sync-saving { color: var(--accent); }
.sync-saved { color: var(--ok); }
.sync-error { color: #fff; background: var(--danger); font-weight: 700; }

.account {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account:hover { border-color: var(--accent); color: var(--text); }

.progress-mini { padding: 0 16px 12px; }
.progress-mini-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-mute);
  margin-bottom: 5px;
}
.progress-mini-top strong { color: var(--accent-hi); }

.bar {
  height: 5px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.bar-lg { height: 10px; margin-bottom: 18px; }
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ok-dim), var(--ok));
  transition: width .25s ease;
}

.modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 0 16px 12px;
  background: var(--bg-3);
  padding: 4px;
  border-radius: var(--radius);
}
.mode {
  background: none;
  border: 0;
  color: var(--text-dim);
  padding: 7px 2px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  white-space: nowrap;
}
.mode:hover { color: var(--text); }
.mode.is-active { background: var(--bg); color: var(--accent-hi); }

.search-wrap { position: relative; padding: 0 16px 10px; }
.search-wrap input {
  width: 100%;
  padding: 9px 58px 9px 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
}
.search-wrap input:focus { outline: none; border-color: var(--accent); }
.search-wrap kbd {
  position: absolute;
  right: 24px;
  top: 8px;
  pointer-events: none;
}
.search-wrap input:focus + kbd { display: none; }

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 16px 10px;
}
.filters select {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: var(--radius);
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  min-width: 0;
}
.filters select:focus { outline: none; border-color: var(--accent); }

.list-count {
  padding: 6px 16px;
  font-size: 11.5px;
  color: var(--text-mute);
  border-top: 1px solid var(--line-soft);
}

.list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 20px;
  min-height: 0;
}
.list:focus { outline: none; }

.list-empty, .list-more {
  padding: 20px 12px;
  color: var(--text-mute);
  font-size: 12.5px;
  text-align: center;
}

.row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  color: inherit;
  font: inherit;
  padding: 7px 9px;
  border-radius: 4px;
  cursor: pointer;
}
.row:hover { background: var(--bg-3); }
.row.is-active {
  background: var(--bg-3);
  border-left-color: var(--accent);
}

.row-check {
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
}
.row-check:hover { border-color: var(--ok); }
.row.is-done .row-check {
  background: var(--ok-dim);
  border-color: var(--ok);
  position: relative;
}
.row.is-done .row-check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #e8f0e0;
}

.row-body { min-width: 0; flex: 1; }
.row-title, .row-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title { font-size: 13px; }
.row-sub { font-size: 11px; color: var(--text-mute); }
.row.is-done .row-title { color: var(--text-mute); text-decoration: line-through; }

.row-kappa { flex: none; color: var(--kappa); font-size: 13px; }
.row-map .row-title { font-size: 13.5px; }

/* ───────────────────────── Abas ───────────────────────── */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.tabbar {
  display: flex;
  align-items: stretch;
  gap: 1px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  min-height: 37px;
  flex: none;
}
.tabbar::-webkit-scrollbar { height: 4px; }

.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 11px;
  background: var(--bg-2);
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-top: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  max-width: 220px;
  flex: none;
  font-size: 12.5px;
}
.tab:hover { background: var(--bg-3); color: var(--text); }
.tab.is-active {
  background: var(--bg);
  border-top-color: var(--accent);
  color: var(--text);
}

.tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  flex: none;
}
.tab-quest .tab-dot { background: var(--accent); }
.tab-map .tab-dot { background: #5f8fa8; }
.tab-stats .tab-dot { background: var(--ok); }

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-label.is-done { text-decoration: line-through; opacity: .65; }

.tab-close {
  background: none;
  border: 0;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  flex: none;
}
.tab-close:hover { background: var(--danger); color: #fff; }

.tab-closeall {
  background: none;
  border: 0;
  color: var(--text-mute);
  font: inherit;
  font-size: 11.5px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
.tab-closeall:hover { color: var(--text); }

/* ───────────────────────── Conteúdo ───────────────────────── */

.content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.welcome {
  max-width: 620px;
  margin: 12vh auto 0;
  padding: 0 30px;
  color: var(--text-dim);
}
.welcome h2 { font-size: 40px; margin: 0 0 6px; color: var(--text); }
.welcome ul { padding-left: 18px; line-height: 1.9; }
.welcome p { line-height: 1.7; }

.doc {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px 30px 80px;
}

.doc-banner {
  margin: -22px -30px 20px;
  height: 150px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.doc-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: .55;
}

.doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.doc-head h2 {
  margin: 0 0 9px;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.25;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-decoration: none;
}
a.chip:hover { border-color: var(--accent); color: var(--text); }
.chip-kappa { color: var(--kappa); border-color: rgba(176, 141, 87, .4); }
.chip-money { color: var(--ok); border-color: rgba(123, 160, 91, .4); }

.btn-done { flex: none; white-space: nowrap; }
.btn-done.is-done {
  background: var(--ok-dim);
  border-color: var(--ok);
  color: #e8f0e0;
}

.block {
  margin-bottom: 24px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
.block h3 {
  margin: 0 0 11px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--accent);
  font-weight: 600;
}
.block .lead { margin: 0; color: var(--text-dim); line-height: 1.7; }

.objectives, .rewards, .reqs {
  margin: 0;
  padding-left: 20px;
  line-height: 1.75;
}
.objectives li, .rewards li, .reqs li { margin-bottom: 4px; }
.objectives { list-style: none; padding-left: 4px; }
.objectives > li { position: relative; padding-left: 20px; }
.objectives > li::before {
  content: "▸";
  position: absolute;
  left: 4px;
  color: var(--accent);
}
.objectives ul.sub, .rewards ul.sub, .reqs ul.sub {
  list-style: none;
  padding-left: 20px;
  margin: 3px 0;
  font-size: 12.5px;
  color: var(--text-mute);
  border-left: 1px solid var(--line);
}
.rewards { list-style: none; padding-left: 4px; }
.rewards > li { position: relative; padding-left: 20px; }
.rewards > li::before {
  content: "+";
  position: absolute;
  left: 6px;
  color: var(--ok);
  font-weight: 700;
}

.wlink { color: var(--accent-hi); text-decoration: none; border-bottom: 1px dotted rgba(196, 171, 122, .45); }
.wlink:hover { border-bottom-style: solid; }
.wlink-quest { color: #8fb8d0; border-bottom-color: rgba(143, 184, 208, .45); }

.chain { display: flex; flex-direction: column; gap: 9px; }
.chain-row { display: flex; align-items: baseline; gap: 12px; }
.chain-label {
  flex: none;
  width: 90px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-mute);
}
.chain-row > div { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-link {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
  color: #8fb8d0;
  text-decoration: none;
}
.chip-link:hover { border-color: var(--accent); }
.chip-link.is-done { color: var(--ok); text-decoration: line-through; opacity: .75; }

.block-fold { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-bottom: 22px; }
.block-fold summary {
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--accent);
  font-weight: 600;
}
.fold-body {
  margin-top: 12px;
  color: var(--text-dim);
  line-height: 1.75;
  font-size: 13.5px;
}

.doc-foot {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  font-size: 12.5px;
}

/* ───────────────────────── Mapas ───────────────────────── */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.plan { margin: 0; }
.plan img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  display: block;
}
.plan img:hover { border-color: var(--accent); }
.plan figcaption {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 5px;
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 6px;
}
.quest-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 7px 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.quest-card:hover { border-color: var(--accent); background: var(--bg-3); }
.quest-card-title, .quest-card-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quest-card-title { font-size: 12.5px; }
.quest-card-sub { font-size: 10.5px; color: var(--text-mute); }
.quest-card.is-done { opacity: .6; }
.quest-card.is-done .quest-card-title { text-decoration: line-through; color: var(--ok); }

/* ───────────────────────── Itens ───────────────────────── */

.items-search { margin-bottom: 16px; }
.items-search input {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.items-search input:focus { outline: none; border-color: var(--accent); }

.res-count { margin: 0 0 12px; }

.res {
  border: 1px solid var(--line-soft);
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 9px;
}
.res-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.res-title { min-width: 0; flex: 1; }
.res-title > a, .res-title { font-size: 14.5px; color: var(--text); text-decoration: none; }
.res-title > a:hover { color: var(--accent-hi); }
.res-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }

.use {
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid;
}
.use-quest { color: #8fb8d0; border-color: rgba(143, 184, 208, .4); background: rgba(143, 184, 208, .09); }
.use-hideout { color: var(--accent-hi); border-color: rgba(196, 171, 122, .4); background: rgba(196, 171, 122, .09); }

.res-sec { display: flex; gap: 11px; align-items: baseline; margin-top: 7px; }
.res-label {
  flex: none;
  width: 62px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-mute);
}
.res-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }

.subtabs {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-3);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.subtab {
  background: none;
  border: 0;
  color: var(--text-dim);
  padding: 7px 15px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
}
.subtab:hover { color: var(--text); }
.subtab.is-active { background: var(--bg); color: var(--accent-hi); }

.fir-toggle {
  margin-left: auto;
  margin-right: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.fir {
  flex: none;
  background: rgba(180, 86, 78, .15);
  border: 1px solid rgba(180, 86, 78, .45);
  color: #d99a94;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .5px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.item-row:last-child { border-bottom: 0; }

.item-qty {
  flex: none;
  min-width: 46px;
  text-align: right;
  font-weight: 600;
  color: var(--accent-hi);
  font-size: 13.5px;
}
.item-icon {
  flex: none;
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}
.item-main { min-width: 0; flex: 1; }
.item-name {
  display: block;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.item-name:hover { color: var(--accent-hi); }
.item-src {
  display: block;
  font-size: 11px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qlink { color: #8fb8d0; text-decoration: none; }
.qlink:hover { text-decoration: underline; }

/* ── Hideout por estação ── */

.station {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-2);
}
.station summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  cursor: pointer;
  list-style: none;
}
.station summary::-webkit-details-marker { display: none; }
.station summary::before {
  content: "▸";
  color: var(--accent);
  flex: none;
  transition: transform .15s;
}
.station[open] summary::before { transform: rotate(90deg); }
.station-icon { width: 30px; height: 30px; object-fit: contain; flex: none; }
.station-name { font-size: 13.5px; flex: 1; }
.station-meta { font-size: 11px; color: var(--text-mute); }
.station-note { margin: 0 13px 8px; }

.lvl {
  border-top: 1px solid var(--line-soft);
  padding: 11px 13px;
}
.lvl-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.lvl-badge {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--accent-hi);
}
.lvl-time, .lvl-money { font-size: 11px; color: var(--text-mute); }
.lvl-money { color: var(--ok); }

.lvl-items { margin: 0; padding-left: 18px; }
.lvl-items li { font-size: 12.5px; margin-bottom: 3px; line-height: 1.6; }
.lvl-items a { color: var(--text); text-decoration: none; }
.lvl-items a:hover { color: var(--accent-hi); }
.lvl-items strong { color: var(--accent-hi); }

.lvl-req {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-mute);
  border-left: 2px solid var(--line);
  padding-left: 9px;
}

/* ───────────────────────── Estatísticas ───────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.stat {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-value {
  display: block;
  font-size: 26px;
  font-weight: 600;
  color: var(--accent-hi);
  line-height: 1.15;
}
.stat-label { display: block; font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.stat-sub { display: block; font-size: 11px; color: var(--text-mute); }

.grow {
  display: grid;
  grid-template-columns: 130px 1fr 62px;
  align-items: center;
  gap: 11px;
  margin-bottom: 7px;
}
.grow-key { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow-num { font-size: 11.5px; color: var(--text-mute); text-align: right; }

/* ───────────────────────── Imagem ampliada ───────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 9, 11, .93);
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 46px 24px 24px;
  gap: 14px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  cursor: default;
}
.lightbox-cap {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  max-width: 800px;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 21px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
}
.lightbox-close:hover { background: var(--danger); border-color: var(--danger); }

/* Grade de imagens de localização: um pouco maiores que as plantas do mapa. */
.plans-loc { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.plans-loc img { aspect-ratio: 16 / 10; cursor: zoom-in; }

/* ───────────────────────── Aviso temporário ───────────────────────── */

.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 70;
  max-width: 340px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius);
  padding: 11px 15px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5);
  animation: toast-in .22s ease;
}
.toast-error { border-left-color: var(--danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* ───────────────────────── Menu do perfil ───────────────────────── */

.account-menu {
  position: fixed;
  top: 46px;
  left: 16px;
  width: 250px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  padding: 6px;
  z-index: 60;
}
.account-menu-head {
  font-size: 11.5px;
  color: var(--text-mute);
  padding: 7px 10px 9px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 5px;
}
.account-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.account-item:hover { background: var(--bg-3); color: var(--text); }
.account-item.danger:hover { background: rgba(180, 86, 78, .18); color: #e2938c; }

/* ───────────────────────── Telas estreitas ───────────────────────── */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 45% 55%; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .doc { padding: 18px 16px 60px; }
  .doc-banner { margin: -18px -16px 16px; height: 110px; }
  .doc-head { flex-direction: column; }
  .grow { grid-template-columns: 95px 1fr 55px; }
}
