/* SLR RGP FIELD — identidade Smart Lithium Resources */
:root {
  --charcoal: #231F1E; --sage: #66987D; --sage-d: #3F6B55; --sage-l: #9DBDAE; --amber: #C9A24B; --rose: #A65858;
  --smp: #3F6B55; --dup: #4D7EA8; --std: #C9A24B; --blk: #7D7570;
  --bg: #F6F5F2; --card: #fff; --line: #E4E1DC; --fg: #231F1E; --muted: #6E6762; --input: #fff;
  --r: 14px; --nav: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #1C1918; --card: #262221; --line: #3A3533; --fg: #EDEAE6; --muted: #A8A19B; --input: #2E2A29; --sage-d: #9DBDAE; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #1C1918; --card: #262221; --line: #3A3533; --fg: #EDEAE6; --muted: #A8A19B; --input: #2E2A29; --sage-d: #9DBDAE; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { scroll-padding-top: 120px; scroll-padding-bottom: 150px; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h2 { font-size: 20px; margin: 0; } h3 { font-size: 16px; margin: 0 0 12px; } h4 { margin: 14px 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); } .small, small { font-size: 12.5px; }
.err { color: var(--rose); } .warn { color: var(--amber); } .okc { color: var(--sage); }
.pre { white-space: pre-line; }
.pad { padding: 16px; } .pad-t { padding-top: 16px; } .center { text-align: center; }
.narrow { max-width: 900px; margin: 0 auto; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; margin-top: 14px; } .row.between { justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.upper { text-transform: uppercase; }

.boot { min-height: 100vh; display: grid; place-content: center; gap: 24px; justify-items: center; background: var(--charcoal); }
.boot img { width: min(320px, 70vw); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--sage-l); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* botões e campos */
.btn { appearance: none; border: 0; border-radius: 12px; min-height: 48px; padding: 0 18px; font: 600 15px system-ui, sans-serif; background: var(--sage-d); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
:root[data-theme="dark"] .btn:not(.ghost):not(.danger) { color: var(--charcoal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost):not(.danger) { color: var(--charcoal); } }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--line); }
.btn.danger { background: var(--rose); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.block { width: 100%; margin-top: 10px; }
.icon { background: none; border: 0; font-size: 20px; color: var(--fg); cursor: pointer; padding: 6px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); margin: 8px 0; }
input, select, textarea { font: 16px system-ui, sans-serif; color: var(--fg); background: var(--input); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; width: 100%; min-height: 48px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .refbtn:focus { outline: 2px solid var(--sage); outline-offset: 1px; }
select { width: auto; max-width: 100%; }
.search { margin-bottom: 10px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg); }
.switch input { width: 20px; height: 20px; min-height: 0; }
.lab { font-size: 13px; color: var(--muted); }
.req { color: var(--rose); font-style: normal; font-weight: 800; }
.field { display: grid; gap: 4px; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.ferr { color: var(--rose); font-size: 12.5px; }
.fgrid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .fgrid { grid-template-columns: 1fr 1fr 1fr; } }
.refbtn { text-align: left; background: var(--input); color: var(--fg); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 48px; display: grid; cursor: pointer; font: 16px system-ui, sans-serif; }
.refbtn b { font-size: 16px; } .refbtn small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.refbtn.empty { color: var(--muted); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); margin-right: 4px; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--card); color: var(--fg); border-radius: 10px; padding: 8px 12px; font: 600 14px system-ui; cursor: pointer; margin: 0; }
.chipbtn.on { border-color: var(--c, var(--sage)); background: color-mix(in srgb, var(--c, var(--sage)) 20%, var(--card)); }
.chipbtn input { width: 18px; height: 18px; min-height: 0; }
.badge { min-width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; padding: 0 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 10px 0; }
.card.ok { border-color: var(--sage); }
.list { display: grid; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: left; color: var(--fg); font: inherit; text-decoration: none; cursor: default; width: 100%; }
button.li, a.li, .li.rec { cursor: pointer; }
.li > div { display: grid; } .li small { color: var(--muted); }
.li.sel { border-color: var(--sage); background: color-mix(in srgb, var(--sage) 14%, var(--card)); }
.chev { font-size: 22px; color: var(--muted); }
.conf { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; color: var(--fg); font-size: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.conf input { width: 20px; height: 20px; min-height: 0; } .conf small { grid-column: 2; color: var(--muted); }
.kv { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }

/* login */
body.login-mode { background: var(--charcoal); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #231F1E, #2F3A34); }
.login-card { width: min(440px, 100%); }
.login .logo { width: 100%; max-width: 380px; display: block; margin: 0 auto; }
.brandline { text-align: center; color: var(--sage-l); letter-spacing: 6px; font-weight: 600; margin-top: 12px; }
.sub { text-align: center; color: #B9B3AD; font-size: 13px; }
.login .card { margin-top: 22px; border-radius: 18px; }
.foot { text-align: center; color: #8E8781; font-size: 12px; }

/* shell */
header.top { position: fixed; inset: 0 0 auto 0; height: 56px; background: var(--charcoal); color: #F5F3F0; display: flex; align-items: center; gap: 12px; padding: 0 12px; z-index: 20; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.toplogo { height: 22px; } .title { flex: 1; font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sage); color: #fff; border: 0; font-weight: 800; cursor: pointer; }
nav.side { display: none; }
main#view { padding-top: calc(56px + env(safe-area-inset-top)); padding-bottom: calc(var(--nav) + 80px); min-height: 100vh; }
nav.bottom { position: fixed; inset: auto 0 0 0; height: calc(var(--nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 20; }
nav.bottom a { display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11.5px; text-decoration: none; color: var(--muted); }
nav.bottom a .ic { font-size: 20px; } nav.bottom a.on { color: var(--sage-d); font-weight: 700; }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav) + 16px + env(safe-area-inset-bottom)); z-index: 21; background: var(--amber); color: var(--charcoal); border: 0; border-radius: 16px; min-height: 54px; padding: 0 20px; font: 700 15px system-ui; box-shadow: 0 6px 18px #0004; cursor: pointer; }
@media (min-width: 900px) {
  nav.side { display: block; position: fixed; top: 56px; bottom: 0; left: 0; width: 230px; background: var(--card); border-right: 1px solid var(--line); padding: 10px; overflow: auto; }
  nav.side a { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 10px; text-decoration: none; margin-bottom: 2px; }
  nav.side a.on { background: color-mix(in srgb, var(--sage) 22%, transparent); font-weight: 700; }
  nav.side .ic { width: 22px; text-align: center; }
  nav.bottom { display: none; } main#view { margin-left: 230px; padding-bottom: 90px; } .fab { bottom: 24px; }
}

/* painel */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 12px; padding: 12px 14px; display: grid; text-decoration: none; color: var(--fg); text-align: left; font: inherit; cursor: pointer; }
.tile b { font-size: 24px; } .tile span { font-size: 12.5px; color: var(--muted); } .tile.sel { background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.grid2 { display: grid; gap: 0 12px; } @media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.bar { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.bar i { height: 16px; border-radius: 4px; display: block; min-width: 2px; } .bar b { text-align: right; } .bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cols { display: flex; align-items: flex-end; gap: 4px; height: 170px; }
.col { flex: 1; display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; font-size: 10px; }
.col i { align-self: end; background: var(--sage); border-radius: 3px; display: block; }

/* editor */
.editor { padding-bottom: 70px; }
.ehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; flex-wrap: wrap; }
.status { display: flex; justify-content: space-between; width: 100%; border: 0; padding: 10px 16px; font: 700 14px system-ui; cursor: pointer; }
.status.bad { background: color-mix(in srgb, var(--rose) 16%, transparent); color: var(--rose); }
.status.ok { background: color-mix(in srgb, var(--sage) 16%, transparent); color: var(--sage-d); }
.status.val { background: color-mix(in srgb, var(--amber) 18%, transparent); color: #8a6a1f; }
.tabs { display: flex; overflow-x: auto; background: var(--charcoal); scrollbar-width: none; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 5; }
.tabs button { flex: none; background: none; border: 0; color: #CFC9C4; padding: 14px 16px; font: 600 14px system-ui; border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button.on { color: var(--sage-l); border-bottom-color: var(--amber); }
.savebar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav) + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; z-index: 19; }
.savebar .warn { color: var(--amber); font-weight: 600; } .savebar .okc { font-weight: 600; }
@media (min-width: 900px) { .savebar { left: 230px; bottom: 0; } }
body:has(.savebar) .fab { display: none !important; }

/* fotos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; background: #0002; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos figcaption { position: absolute; inset: auto 0 0 0; background: #0009; color: #fff; font-size: 11px; padding: 3px 6px; }
img.full { width: 100%; max-height: 65vh; object-fit: contain; border-radius: 10px; background: #000; }

/* mapa */
.mapwrap { position: relative; height: calc(100vh - 56px - var(--nav) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin-bottom: calc(-1 * (var(--nav) + 80px)); }
@media (min-width: 900px) { .mapwrap { height: calc(100vh - 56px); margin-bottom: -90px; } }
#map { position: absolute; inset: 0; background: var(--bg); }
.mapbar { position: absolute; top: 10px; left: 56px; right: 10px; z-index: 500; display: flex; gap: 8px; align-items: center; }
.mapbar select { min-height: 40px; padding: 6px 10px; box-shadow: 0 2px 8px #0003; }
.pill { margin-left: auto; background: var(--card); padding: 8px 12px; border-radius: 10px; font-weight: 700; box-shadow: 0 2px 8px #0003; }
.mapbtns { position: absolute; right: 12px; bottom: 96px; z-index: 500; display: grid; gap: 8px; }
.mapbtns button { width: 46px; height: 46px; border-radius: 12px; border: 0; background: var(--card); color: var(--fg); font-size: 20px; box-shadow: 0 2px 8px #0004; cursor: pointer; }
.legend { position: absolute; left: 10px; bottom: 24px; z-index: 500; background: var(--card); border-radius: 10px; padding: 8px 10px; font-size: 12px; display: grid; gap: 3px; box-shadow: 0 2px 8px #0003; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pin { display: grid; justify-items: center; }
.pin .lbl { background: #000a; color: #fff; font: 700 10px system-ui; padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.pin i { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px #0006; margin-top: 2px; display: block; }
.leaflet-container { font: inherit; }

/* modal e toast */
.modal-bg { position: fixed; inset: 0; background: #0008; z-index: 2000; display: grid; place-items: end center; }
@media (min-width: 700px) { .modal-bg { place-items: center; } }
.modal { background: var(--card); color: var(--fg); width: min(560px, 100%); max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.modal.wide { width: min(820px, 100%); }
@media (min-width: 700px) { .modal { border-radius: 18px; } }
.modal .scroll { max-height: 60vh; overflow: auto; }
.modal .list .li { padding: 10px 12px; } .modal .list .li b { display: block; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 90px); transform: translate(-50%, 20px); opacity: 0; background: var(--charcoal); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 2100; transition: .25s; max-width: 92vw; box-shadow: 0 6px 18px #0005; }
.toast.err { background: var(--rose); } .toast.show { opacity: 1; transform: translate(-50%, 0); }
.kv b { white-space: nowrap; padding-left: 8px; }
.ptab { border-collapse: collapse; margin-top: 6px; font-size: 12px; } .ptab th { text-align: left; padding: 2px 8px 2px 0; color: #666; font-weight: 600; vertical-align: top; } .ptab td { padding: 2px 0; }
.swatch { width: 34px; height: 34px; min-height: 0; padding: 2px; border-radius: 8px; flex: none; }
.legend span { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
