:root {
  color-scheme: light;
  --ink: #152238;
  --muted: #68758a;
  --line: #e5eaf0;
  --paper: #ffffff;
  --background: #f4f7fa;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --orange: #e07821;
  --green: #1a936f;
  --purple: #7c3aed;
  --gray: #8793a3;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, input, select, textarea { font: inherit; }
.topbar { min-height: 78px; padding: 16px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #10233f; color: white; }
.topbar h1 { margin: 1px 0 0; font-size: 22px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: #8ea8c6; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.topbar .eyebrow { color: #9db4d1; }
.topbar-meta { display: flex; align-items: center; gap: 10px; }
.user-badge { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #dbe7f5; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 750; }
.pill, .count-badge, .status-tag { border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.pill { padding: 7px 10px; color: #cce9df; background: rgba(26,147,111,.18); border: 1px solid rgba(166,236,215,.26); }
.button { border: 0; border-radius: 8px; padding: 10px 13px; cursor: pointer; font-weight: 750; }
.button-ghost { color: #e2ebf8; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.button-primary { width: 100%; color: #fff; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.app-shell { padding: 20px 22px 24px; max-width: 1800px; margin: 0 auto; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.summary-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 4px 16px rgba(23,39,66,.04); }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.summary-card span { font-size: 12px; font-weight: 700; }
.summary-card strong { display: block; margin: 4px 0 1px; font-size: 28px; letter-spacing: -.04em; }
.summary-card small { font-size: 10px; }
.summary-card-action { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }.summary-card-action:hover, .summary-card-action:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,39,66,.12); outline: none; }
.summary-card.accent { border-color: #bcd1ff; background: #f8faff; }
.summary-card.accent strong { color: var(--blue); }
.workspace { height: calc(100vh - 150px); min-height: 690px; display: grid; grid-template-columns: 285px minmax(360px, 1fr) 335px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 8px 26px rgba(23,39,66,.06); }
.sidebar, .detail-panel { min-width: 0; min-height: 0; background: #fbfcfd; }
.sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.detail-panel { border-left: 1px solid var(--line); padding: 20px; }
.panel-header, .detail-heading { padding: 18px 16px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.panel-header h2, .detail-heading h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.03em; }
.count-badge { padding: 5px 8px; color: #4c5b71; background: #edf1f5; }
.filters { padding: 0 14px 14px; border-bottom: 1px solid var(--line); }
.filters label, .edit-section label { display: block; margin: 0 0 5px; color: #657287; font-size: 11px; font-weight: 750; }
.search-label { margin-top: 2px !important; }
input, select, textarea { width: 100%; border: 1px solid #d8e0ea; border-radius: 7px; color: var(--ink); background: #fff; outline: none; }
input, select { height: 34px; padding: 0 9px; }
textarea { padding: 9px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #83a9f8; box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.filter-row { margin-top: 10px; }
.type-filter-row { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e8edf2; }
.type-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }.type-filter-heading label { margin: 0; }.type-filter-actions { display: flex; gap: 4px; }.type-filter-actions button { padding: 2px 5px; border: 1px solid #d6dee8; border-radius: 4px; color: #56657a; background: #fff; cursor: pointer; font-size: 9px; }.type-filter-actions button:hover { color: var(--blue); border-color: #9bb9f5; }
.type-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 5px; margin-top: 7px; }.type-option { display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0 !important; color: #536176 !important; font-size: 10px !important; font-weight: 700 !important; cursor: pointer; }.type-option input { width: 12px; height: 12px; margin: 0; accent-color: var(--blue); }.type-option .lamp-swatch { width: 8px; height: 8px; flex: 0 0 auto; }.type-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.single-filter-row { display: grid; gap: 8px; margin-top: 12px; }.single-filter-option { display: flex !important; align-items: center; gap: 7px; color: #536176 !important; font-size: 11px !important; font-weight: 700 !important; cursor: pointer; }.single-filter-option input { width: 13px; height: 13px; margin: 0; accent-color: var(--blue); }
.position-list { flex: 1; min-height: 0; overflow: auto; padding: 6px; }
.position-row { width: 100%; padding: 10px; border: 0; border-bottom: 1px solid #edf0f4; text-align: left; background: transparent; cursor: pointer; }
.position-row:hover, .position-row.active { background: #edf4ff; }
.position-row.group-green { border-left: 4px solid var(--green); padding-left: 6px; }
.position-row.group-orange { border-left: 4px solid var(--orange); padding-left: 6px; }
.position-row.group-red { border-left: 4px solid #dc2626; padding-left: 6px; }
.position-row.group-gray { border-left: 4px solid var(--gray); padding-left: 6px; }
.position-row.group-green:hover, .position-row.group-green.active { background: #eaf8f3; }
.position-row.group-orange:hover, .position-row.group-orange.active { background: #fff3e4; }
.position-row.group-red:hover, .position-row.group-red.active { background: #fff0f0; }
.position-row-top { display: flex; align-items: center; gap: 7px; }
.position-id { font-weight: 800; font-size: 12px; }
.position-street { margin-top: 2px; color: #526075; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.position-sub { margin-top: 4px; display: flex; justify-content: space-between; color: #8b96a6; font-size: 10px; }
.mini-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; flex: 0 0 auto; }
.mini-open { background: var(--orange); }.mini-progress { background: var(--blue); }.mini-mounted { background: var(--green); }.mini-checked { background: var(--purple); }.mini-unmapped { background: var(--gray); }
.mini-ga { width: 10px; height: 10px; background: var(--orange); box-shadow: 0 0 0 2px #ffe2bf; }
.mini-green { width: 10px; height: 10px; background: var(--green); box-shadow: 0 0 0 2px #c6f0e2; }.mini-orange { width: 10px; height: 10px; background: var(--orange); box-shadow: 0 0 0 2px #ffe2bf; }.mini-red { width: 10px; height: 10px; background: #dc2626; box-shadow: 0 0 0 2px #ffd0d0; }.mini-gray { width: 10px; height: 10px; background: var(--gray); }
.map-panel { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: #dfe8ee; }
#map { width: 100%; height: 100%; min-height: 0; }
.map-marker-wrapper { background: transparent; border: 0; }
.map-marker { position: relative; display: flex; align-items: center; justify-content: center; gap: 0; width: 28px; height: 40px; overflow: visible; }
.map-marker.marker-with-type { flex-direction: column; width: 32px; height: 68px; gap: 4px; }
.map-marker.marker-with-type-sensor { flex-direction: column; width: 32px; height: 96px; gap: 4px; }
.map-marker.marker-sensor-only { flex-direction: column; width: 32px; height: 64px; gap: 4px; }
.map-marker.marker-status-only { width: 28px; height: 40px; }
.status-flag { --flag-color: var(--gray); position: relative; display: block; width: 30px; height: 30px; flex: 0 0 30px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background: var(--flag-color); box-shadow: 0 2px 6px rgba(21,34,56,.5); transform: rotate(-45deg); }
.status-flag::before, .status-flag::after { content: none; }
.flag-green { --flag-color: var(--green); }.flag-orange { --flag-color: var(--orange); }.flag-red { --flag-color: #dc2626; }.flag-gray { --flag-color: var(--gray); }
.lamp-square { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 5px; color: #fff; box-shadow: 0 2px 7px rgba(21,34,56,.58); font-size: 10px; font-weight: 850; line-height: 1; }
.sensor-square { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 4px; color: #fff; background: #8793a3; box-shadow: 0 2px 6px rgba(21,34,56,.5); font-size: 9px; font-weight: 850; line-height: 1; }
.lamp-a { background: #1d4ed8; }.lamp-b1 { background: #2563eb; }.lamp-b2 { background: #60a5fa; }.lamp-c { background: #93c5fd; color: #123247; }.lamp-d { background: #bfdbfe; color: #123247; }.lamp-e { background: #7c2d12; }.lamp-f { background: #be185d; }.lamp-s1 { background: #ec4899; }.lamp-s2 { background: #f9a8d4; color: #5b1237; }.lamp-tl { background: #a16207; }.lamp-olc { background: #ca8a04; }.lamp-olc-l { background: #facc15; color: #4a3500; }.lamp-unknown { background: #92400e; }.lamp-bestand { background: var(--gray); }
.lamp-code { margin-left: auto; min-width: 20px; padding: 3px 4px; border-radius: 4px; color: #fff; font-size: 9px; font-weight: 850; line-height: 1; text-align: center; }
.map-cluster-wrapper { background: transparent; border: 0; }
.map-cluster { width: 44px; height: 44px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; background: #10233f; box-shadow: 0 2px 8px rgba(21,34,56,.42); font-size: 13px; font-weight: 850; }
.cluster-green { background: var(--green); }.cluster-orange { background: var(--orange); }.cluster-red { background: #dc2626; }.cluster-gray { background: var(--gray); }
.legend-divider { height: 1px; margin: 2px 0; background: #e3e8ef; }.legend-subtitle { color: #718096; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }.legend-types { display: grid; grid-template-columns: repeat(4, auto); gap: 5px 8px; }.legend-types span { display: flex; gap: 4px; align-items: center; font-size: 10px; }.lamp-swatch { width: 10px; height: 10px; display: inline-block; border-radius: 3px; border: 1px solid rgba(255,255,255,.8); }
.map-legend { position: absolute; z-index: 500; left: 13px; top: 60px; padding: 9px 10px; display: grid; gap: 6px; color: #435269; font-size: 10px; background: rgba(255,255,255,.94); border: 1px solid rgba(220,227,235,.95); border-radius: 8px; box-shadow: 0 3px 12px rgba(23,39,66,.12); }
.map-legend div { display: flex; gap: 7px; align-items: center; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }.dot-open { background: var(--orange); }.dot-progress { background: var(--blue); }.dot-mounted { background: var(--green); }.dot-checked { background: var(--purple); }.dot-red { background: #dc2626; }.dot-unmapped { background: var(--gray); }
.glossary-panel { position: absolute; z-index: 510; left: 12px; right: 12px; bottom: 12px; padding: 10px 12px; color: #435269; background: rgba(255,255,255,.96); border: 1px solid rgba(220,227,235,.98); border-radius: 9px; box-shadow: 0 3px 14px rgba(23,39,66,.16); }
.glossary-title { margin-bottom: 7px; color: #253650; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.glossary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; max-height: 86px; overflow: auto; }
.glossary-item { min-width: 0; display: grid; grid-template-columns: 10px 24px minmax(0, 1fr); align-items: center; gap: 5px; font-size: 10px; }
.glossary-item strong { color: #26364c; }.glossary-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.glossary-missing { color: #8490a0; }
.empty-state { height: 100%; min-height: 540px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 26px; }
.empty-state h2 { margin: 10px 0 5px; color: var(--ink); font-size: 18px; }.empty-state p { margin: 0; font-size: 12px; line-height: 1.5; }.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: #e9f0ff; font-size: 25px; }
.hidden { display: none !important; }
.scan-button { width: 100%; margin-top: 6px; }.button-secondary { border: 1px solid #9cb9df; color: #2457a6; background: #eef5ff; }.button-secondary:hover { background: #e1edff; }.scanner-panel { margin-top: 10px; padding: 10px; border: 1px solid #d9e2ed; border-radius: 9px; background: #f5f8fb; }.scanner-video { display: block; width: 100%; max-height: 220px; border-radius: 7px; background: #1b2736; object-fit: cover; }.scanner-message { margin: 7px 0; color: #526075; font-size: 11px; line-height: 1.35; }
.login-message { min-height: 18px; margin: 12px 0 0; color: #2f6b54; font-size: 12px; font-weight: 700; }.login-message.error { color: #b13d35; }
.modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 22px; }.modal-backdrop { position: absolute; inset: 0; background: rgba(16,35,63,.42); }.modal-card { position: relative; width: min(520px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 44px)); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(16,35,63,.28); }.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }.modal-heading h2 { margin: 3px 0 0; font-size: 20px; }.modal-close { width: 30px; height: 30px; border: 0; border-radius: 7px; color: #657287; background: #f0f3f6; cursor: pointer; font-size: 22px; line-height: 1; }.modal-intro { margin: 14px 0; color: var(--muted); font-size: 12px; }.unmapped-list { display: grid; gap: 8px; }.unmapped-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 10px; border: 1px solid #e7ebf0; border-radius: 8px; background: #fbfcfd; }.unmapped-row strong { color: var(--ink); }.unmapped-row span, .unmapped-row small { display: block; }.unmapped-row span { color: #526075; font-size: 12px; }.unmapped-row small { margin-top: 3px; color: #a13a30; font-size: 10px; }
.detail-content { height: 100%; overflow: auto; }
.detail-heading { padding: 0 0 15px; border-bottom: 1px solid var(--line); }
.muted { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.status-tag { padding: 5px 8px; color: #95601e; background: #fff3df; }.status-tag.matched { color: #2058b7; background: #e9f0ff; }.status-tag.unmapped { color: #657287; background: #edf1f5; }
.detail-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 0; }
.entry-section { padding: 14px 0 2px; border-top: 1px solid var(--line); }.entry-title { margin: 0 0 10px; color: #526075; font-size: 11px; font-weight: 800; }.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.entry-grid > div { min-width: 0; }.entry-grid .wide { grid-column: 1 / -1; }.entry-grid label { display: block; margin: 0 0 5px; color: #657287; font-size: 11px; font-weight: 750; }
.photo-picker { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid #b9c9dd; border-radius: 8px; color: #2457a6; background: #f4f8ff; cursor: pointer; font-size: 11px; font-weight: 800; }.photo-picker:hover { background: #e9f1ff; }.photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }.photo-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }.photo-card { min-width: 0; margin: 0; overflow: hidden; border: 1px solid #e1e7ef; border-radius: 8px; background: #fbfcfd; }.photo-card img { display: block; width: 100%; height: 110px; object-fit: cover; }.photo-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px; font-size: 10px; }.photo-card figcaption span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #526075; }.photo-delete { flex: 0 0 auto; border: 0; color: #b13d35; background: transparent; cursor: pointer; font-size: 10px; }.photo-empty { margin: 10px 0 0; color: #8a96a6; font-size: 11px; }
.field { min-width: 0; padding-bottom: 8px; border-bottom: 1px solid #eef1f4; }.field.wide { grid-column: 1 / -1; }.field-label { color: #8290a4; font-size: 10px; }.field-value { margin-top: 2px; color: #28374d; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.edit-section { margin-top: 13px; }.save-hint { color: #8a96a6; font-size: 10px; line-height: 1.4; }
.leaflet-popup-content { margin: 11px 13px; }.popup-title { font-weight: 800; }.popup-sub { color: #637087; font-size: 11px; margin-top: 2px; }
.no-results { padding: 22px 10px; text-align: center; color: var(--muted); font-size: 12px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(140deg, #10233f, #244c7b); }.login-card { width: min(430px, 100%); padding: 30px; border-radius: 16px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25); }.login-card h1 { margin: 6px 0 12px; color: var(--ink); font-size: 25px; }.login-intro { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.5; }.login-card label { display: block; margin: 0 0 6px; color: #657287; font-size: 11px; font-weight: 800; }.login-card input { margin-bottom: 14px; height: 44px; }.login-hint { margin: 14px 0 0; color: #8a96a6; font-size: 10px; }
@media (min-width: 721px) and (max-width: 1100px) { .workspace { height: auto; min-height: 0; grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: minmax(600px, auto) auto; }.sidebar { min-height: 600px; }.map-panel { height: 68vh; min-height: 560px; }.detail-panel { grid-column: 1 / -1; min-height: 620px; max-height: 76vh; border-left: 0; border-top: 1px solid var(--line); }.detail-content { min-height: 580px; } }
@media (max-width: 720px) { .topbar { align-items: flex-start; flex-direction: column; }.topbar-meta { width: 100%; flex-wrap: wrap; }.app-shell { padding: 12px; }.summary-grid { grid-template-columns: 1fr; }.workspace { height: auto; min-height: 0; grid-template-columns: 1fr; }.sidebar { max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }.position-list { max-height: 360px; }.map-panel { height: 58vh; min-height: 470px; }.detail-panel { grid-column: auto; min-height: 620px; max-height: none; border-left: 0; border-top: 1px solid var(--line); }.detail-content { min-height: 580px; }.button, input, select, textarea { min-height: 42px; }.position-row { padding-top: 13px; padding-bottom: 13px; }.photo-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .workspace { grid-template-columns: 250px minmax(300px, 1fr); }.detail-panel { grid-column: 1 / -1; min-height: 320px; border-left: 0; border-top: 1px solid var(--line); }.detail-content { min-height: 280px; }.empty-state { min-height: 260px; } }
@media (max-width: 720px) { .topbar { align-items: flex-start; flex-direction: column; }.topbar-meta { width: 100%; justify-content: space-between; }.app-shell { padding: 12px; }.summary-grid { grid-template-columns: 1fr 1fr; }.workspace { grid-template-columns: 1fr; }.sidebar { max-height: 380px; border-right: 0; border-bottom: 1px solid var(--line); }.map-panel { min-height: 500px; }.detail-panel { grid-column: auto; }.detail-heading { padding-top: 4px; } }
