:root {
  --ink: #182231;
  --muted: #6f7d8f;
  --line: #e5eaf0;
  --surface: #ffffff;
  --canvas: #f3f6f9;
  --green: #16865f;
  --green-soft: #e5f5ef;
  --red: #d34a54;
  --red-soft: #ffedf0;
  --blue: #316be8;
  --shadow: 0 8px 30px rgba(30, 45, 65, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar { min-height: 82px; padding: 15px clamp(20px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.45rem; letter-spacing: -0.03em; }
h2 { font-size: 1rem; letter-spacing: -0.015em; }
.eyebrow { margin-bottom: 4px; color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .09em; }
.topbar-actions { display: flex; gap: 8px; }
.sync-status, .current-user { display: inline-flex; align-items: center; min-height: 31px; color: #66758a; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.sync-status::before { width: 7px; height: 7px; margin-right: 5px; content: ""; background: #aab6c5; border-radius: 50%; }.sync-status.online::before { background: #16a26b; }.sync-status.saving::before { background: #d58a20; }.sync-status.error::before { background: #c4424f; }
.current-user { max-width: 180px; overflow: hidden; color: #34465e; text-overflow: ellipsis; }
.auth-screen { display: grid; min-height: 100vh; padding: 24px; place-items: center; background: radial-gradient(circle at 10% 10%, #e5effe, transparent 34%), linear-gradient(135deg, #f4f7fb, #eef3f9); }.auth-screen[hidden], #app-root[hidden] { display: none !important; }.auth-card { width: min(100%, 420px); padding: 34px; background: #fff; border: 1px solid #dce4ee; border-radius: 16px; box-shadow: 0 18px 48px rgba(35, 54, 80, .14); }.auth-card h1 { margin: 4px 0 9px; }.auth-intro { margin: 0 0 22px; color: #607086; font-size: .85rem; line-height: 1.5; }.auth-form label { display: block; margin-bottom: 14px; color: #41526a; font-size: .73rem; font-weight: 750; }.auth-form input { display: block; width: 100%; margin-top: 5px; }.auth-form .button { width: 100%; margin-top: 5px; }.auth-help { margin: 16px 0 0; color: #7a8798; font-size: .7rem; line-height: 1.45; text-align: center; }
.users-dialog-content { width: min(760px, 94vw); }.dialog-help { margin: 4px 0 14px; color: #647287; font-size: .75rem; line-height: 1.45; }.user-status { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: .66rem; font-weight: 800; }.user-status.active { color: #087050; background: #e8f8f0; }.user-status.disabled { color: #b23744; background: #fff0f2; }
.app-shell { display: grid; grid-template-columns: 310px minmax(0, 1fr); max-width: 1800px; margin: 0 auto; }
.sidebar { padding: 22px 16px clamp(24px, 5vh, 64px) clamp(16px, 3vw, 44px); border-right: 1px solid var(--line); }
.workspace { min-width: 0; padding: 26px clamp(20px, 4vw, 54px) 48px; }
.panel, .metric-card, .map-panel, .table-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.panel { padding: 18px; margin-bottom: 14px; }
.compact-panel { padding-bottom: 15px; }
.section-heading, .map-toolbar, .table-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.status-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.neutral { background: #edf2f8; color: #40526a; }
label { display: block; margin-top: 14px; color: #4e5d70; font-size: .78rem; font-weight: 700; }
input { width: 100%; min-height: 38px; margin-top: 5px; padding: 7px 9px; color: var(--ink); background: #fff; border: 1px solid #ccd5df; border-radius: 7px; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 107, 232, .12); }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline input { width: 78px; }
.field-inline span { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.help-text { margin-top: 10px; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.upload-card { display: flex; gap: 10px; align-items: center; margin-top: 11px; padding: 10px; color: var(--ink); background: #f8fafc; border: 1px dashed #bfcbd9; border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-card:hover { background: #f1f6ff; border-color: var(--blue); }
.upload-card input { position: absolute; width: 1px; height: 1px; margin: -1px; opacity: 0; overflow: hidden; clip: rect(0, 0, 0, 0); }
.upload-card strong, .upload-card small { display: block; }
.upload-card strong { font-size: .79rem; }
.upload-card small { margin-top: 2px; color: var(--muted); font-size: .68rem; font-weight: 500; line-height: 1.25; }
.upload-icon { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; color: var(--blue); background: #eaf0ff; border-radius: 6px; font-size: 18px; }
.inline-message { display: none; margin-top: 11px; padding: 8px; border-radius: 6px; font-size: .72rem; line-height: 1.4; }
.inline-message.visible { display: block; background: #edf3ff; color: #315489; }
.inline-message.error { background: var(--red-soft); color: #a62737; }
.geocode-all { width: 100%; margin-top: 11px; font-size: .7rem; }
.icon-button, .dialog-close { display: grid; place-items: center; width: 25px; height: 25px; color: #526376; background: #f1f4f7; border: 0; border-radius: 50%; font-weight: 800; }
.customer-form label { margin-top: 10px; font-size: .72rem; }
.customer-form input { min-height: 34px; margin-top: 3px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.button { min-height: 34px; padding: 7px 11px; border: 1px solid transparent; border-radius: 7px; font-size: .76rem; font-weight: 750; }
.button-primary { width: 100%; margin-top: 15px; color: white; background: var(--blue); }
.button-primary:hover { background: #2559c8; }
.button-secondary { color: #46576b; background: #fff; border-color: #d7dee6; }.backup-import-button { display: inline-flex; align-items: center; }.backup-import-button input { position: absolute; width: 1px; height: 1px; margin: -1px; opacity: 0; overflow: hidden; clip: rect(0, 0, 0, 0); }.button-demo { color: #6b4eb8; background: #f4efff; border-color: #d8cbff; }.button-demo.active { color: #fff; background: #7252c5; border-color: #7252c5; }
.button-danger { color: #b52f3d; background: #fff; border-color: #f0cdd2; }
.legend-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; }
.legend-panel .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
.legend-item { display: flex; align-items: center; gap: 6px; color: #59687a; font-size: .72rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background: var(--green); }.dot-red { background: var(--red); }.dot-gray { background: #a4afbd; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { position: relative; padding: 15px 16px; overflow: hidden; }
.metric-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: #8ca1b8; }
.metric-active::before { background: var(--green); }.metric-inactive::before { background: var(--red); }.metric-pending::before { background: #a4afbd; }
.metric-card span { display: block; color: var(--muted); font-size: .72rem; font-weight: 650; }
.metric-card strong { display: block; margin-top: 4px; font-size: 1.55rem; letter-spacing: -0.03em; }
.map-panel { position: relative; overflow: hidden; }
.map-toolbar { min-height: 76px; padding: 18px 19px 12px; flex-wrap: wrap; }
.map-toolbar h2, .table-toolbar h2 { font-size: 1rem; }
.map-toolbar p { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.filters { display: flex; align-items: center; gap: 5px; padding: 3px; background: #f2f5f8; border-radius: 7px; }.geo-filters { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }.multi-filter { position: relative; min-width: 150px; color: var(--muted); font-size: .7rem; }.multi-filter summary { display: flex; align-items: center; justify-content: space-between; min-height: 31px; padding: 6px 8px; color: var(--ink); background: #fff; border: 1px solid #d5dde6; border-radius: 6px; cursor: pointer; list-style: none; }.multi-filter summary::-webkit-details-marker { display: none; }.multi-filter summary::after { margin-left: 8px; color: #708096; content: "⌄"; }.multi-filter[open] summary { border-color: var(--blue); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }.filter-summary { max-width: 82px; overflow: hidden; color: #5270a5; font-size: .65rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }.multi-options { position: absolute; z-index: 900; top: 100%; left: 0; width: min(280px, 80vw); max-height: 245px; overflow: auto; padding: 7px; background: #fff; border: 1px solid var(--blue); border-top: 0; border-radius: 0 0 7px 7px; box-shadow: 0 10px 25px rgba(30, 45, 65, .16); }.multi-option { display: flex; align-items: center; gap: 7px; margin: 0; padding: 6px 4px; color: #405066; font-size: .72rem; font-weight: 600; cursor: pointer; }.multi-option:hover { background: #f4f7fb; }.multi-option input { width: 14px; min-height: 14px; margin: 0; accent-color: var(--blue); }.multi-options .empty-option { padding: 7px 4px; color: var(--muted); font-size: .71rem; }
.filter-button { padding: 5px 8px; color: #667689; background: transparent; border: 0; border-radius: 5px; font-size: .7rem; font-weight: 700; }
.filter-button.selected { color: #2f4870; background: #fff; box-shadow: 0 1px 3px rgba(32, 57, 82, .12); }
#map { height: clamp(330px, 46vh, 560px); border-top: 1px solid var(--line); }
.empty-map { position: absolute; z-index: 500; right: 22px; bottom: 22px; width: min(280px, calc(100% - 44px)); padding: 18px; background: rgba(255,255,255,.94); border: 1px solid #e1e7ed; border-radius: 10px; box-shadow: 0 8px 26px rgba(27, 47, 73, .14); text-align: center; transition: opacity .2s, visibility .2s; }
.empty-map.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.empty-symbol { margin-bottom: 5px; color: var(--blue); font-size: 30px; }.empty-map h3 { font-size: .9rem; }.empty-map p { margin-top: 5px; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.customer-marker { display: grid; place-items: center; width: 28px; height: 28px; color: white; border: 2px solid white; border-radius: 50% 50% 50% 0; box-shadow: 0 2px 7px rgba(24,34,49,.25); font-size: .64rem; font-weight: 800; transform: rotate(-45deg); }.customer-marker.marker-agent-outline { border: 3px solid var(--agent-color); box-shadow: 0 0 0 2px #fff, 0 3px 9px rgba(24,34,49,.3); }
.customer-marker > span { transform: rotate(45deg); }.marker-active { background: var(--green); }.marker-inactive { background: var(--red); }
.leaflet-popup-content-wrapper { border-radius: 9px; box-shadow: 0 5px 22px rgba(31, 49, 73, .2); }.leaflet-popup-content { margin: 12px 14px; }
.customer-popup { display: grid; gap: 3px; min-width: 180px; color: #4d5c6d; font-size: .72rem; }.customer-popup strong { color: var(--ink); font-size: .83rem; }.popup-code { color: #6681a8; font-size: .64rem; font-weight: 800; }.popup-status { font-weight: 800; }.popup-status.active { color: var(--green); }.popup-status.inactive { color: var(--red); }.customer-popup hr { width: 100%; margin: 5px 0 2px; border: 0; border-top: 1px solid var(--line); }

.table-panel { margin-top: 18px; overflow: hidden; }.table-toolbar { align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }.search-field { position: relative; width: min(290px, 50vw); margin: 0; }.search-field span { position: absolute; top: 9px; left: 10px; color: #718096; }.search-field input { min-height: 33px; margin: 0; padding-left: 30px; font-size: .75rem; }.review-panel { border-color: #efd8a6; }.review-panel.hidden { display: none; }.review-chip { margin-left: 6px; color: #8b5a09; background: #fff1d3; vertical-align: middle; }.review-description { margin-top: 5px; color: #786c59; font-size: .72rem; font-weight: 500; }.leaderboard-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; padding: 14px 18px; }.agent-rank { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; background: #f6f8fb; border: 1px solid #e4eaf0; border-radius: 8px; }.agent-rank-number { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; color: #45648e; background: #e8effa; border-radius: 50%; font-size: .68rem; font-weight: 800; }.agent-rank strong, .agent-rank span { display: block; }.agent-rank strong { overflow: hidden; color: var(--ink); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }.agent-rank span { margin-top: 2px; color: var(--muted); font-size: .68rem; }.leaderboard-empty { padding: 16px 18px; color: var(--muted); font-size: .75rem; }.demo-panel { border-color: #dcd3fa; }.demo-switches { display: flex; flex-wrap: wrap; gap: 12px; }.switch-control { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #4e5d70; font-size: .72rem; font-weight: 700; cursor: pointer; }.switch-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }.switch-control span { position: relative; width: 30px; height: 17px; background: #c4cfdd; border-radius: 999px; transition: background .15s; }.switch-control span::after { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; content: ""; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }.switch-control input:checked + span { background: #7252c5; }.switch-control input:checked + span::after { transform: translateX(13px); }.demo-colors-header { display: flex; justify-content: space-between; gap: 12px; padding: 13px 18px 8px; color: var(--ink); font-size: .75rem; }.demo-colors-header span { color: var(--muted); font-size: .7rem; }.agent-color-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; padding: 8px 18px 18px; }.agent-color-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #f7f5fc; border: 1px solid #e6e0f6; border-radius: 7px; }.agent-color-control span { overflow: hidden; color: #4c4170; font-size: .74rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }.agent-color-control input { flex: 0 0 32px; width: 32px; min-height: 25px; margin: 0; padding: 1px; border: 0; border-radius: 4px; cursor: pointer; }
.table-scroll { overflow-x: auto; }table { width: 100%; border-spacing: 0; border-collapse: collapse; text-align: left; }th { padding: 10px 18px; color: #8491a0; background: #fafbfd; border-bottom: 1px solid var(--line); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }td { padding: 11px 18px; color: #566577; border-bottom: 1px solid #edf0f3; font-size: .75rem; }tbody tr:last-child td { border-bottom: 0; }.customer-cell strong, .customer-cell span { display: block; }.customer-cell strong { color: var(--ink); font-size: .77rem; }.customer-cell span { margin-top: 2px; color: var(--muted); font-size: .67rem; }.table-status { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: .67rem; font-weight: 800; }.table-status.active { color: #087050; background: var(--green-soft); }.table-status.inactive { color: #ba3341; background: var(--red-soft); }.table-status.unknown { color: #657386; background: #edf1f5; }.position-text { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.locate-button, .edit-button { padding: 4px 7px; color: #316be8; background: #eef3ff; border: 0; border-radius: 5px; font-size: .66rem; font-weight: 800; }.edit-button { margin-left: 5px; color: #526376; background: #edf1f5; }.delete-button { margin-left: 5px; padding: 4px 7px; color: #b23744; background: #fff0f2; border: 0; border-radius: 5px; font-size: .66rem; font-weight: 800; }.empty-table { padding: 25px; color: var(--muted); text-align: center; }

dialog { width: min(620px, calc(100% - 32px)); padding: 0; color: var(--ink); border: 0; border-radius: 12px; box-shadow: 0 18px 60px rgba(20, 32, 47, .3); }dialog::backdrop { background: rgba(17, 28, 43, .45); }.dialog-content { position: relative; padding: 28px; }.dialog-content h2 { font-size: 1.2rem; }.dialog-content p { margin-top: 10px; color: #566577; font-size: .8rem; line-height: 1.5; }.dialog-content h3 { margin-top: 20px; font-size: .84rem; }.dialog-close { position: absolute; top: 14px; right: 14px; font-size: 18px; }.dialog-content pre { margin: 8px 0; padding: 11px; overflow-x: auto; color: #334358; background: #f4f7fa; border-radius: 7px; font-size: .72rem; line-height: 1.45; }.dialog-content code { color: #2360bb; }.edit-dialog-content .customer-form { margin-top: 16px; }.edit-dialog-content .inline-message { margin-bottom: 0; }

@media (max-width: 980px) { .app-shell { grid-template-columns: 280px minmax(0,1fr); }.workspace { padding: 20px; }.metrics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .topbar { padding: 14px 16px; }.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }.topbar-actions .button { padding: 6px 8px; font-size: .68rem; }.current-user { max-width: 120px; }.app-shell { display: block; }.sidebar { padding: 16px; border-right: 0; }.workspace { padding: 0 16px 28px; }.metrics { margin-top: 0; }.map-toolbar { display: block; }.filters { width: max-content; margin-top: 12px; }.geo-filters { margin-top: 10px; }.multi-filter { width: min(100%, 230px); }.search-field { width: 180px; }.legend-panel { display: none; } }
@media (max-width: 440px) { h1 { font-size: 1.16rem; }.topbar-actions { gap: 4px; }.topbar-actions .button { min-height: 30px; }.metrics { gap: 8px; }.metric-card { padding: 11px; }.table-toolbar { padding: 12px; }.search-field { width: 142px; }.two-columns { display: block; }.two-columns label + label { margin-top: 10px; } }
