:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #67717d;
  --line: #dfe4e8;
  --primary: #123e5a;
  --primary-2: #0a6c78;
  --danger: #c94040;
  --orange: #e68a2e;
  --yellow: #e1ba32;
  --grey: #86919b;
  --shadow: 0 14px 34px rgba(24, 41, 54, 0.10);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.45; }
.eyebrow { margin: 0 0 5px; font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--primary-2); }
.login-shell { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #d8ebec, transparent 38%), linear-gradient(135deg,#f7f9fa,#e7edf0); }
.login-card { width: min(430px,100%); background: var(--surface); padding: 38px; border-radius: 18px; box-shadow: var(--shadow); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; border-radius: 12px; margin-bottom: 22px; }
h1,h2,p { margin-top: 0; }
.login-card h1 { margin-bottom: 8px; font-size: 28px; }
label { display: block; font-size: 12px; font-weight: 600; color: #44505a; }
input, select, textarea { width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 10px 11px; color: var(--text); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(10,108,120,.10); }
.login-card form { display: grid; gap: 16px; margin-top: 25px; }
.btn { border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { background: #edf2f4; color: #29414f; border: 1px solid #d7e0e4; }
.btn.ghost { background: transparent; border: 1px solid #dce3e7; color: #33454f; }
.full { width: 100%; }
.security-note { margin: 24px 0 0; font-size: 11px; text-align: center; color: var(--muted); }
.form-message { min-height: 16px; margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.topbar { height: 72px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.topbar h1 { font-size: 20px; margin: 0; }
.title-row { display: flex; align-items: center; gap: 9px; }
.user-zone { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); }
.workspace { height: calc(100vh - 72px); display: grid; grid-template-columns: 292px minmax(0,1fr); }
.workspace.with-detail { grid-template-columns: 292px minmax(0,1fr) 390px; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); overflow: auto; }
.sidebar-section { padding: 18px; border-bottom: 1px solid var(--line); }
.sidebar h2, .detail-panel h2, .table-toolbar h2 { font-size: 14px; margin-bottom: 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { border: 1px solid var(--line); border-left: 4px solid var(--primary); padding: 10px; border-radius: 8px; }
.kpi.red { border-left-color: var(--danger); }.kpi.orange { border-left-color: var(--orange); }.kpi.yellow { border-left-color: var(--yellow); }
.kpi strong { display: block; font-size: 21px; }.kpi span { font-size: 10px; color: var(--muted); }
.filter-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-weight: 500; }
.filter-row input { width: auto; margin: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }.legend-dot.red{background:var(--danger)}.legend-dot.orange{background:var(--orange)}.legend-dot.yellow{background:var(--yellow)}.legend-dot.grey{background:var(--grey)}
.import-box input[type=file] { font-size: 11px; margin: 8px 0; }
.badge { font-size: 9px; border-radius: 99px; padding: 4px 7px; background: #e7eef1; color: #40535e; font-weight: 700; }
.badge.demo { background: #fff1c7; color: #705500; }
.icon-btn { border: 0; background: #eef2f4; width: 28px; height: 28px; border-radius: 7px; cursor: pointer; font-size: 18px; }
.content-area { position: relative; min-width: 0; }
#map { height: 100%; width: 100%; background: #dce5e8; }
.detail-panel { background: var(--surface); border-left: 1px solid var(--line); padding: 20px; overflow: auto; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.detail-header h2 { margin: 0; font-size: 19px; }
.detail-status { border-radius: 8px; padding: 10px; margin-bottom: 16px; font-size: 12px; font-weight: 600; background: #f1f3f5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-panel label { margin-bottom: 12px; }
.detail-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.table-view { position: absolute; inset: 0; z-index: 1200; background: var(--surface); padding: 18px; overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; }
.table-scroll { height: calc(100% - 44px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th,td { padding: 11px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: #f4f6f7; z-index: 1; }
tbody tr { cursor: pointer; } tbody tr:hover { background: #f7fafb; }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.map-popup h3 { margin: 0 0 5px; font-size: 14px; }.map-popup p { margin: 3px 0; font-size: 11px; }.map-popup strong { font-weight: 600; }
@media (max-width: 1050px) { .workspace, .workspace.with-detail { grid-template-columns: 250px minmax(0,1fr); }.detail-panel { position: fixed; right: 0; top: 72px; bottom: 0; width: min(390px, 92vw); z-index: 1000; box-shadow: var(--shadow); }.user-zone span { display: none; } }

.theme-select { margin-bottom: 6px; }
.dynamic-filters { margin-top: 10px; }
.filter-actions { display:flex; gap:12px; margin-top:10px; }
.text-btn { border:0; padding:0; background:transparent; color:var(--primary-2); font-size:11px; font-weight:600; cursor:pointer; }
.text-btn:hover { text-decoration:underline; }


/* Auth / password management */
.login-link { display:block; margin:12px auto 4px; font-size:12px; }
.modal-backdrop { position:fixed; inset:0; z-index:5000; display:grid; place-items:center; padding:20px; background:rgba(17,31,40,.48); backdrop-filter:blur(2px); }
.modal-card { width:min(460px,100%); background:var(--surface); border-radius:16px; padding:24px; box-shadow:0 24px 70px rgba(11,31,44,.28); }
.modal-header { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:10px; }
.modal-header h2 { margin:0; font-size:19px; }
#password-form { display:grid; gap:14px; margin-top:18px; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:4px; }
@media (max-width: 700px) {
  .user-zone { gap:7px; }
  #change-password-btn { display:none; }
}
