:root {
  --bg: #f2f5f4; --surface: #fff; --surface-2: #f7faf9; --border: #e2e8e5; --border-strong: #d0dad6;
  --text: #10201b; --muted: #677770; --faint: #97a49e;
  --brand: #0e7a61; --brand-600: #0a654f; --brand-50: #e7f5ef; --accent: #19b38a;
  --side: #0b1d18; --side-2: #132d27; --side-text: #a3b8b1;
  --red: #d63d35; --red-bg: #fdecea; --amber: #a86b0c; --amber-bg: #fdf3dc; --blue: #2c69c3; --blue-bg: #e9f1fc;
  --green: #13805a; --green-bg: #e2f5eb; --gray-bg: #edf1ef; --violet: #7650d0; --violet-bg: #f0ebfd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 27, .04), 0 6px 20px rgba(16, 32, 27, .04);
  --shadow-lg: 0 24px 60px rgba(8, 24, 19, .24);
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased }
a { color: inherit; text-decoration: none }
h1, h2, h3, p { margin: 0 }
h1, h2, h3 { letter-spacing: -.015em }
h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px }
[hidden] { display: none !important }
.ic { flex: none; display: block }
.muted { color: var(--muted) }
.grow { flex: 1 }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px; z-index: 1000 }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; color: #fff }
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: linear-gradient(135deg, #22c495, #0e7a61); box-shadow: 0 6px 18px rgba(25, 179, 138, .35); flex: none }
.brand b { display: block; font-size: 15px }
.brand small { display: block; color: #7a948b; font-size: 11px }
#nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px }
.nav-group small { display: block; text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 700; color: #58756b; padding: 0 12px 6px }
#nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0; border-radius: 9px; color: var(--side-text); font-weight: 500; transition: background .15s, color .15s }
#nav a:hover { background: var(--side-2); color: #fff }
#nav a.active { background: linear-gradient(90deg, rgba(34, 196, 149, .2), rgba(34, 196, 149, .04)); color: #fff; box-shadow: inset 3px 0 0 var(--accent) }
#nav a.active .ic { color: #43d8ac }
.status-card { display: flex; gap: 11px; align-items: center; margin-top: 14px; padding: 12px 13px; border-radius: 12px; background: var(--side-2); border: 1px solid rgba(255, 255, 255, .06) }
.status-card small { display: block; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #7a948b }
.status-card b { color: #e7f4ef; font-size: 13px; font-weight: 600 }
.live { width: 9px; height: 9px; border-radius: 50%; background: #43d8ac; flex: none; animation: pulse 2s infinite }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(67, 216, 172, .55) } 70% { box-shadow: 0 0 0 9px rgba(67, 216, 172, 0) } 100% { box-shadow: 0 0 0 0 rgba(67, 216, 172, 0) } }

/* ---------- Layout ---------- */
main { margin-left: 248px; padding: 26px 32px 40px; min-height: 100vh; min-width: 0 }
.topbar > div:first-child { min-width: 0 }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap }
.topbar h1 { font-size: 26px; font-weight: 750 }
.subtitle { margin-top: 4px; color: var(--muted); font-size: 13px }
.head-actions, #headActions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px }
.span2 { grid-column: span 2 }
.span4 { grid-column: 1 / -1 }
.twocol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px }
.loading { height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: load 1s linear infinite }
@keyframes load { from { background-position: -40% 0 } to { background-position: 140% 0 } }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; background: var(--brand); color: #fff; padding: 9px 14px; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s }
.btn:hover { background: var(--brand-600) }
.btn:disabled { opacity: .5; cursor: not-allowed }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong) }
.btn-ghost:hover { background: var(--surface-2); border-color: #b9c6c0 }
.btn-danger { background: transparent; color: var(--red); border-color: #f0c6c3 }
.btn-danger:hover { background: var(--red-bg) }
.btn-xs { padding: 5px 9px; font-size: 12px; border-radius: 8px }
.btn:focus-visible, .chip:focus-visible, #nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.icon-btn { border: 0; background: var(--gray-bg); color: var(--muted); width: 32px; height: 32px; border-radius: 9px; font-size: 20px; line-height: 1; cursor: pointer; flex: none }
.icon-btn:hover { background: #e2e8e5; color: var(--text) }
.link { color: var(--brand); font-weight: 600; font-size: 13px }
.link:hover { text-decoration: underline }
input, select, textarea { width: 100%; font: inherit; color: inherit; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25, 179, 138, .18) }
textarea { min-height: 84px; resize: vertical }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); margin: 0 }
.select { width: auto; min-width: 180px }
label { display: block; font-size: 12px; font-weight: 600; color: #3b4a44 }
label > input, label > select, label > textarea, label > .inline { margin-top: 5px }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 12px }
.form-grid .span2 { grid-column: 1 / -1 }
.inline { display: flex; gap: 8px }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 13px; margin: 8px 0 }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: min(200px, 100%); max-width: 380px }
.search .ic { position: absolute; left: 11px; color: var(--faint); pointer-events: none }
.search input { padding-left: 34px }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0 }
.card-flush { padding: 0; overflow: hidden }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px }
.card-flush > .card-head { padding: 16px 18px 0 }
.kpi { display: flex; gap: 14px; align-items: flex-start }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); flex: none }
.kpi small { display: block; color: var(--muted); font-weight: 600; font-size: 12px }
.kpi b { display: block; font-size: 30px; line-height: 1.1; font-weight: 750; margin: 4px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
.kpi span { color: var(--faint); font-size: 12px }
.tone-teal { --tone: var(--brand); --tone-bg: var(--brand-50) }
.tone-red { --tone: var(--red); --tone-bg: var(--red-bg) }
.tone-blue { --tone: var(--blue); --tone-bg: var(--blue-bg) }
.tone-amber { --tone: var(--amber); --tone-bg: var(--amber-bg) }
.tone-violet { --tone: var(--violet); --tone-bg: var(--violet-bg) }
.ai-card { background: radial-gradient(120% 140% at 100% 0%, #1d5c4c 0%, #0f2d26 55%, #0b1d18 100%); color: #fff; border-color: #0f2d26 }
.ai-card p { color: #b7cdc5; line-height: 1.55; margin: 6px 0 16px }
.ai-card .link { color: #6fe3bf }
.ai-card .muted { color: #b7cdc5 }
.flow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center }
.flow span { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 500 }
.flow i { color: #6fe3bf; font-style: normal }
.code { background: #0b1d18; color: #c9e9dd; border-radius: 10px; padding: 12px 14px; font: 12px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; overflow-x: auto; margin: 12px 0 0 }

/* ---------- Badges & tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap }
.badge::first-letter { text-transform: uppercase }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none }
.green { background: var(--green-bg); color: var(--green) }
.red { background: var(--red-bg); color: var(--red) }
.yellow { background: var(--amber-bg); color: var(--amber) }
.blue { background: var(--blue-bg); color: var(--blue) }
.gray { background: var(--gray-bg); color: var(--muted) }
.type-tag { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap }
.type-tag i, .dot, .chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent) }
.geo-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 600 }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); font-weight: 700; font-size: 12px; flex: none }
.row-link { display: flex; align-items: center; gap: 10px }

/* ---------- Tables & lists ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap }
.table-wrap { overflow-x: auto }
.table { width: 100%; border-collapse: collapse; font-size: 13px }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; background: var(--surface-2); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap }
.table td { padding: 11px 16px; border-bottom: 1px solid #edf1ef; vertical-align: middle }
.table tr:last-child td { border-bottom: 0 }
.table td small { display: block; color: var(--muted); margin-top: 1px; font-size: 12px }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
.table tbody tr { transition: background .1s }
.table tbody tr:hover { background: #f7faf9 }
.table tr.clickable { cursor: pointer }
.list-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid #edf1ef; padding: 11px 2px; font: inherit; color: inherit; cursor: pointer }
.list-item:first-of-type { border-top: 0 }
.list-item:hover b { color: var(--brand) }
.list-item > div { flex: 1; min-width: 0 }
.list-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.list-item small { color: var(--muted) }
.prio { width: 8px; height: 34px; border-radius: 4px; background: var(--blue); flex: none; opacity: .7 }
.prio.urgente { background: var(--red); opacity: 1 }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--faint); padding: 34px 16px }
.empty p { color: var(--muted) }
.progress { height: 6px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; min-width: 110px }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--brand)); border-radius: 6px }
.bars { display: flex; flex-direction: column }
.bar-row { display: grid; grid-template-columns: minmax(130px, 180px) 1fr 34px 76px; gap: 12px; align-items: center; padding: 7px 0; font-size: 13px }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums }
.bar-row small { color: var(--faint); text-align: right; white-space: nowrap }
.bar { height: 8px; background: var(--gray-bg); border-radius: 8px; overflow: hidden }
.bar span { display: block; height: 100%; background: var(--c); border-radius: 8px }
.notice { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); color: #7a5412; font-size: 12.5px; border: 1px solid #f1dfae; line-height: 1.45 }
.notice .ic { margin-top: 1px }
.notice.green { background: var(--green-bg); color: var(--green); border-color: #bfe6d2 }
.notice.red { background: var(--red-bg); color: var(--red); border-color: #f3c7c3 }

/* ---------- Detail ---------- */
.detail-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap }
.detail-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); flex: none }
.detail-main { flex: 1; min-width: 240px }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.detail-title h2 { font-size: 20px }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--muted); font-size: 13px }
.meta > span { display: inline-flex; align-items: center; gap: 6px }
.actions { display: flex; gap: 8px; flex-wrap: wrap }
.tabs { display: flex; gap: 2px; margin: 18px 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; gap: 7px; align-items: center; white-space: nowrap; margin-bottom: -1px }
.tabs button:hover { color: var(--text) }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand) }
.tabs em { font-style: normal; font-size: 11px; background: var(--gray-bg); color: var(--muted); border-radius: 999px; padding: 1px 7px }
.tabs em:empty { display: none }
.tab-actions { display: flex; justify-content: flex-end; margin-bottom: 12px }
.kv { display: grid; grid-template-columns: 130px 1fr; margin: 10px 0 0 }
.kv dt, .kv dd { margin: 0; padding: 9px 0; border-top: 1px solid #edf1ef }
.kv dt { color: var(--muted); font-size: 13px }
.kv dd { font-weight: 500; overflow-wrap: anywhere }
.timeline { position: relative; padding-left: 22px }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border) }
.event { position: relative; padding: 0 0 18px }
.event:last-child { padding-bottom: 0 }
.event::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand) }
.event-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.event small { color: var(--muted) }
.event p { margin-top: 4px; color: #3b4a44 }

/* ---------- Ticket ---------- */
.ticket-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px }
.stepper { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 18px 0 }
.step { display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; color: var(--faint) }
.step i { height: 6px; border-radius: 6px; background: var(--gray-bg) }
.step b { font-weight: 600; line-height: 1.2 }
.step small { font-size: 10.5px; display: block }
.step.done { color: var(--muted) }
.step.done i { background: var(--accent) }
.step.current { color: var(--text) }
.step.current i { background: var(--brand); box-shadow: 0 0 0 3px rgba(25, 179, 138, .2) }
.step-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px }

/* ---------- Modal ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow-lg); color: var(--text) }
dialog.wide { width: min(780px, calc(100vw - 32px)) }
dialog::backdrop { background: rgba(8, 24, 19, .45); backdrop-filter: blur(3px) }
dialog[open] { animation: pop .18s ease-out }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985) } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1001 }
.modal-head h2 { font-size: 17px }
.modal-body { padding: 18px 20px 20px }
.modal-body > p { margin-bottom: 12px }
.modal-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; font-weight: 500 }
.option:has(input:checked) { border-color: var(--accent); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(25, 179, 138, .12) }
.option input { margin-top: 2px }
.option b { display: block; font-size: 13.5px; color: var(--text) }
.option small { color: var(--muted); font-weight: 400 }
.preview { margin-top: 14px }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px }
.stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px }
.stats b { display: block; font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums }
.stats small { color: var(--muted) }
.preview details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-top: 8px }
.preview summary { cursor: pointer; font-weight: 600; font-size: 13px }
.preview ul { margin: 8px 0 4px; padding-left: 18px; max-height: 180px; overflow-y: auto; font-size: 12.5px; color: #3b4a44 }
.dropzone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); color: var(--muted); font: inherit; cursor: pointer }
.dropzone:hover { border-color: var(--accent); color: var(--brand) }
.coords { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2) }
.coords-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px }
.coords-head small { color: var(--muted); font-weight: 400 }
.coords .form-grid { margin: 0 }

/* ---------- Map ---------- */
.map { width: 100%; background: #e5ebe8; z-index: 0 }
.map-md { height: 360px }
.map-sm { height: 250px; border-radius: 10px; border: 1px solid var(--border); margin-top: 10px }
.map-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 130px); min-height: 560px }
.map-panel { display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow: hidden }
.map-panel .search { max-width: none; flex: none }
.map-card { position: relative }
.map-fill { height: 100% }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: #fff; border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text) }
.chip em { font-style: normal; color: var(--faint); font-weight: 600 }
.chip:hover { border-color: #b9c6c0 }
.chip.on { background: var(--brand-50); border-color: #93d3bd; color: var(--brand-600) }
.list-head { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 10px 14px 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1 }
.plant-list { overflow-y: auto; margin: 0 -14px -14px; border-top: 1px solid var(--border); flex: 1 }
.plant-row { display: flex; align-items: center; gap: 11px; padding: 9px 14px; border-bottom: 1px solid #edf1ef; cursor: pointer }
.plant-row:hover { background: var(--surface-2) }
.plant-row > div { flex: 1; min-width: 0 }
.plant-row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.plant-row small { color: var(--muted) }
.plant-row.unplaced { cursor: default; background: #fffcf4 }
.placing { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 800; background: var(--side); color: #fff; padding: 8px 8px 8px 14px; border-radius: 12px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-lg); font-size: 13px; max-width: calc(100% - 24px) }
.leaflet-container.is-placing, .leaflet-container.is-placing .leaflet-interactive { cursor: crosshair }
.leaflet-container { font-family: inherit }
.pin-wrap { background: none; border: 0 }
.pin { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .4); position: relative; transition: transform .12s }
.pin:hover { transform: scale(1.2) }
.pin.st-yellow { box-shadow: 0 0 0 3px #f2b233, 0 1px 5px rgba(0, 0, 0, .4) }
.pin.st-red { box-shadow: 0 0 0 3px var(--red), 0 1px 5px rgba(0, 0, 0, .4) }
.pin.has-ticket::after { content: ""; position: absolute; top: -7px; right: -7px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid #fff }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow-lg) }
.leaflet-popup-content { margin: 13px 15px; font-size: 13px; line-height: 1.4; min-width: 220px }
.pop small { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 10px }
.pop b { display: block; font-size: 14.5px; margin: 2px 0 5px }
.pop span { display: block; color: var(--muted) }
.pop .pop-alert { color: var(--red); font-weight: 600; margin-top: 5px }
.pop-actions { display: flex; gap: 6px; margin-top: 11px }
.leaflet-container .pop-actions a { flex: 1; text-align: center; padding: 6px 8px; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); font-weight: 600; font-size: 12px }
.leaflet-container .pop-actions a:first-child { background: var(--brand); color: #fff }
.leaflet-control-layers { border-radius: 10px !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important }

/* ---------- Toast ---------- */
#toast { position: fixed; right: 24px; bottom: 24px; background: var(--side); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; z-index: 3000; font-weight: 500 }
#toast.show { opacity: 1; transform: none }
#toast.error { background: var(--red) }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .map-layout { grid-template-columns: minmax(0, 1fr); height: auto }
  .map-panel { max-height: 440px }
  .map-card { height: 70vh; min-height: 420px }
}
@media (max-width: 860px) {
  .sidebar { width: 68px; padding: 14px 8px }
  .brand-text, .nav-group small, #nav a span, .status-card div { display: none }
  .brand { justify-content: center; padding: 4px 0 18px }
  #nav a { justify-content: center; padding: 11px }
  .status-card { justify-content: center; padding: 12px }
  main { margin-left: 68px; padding: 18px 16px 32px }
  .twocol { grid-template-columns: 1fr }
  .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px }
}
@media (max-width: 620px) {
  .grid, .options, .form-grid { grid-template-columns: minmax(0, 1fr) }
  .head-actions, #headActions { width: 100% }
  .toolbar .select { width: 100% }
  .span2 { grid-column: auto }
  .topbar h1 { font-size: 21px }
  .bar-row { grid-template-columns: 1fr 34px; }
  .bar-row .bar, .bar-row small { display: none }
  .stats { grid-template-columns: 1fr 1fr 1fr }
}

/* ---------- Accesso ---------- */
.login-mode { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(120% 120% at 20% 0%, #14342c 0%, #0b1d18 60%, #08150f 100%) }
.login { width: min(380px, 100%); background: var(--surface); border-radius: 18px; padding: 26px; box-shadow: var(--shadow-lg) }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px }
.login-brand b { display: block; font-size: 16px }
.login-brand small { display: block; color: var(--muted); font-size: 12px }
.login label { margin-bottom: 12px }
.login .notice { margin-bottom: 12px }
.status-card .who { flex: 1; min-width: 0 }
.status-card .who b { display: block; color: #e7f4ef; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.status-card .who small { color: #7a948b; text-transform: capitalize }
.status-card .icon-btn { background: rgba(255, 255, 255, .08); color: #a3b8b1 }
.status-card .icon-btn:hover { background: rgba(255, 255, 255, .16); color: #fff }
.status-card .avatar { background: rgba(34, 196, 149, .18); color: #43d8ac }
code.url { font: 12px/1.5 ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere }