:root {
  color-scheme:light;
  --ink:#183032;
  --text:#304345;
  --muted:#586b6e;
  --line:#dbe4e1;
  --soft:#f5f8f6;
  --green:#18694f;
  --nav:#112f31;
  --lime:#b9ef86;
  --amber:#94611b;
  --radius:14px;
  font:15px/1.48 Inter,"Segoe UI",Arial,sans-serif;
  color:var(--text);
  background:var(--soft);
}

*,*::before,*::after {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,select,textarea {
  font:inherit;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color:transparent;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:default;
  opacity:.52;
}

a {
  color:inherit;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:3px solid #337eec;
  outline-offset:3px;
}

[hidden] {
  display:none!important;
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

h1,h2,h3,p {
  margin:0;
}

h1,h2,h3 {
  color:var(--ink);
}

h1 {
  font-size:clamp(1.7rem,2.6vw,2.45rem);
  font-weight:660;
  line-height:1.12;
  letter-spacing:-.055em;
}

h2 {
  font-size:1.08rem;
  line-height:1.35;
  font-weight:650;
  letter-spacing:-.025em;
}

h3 {
  font-size:1rem;
}

small,.caption,.muted {
  color:var(--muted);
}

.caption {
  font-size:.83rem;
}

.icon {
  width:19px;
  height:19px;
  flex:none;
  vertical-align:middle;
  stroke:currentColor;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.75;
}

.skip-link {
  position:fixed;
  padding:12px;
  top:-80px;
  z-index:100;
  background:#fff;
}

.skip-link:focus {
  top:4px;
}

.brand {
  display:flex;
  align-items:center;
  gap:11px;
  color:#fff;
  white-space:nowrap;
  font-size:1.15rem;
  letter-spacing:-.035em;
  font-weight:700;
}

.brand b {
  font-weight:450;
  color:#e2eeeb;
}

.brand-light,.brand-light b {
  color:var(--ink);
}

.sidebar {
  width:221px;
  height:100dvh;
  position:fixed;
  inset:0 auto 0 0;
  background:var(--nav);
  color:#c5d5d2;
  display:flex;
  flex-direction:column;
  padding:29px 15px 17px;
}

.sidebar .brand {
  padding:0 7px;
  margin-bottom:46px;
}

.sidebar nav {
  display:flex;
  flex-direction:column;
  gap:5px;
}

.sidebar nav a {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 13px;
  color:#cddbd8;
  border-radius:9px;
  text-decoration:none;
  font-size:.94rem;
  font-weight:520;
}

.sidebar nav a:hover {
  background:#1b3f40;
  color:#fff;
}

.sidebar nav a[aria-current=page] {
  background:#2b4c43;
  color:#d4f5b6;
}

.sidebar nav a[aria-current=page] .icon {
  color:var(--lime);
}

.nav-divider {
  height:1px;
  background:#355251;
  margin:15px 9px;
}

.account {
  margin-top:auto;
  border-top:1px solid #355251;
  display:flex;
  gap:9px;
  align-items:center;
  padding:18px 4px 0;
}

.avatar {
  background:#274648;
  width:35px;
  height:35px;
  display:grid;
  place-items:center;
  border-radius:50%;
}

.account strong,.account small {
  display:block;
}

.account strong {
  font-size:.87rem;
  color:white;
}

.account small {
  font-size:.73rem;
  color:#afc4bf;
}

.logout {
  margin-left:auto;
  border:0;
  background:transparent;
  color:#c5d5d2;
  border-radius:6px;
  padding:7px;
}

.logout:hover {
  background:#28494b;
}

.content {
  margin-left:221px;
  padding:30px clamp(19px,2.7vw,50px) 42px;
  min-height:100dvh;
  max-width:2200px;
}

.page-head,.card-head,.action-row,.sync,.button,.search,.stat-name,.device-name,.status,.pick-banner {
  display:flex;
  align-items:center;
}

.page-head {
  justify-content:space-between;
  gap:20px;
  margin-bottom:23px;
}

.page-head p {
  font-size:.95rem;
  color:var(--muted);
  margin-top:7px;
}

.sync {
  gap:8px;
  white-space:nowrap;
  font-size:.78rem;
  color:var(--muted);
}

.signal {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#879797;
}

.sync.success .signal {
  background:#318558;
}

.sync.warning .signal {
  background:#c18928;
}

.sync .icon-button {
  background:white;
  border-color:var(--line);
  margin-left:3px;
}

.page-view {
  display:grid;
  gap:17px;
}

.card,.stat {
  border:1px solid var(--line);
  background:white;
  border-radius:var(--radius);
  min-width:0;
}

.card {
  overflow:hidden;
}

.card-head {
  min-height:62px;
  padding:13px 19px;
  border-bottom:1px solid var(--line);
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.card-head h2 {
  display:flex;
  align-items:center;
  gap:9px;
}

.card-head h2>.icon {
  color:var(--green);
  width:18px;
  height:18px;
}

.card-body {
  padding:20px;
}

.inset {
  padding:13px 19px;
}

.stats {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:11px;
}

.stat {
  padding:14px 17px;
  position:relative;
  min-height:88px;
}

.stat-name {
  gap:8px;
  font-weight:540;
  color:var(--muted);
  font-size:.82rem;
}

.stat strong {
  display:block;
  font-size:1.9rem;
  line-height:1.1;
  letter-spacing:-.055em;
  color:var(--ink);
  margin-top:6px;
  font-variant-numeric:tabular-nums;
}

.stat-icon {
  position:absolute;
  right:13px;
  top:50%;
  transform:translateY(-50%);
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:11px;
  background:#eafaee;
  color:#368059;
}

.stat-icon.fleet {
  background:#eaf1f1;
  color:#3f6770;
}

.stat-icon.stopped {
  background:#fff3df;
  color:#98651d;
}

.stat-icon.stale {
  background:#efeff6;
  color:#72638a;
}

.stat-icon .icon {
  width:18px;
  height:18px;
}

.live-layout {
  display:grid;
  grid-template-columns:minmax(233px,.76fr) minmax(0,2fr);
  gap:16px;
  align-items:stretch;
}

.device-column {
  display:flex;
  flex-direction:column;
}

.count {
  padding:2px 8px;
  background:#eff4f1;
  border:1px solid var(--line);
  font-size:.75rem;
  font-weight:600;
  color:#4f6561;
  border-radius:7px;
}

.filters {
  padding:12px;
  display:grid;
  gap:7px;
  border-bottom:1px solid var(--line);
}

label {
  display:grid;
  gap:6px;
  font-size:.85rem;
  font-weight:600;
  color:var(--ink);
}

input,select,textarea {
  background:white;
  border:1px solid #c8d5d0;
  border-radius:8px;
  padding:9px 11px;
  color:var(--ink);
  min-width:0;
  width:100%;
  font-weight:400;
  line-height:1.35;
}

input[type=file] {
  padding:7px;
  font-size:.85rem;
}

input[type=checkbox] {
  width:17px;
  height:17px;
  accent-color:var(--green);
}

input[type=date] {
  min-width:145px;
}

.check-label {
  display:flex;
  align-items:center;
  gap:9px;
}

.search {
  position:relative;
}

.search .icon {
  position:absolute;
  left:10px;
  top:11px;
  width:16px;
  height:16px;
  color:#728783;
}

.search input {
  padding-left:33px;
}

.filters select,.filters input {
  font-size:.85rem;
}

.live-list {
  overflow-y:auto;
  max-height:clamp(300px,54vh,780px);
  padding:4px 0;
}

.live-row {
  width:100%;
  display:grid;
  text-align:left;
  grid-template-columns:31px minmax(0,1fr);
  gap:9px;
  padding:14px 12px;
  background:white;
  border:0;
  border-bottom:1px solid #edf1ef;
  border-left:3px solid transparent;
  color:var(--ink);
  align-items:start;
}

.live-row:hover {
  background:#f5f8f5;
}

.live-row[aria-pressed=true] {
  background:#edf6ed;
  border-left-color:#488c5c;
}

.row-symbol {
  width:29px;
  height:29px;
  display:grid;
  place-items:center;
  background:#eef2f0;
  border-radius:8px;
  color:#526760;
}

.row-symbol.moving,.tone.moving {
  background:#e3f2e7;
  color:#27754c;
}

.row-symbol.stopped,.tone.stopped {
  background:#fff2dc;
  color:#94611b;
}

.row-symbol.stale,.tone.stale {
  background:#f0edf6;
  color:#736483;
}

.row-symbol .icon {
  width:16px;
  height:16px;
}

.device-name {
  font-weight:620;
  font-size:.91rem;
  overflow-wrap:anywhere;
}

.row-meta {
  display:flex;
  gap:4px 8px;
  flex-wrap:wrap;
  font-size:.73rem;
  color:var(--muted);
  margin-top:4px;
}

.status {
  gap:5px;
  font-size:.78rem;
  font-weight:540;
  white-space:nowrap;
}

.dot {
  width:7px;
  height:7px;
  display:inline-block;
  border-radius:50%;
  background:#869894;
  flex:none;
}

.dot.moving {
  background:#258253;
}

.dot.stopped {
  background:#b37d28;
}

.dot.stale {
  background:#8a749d;
}

.map-card {
  display:flex;
  flex-direction:column;
}

.map-slot {
  height:clamp(330px,50vh,720px);
  min-height:280px;
  position:relative;
  background:#eaf0ee;
}

.live-layout .map-slot {
  flex:1;
  min-height:clamp(318px,47vh,720px);
}

.map-host,#map-canvas {
  position:absolute;
  inset:0;
}

.map-notice {
  position:absolute;
  z-index:2;
  left:10px;
  bottom:30px;
  max-width:calc(100% - 20px);
  padding:5px 9px;
  border-radius:6px;
  background:#fffef9ed;
  box-shadow:0 1px 8px #19332a22;
  font-size:.73rem;
  color:#6b5634;
  pointer-events:none;
}

.maplibregl-ctrl-group button:focus-visible {
  outline-offset:-2px;
}

.geo-marker {
  display:flex;
  align-items:center;
  gap:4px;
  cursor:pointer;
  border:0;
  background:transparent;
  padding:0;
  color:var(--ink);
}

.geo-marker .pin {
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border:2px solid #fff;
  background:#557367;
  color:white;
  box-shadow:0 1px 5px #152f3355;
  border-radius:50%;
}

.geo-marker .pin .icon {
  width:13px;
  height:13px;
  stroke-width:2.1;
}

.geo-marker.moving .pin {
  background:#197849;
}

.geo-marker.stopped .pin {
  background:#a76b19;
}

.geo-marker.stale .pin {
  background:#786986;
}

.geo-marker.customer .pin {
  background:#387c89;
}

.marker-label {
  position:absolute;
  left:27px;
  max-width:155px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:2px 5px;
  border:1px solid #cad6cd;
  border-radius:5px;
  font:600 11px/1.3 Inter,"Segoe UI",sans-serif;
  background:#fffffff3;
  box-shadow:0 1px 4px #19332a22;
}

.geo-marker.selected {
  z-index:1;
}

.geo-marker.selected .pin {
  box-shadow:0 0 0 3px #254f43a1;
}

.geo-marker.selected .marker-label {
  border-color:#669977;
}

.detail {
  min-height:91px;
  border-top:1px solid var(--line);
  padding:14px 19px;
}

.detail-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:8px;
}

.detail-values {
  display:flex;
  flex-wrap:wrap;
  gap:5px 16px;
  color:var(--muted);
  font-size:.8rem;
}

.detail-values strong {
  color:var(--text);
  font-weight:580;
}

.empty {
  padding:26px 17px;
  text-align:center;
  color:var(--muted);
  font-size:.88rem;
}

.empty .icon {
  color:#708d80;
  display:block;
  margin:0 auto 9px;
  width:23px;
  height:23px;
}

.detail>.empty {
  padding:8px 0;
}

.button,.icon-button {
  border:1px solid #cdd9d3;
  background:white;
  color:var(--ink);
  border-radius:8px;
  font-weight:570;
  justify-content:center;
  gap:7px;
}

.button {
  display:inline-flex;
  min-height:37px;
  font-size:.85rem;
  padding:8px 12px;
  text-decoration:none;
}

.button .icon,.icon-button .icon {
  width:16px;
  height:16px;
}

.button:hover,.icon-button:hover {
  background:#f0f6f2;
}

.primary {
  background:#1b624b;
  border-color:#1b624b;
  color:white;
}

.primary:hover {
  background:#174d3d;
}

.danger {
  background:#a73435;
  color:white;
  border-color:#a73435;
}

.danger:hover {
  background:#802526;
}

.danger-text {
  color:#9e3838;
}

.small {
  padding:5px 8px;
  min-height:30px;
  font-size:.78rem;
}

.subtle {
  background:#f7faf8;
}

.icon-button {
  display:inline-grid;
  place-items:center;
  width:32px;
  height:32px;
  padding:4px;
}

.action-row {
  gap:7px;
  flex-wrap:wrap;
}

.stack {
  display:grid;
  gap:15px;
}

.stack>.button,.stack>.action-row {
  justify-self:start;
}

.form-grid,.license-layout {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.license-layout {
  gap:17px;
  align-items:start;
}

.form-help {
  font-size:.79rem;
  color:var(--muted);
  font-weight:400;
  line-height:1.45;
}

.report-bar {
  display:flex;
  align-items:end;
  gap:12px;
  flex-wrap:wrap;
  padding:15px 18px;
}

.report-bar label:first-child {
  min-width:min(100%,215px);
}

.exports {
  margin-left:auto;
}

.report-stats {
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.report-map-card .map-slot,#customer-map-slot {
  height:clamp(290px,40vh,580px);
}

.table-wrap {
  overflow:auto;
}

table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  font-size:.86rem;
}

th,td {
  padding:12px 17px;
  border-bottom:1px solid #e5ebe7;
  vertical-align:middle;
}

th {
  background:#f5f8f6;
  color:var(--muted);
  font-size:.77rem;
  font-weight:620;
  white-space:nowrap;
}

tbody tr:last-child td {
  border-bottom:0;
}

td strong {
  font-size:.88rem;
  color:var(--ink);
}

td small {
  display:block;
  margin-top:3px;
  white-space:nowrap;
}

td .action-row {
  flex-wrap:nowrap;
}

.pick-banner,.banner {
  padding:10px 15px;
  font-size:.86rem;
}

.pick-banner {
  justify-content:space-between;
  gap:10px;
  background:#fff6df;
  color:#705722;
}

.map-host.picking #map-canvas .maplibregl-canvas-container {
  cursor:crosshair;
}

.error {
  color:#98322d;
}

.error:empty {
  display:none;
}

.banner {
  background:#fcf1ee;
  border:1px solid #efd6cf;
  border-radius:9px;
  margin-bottom:15px;
}

.fact-list {
  display:grid;
  gap:0;
  margin:0;
}

.fact-list>div {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}

.fact-list>div:last-child {
  border:0;
}

.fact-list dt {
  font-size:.86rem;
  color:var(--muted);
}

.fact-list dd {
  margin:0;
  text-align:right;
  font-weight:600;
  color:var(--ink);
  overflow-wrap:anywhere;
}

.license-meter {
  width:100%;
  height:8px;
  accent-color:#45865b;
  margin:16px 0 2px;
}

.login-page {
  display:grid;
  place-items:center;
  min-height:100dvh;
  background:#edf3ef;
  padding:20px;
}

.login-card {
  background:white;
  border-radius:20px;
  border:1px solid #d5e1d9;
  width:min(100%,408px);
  padding:31px;
  display:grid;
  gap:16px;
  box-shadow:0 12px 45px #19352d0a;
}

.login-card .brand {
  margin-bottom:10px;
}

.login-card h1 {
  font-size:1.8rem;
}

.login-card>.muted {
  font-size:.9rem;
  margin-top:-8px;
}

.login-card .button {
  margin-top:3px;
  min-height:41px;
}

dialog {
  border:1px solid var(--line);
  border-radius:16px;
  padding:0;
  box-shadow:0 18px 65px #142c3255;
  width:min(480px,calc(100% - 24px));
  max-height:90dvh;
  color:var(--text);
}

dialog::backdrop {
  background:#162d3199;
}

.dialog-head {
  padding:15px 20px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

#dialog-content {
  padding:19px 20px;
}

.form-error {
  font-size:.86rem;
}

.pair-code {
  font:650 2.35rem/1.25 ui-monospace,Consolas,monospace;
  letter-spacing:.1em;
  color:var(--green);
  text-align:center;
  background:#edf6ec;
  padding:14px;
  border-radius:9px;
  user-select:all;
}

.toast {
  position:fixed;
  z-index:10;
  right:20px;
  bottom:20px;
  max-width:min(420px,calc(100% - 40px));
  background:#193e34;
  color:white;
  border-radius:9px;
  box-shadow:0 4px 15px #17382b36;
  padding:11px 15px;
  font-size:.87rem;
}

.pair-qr {
  display:block;
  max-width:100%;
  width:200px;
  height:auto;
  margin:auto;
  image-rendering:pixelated;
}

.skip-link:not(:focus) {
  clip-path:inset(50%);
  width:1px;
  height:1px;
  overflow:hidden;
  padding:0;
  white-space:nowrap;
}

.nearby-devices {
  display:grid;
  gap:5px;
  max-height:210px;
  overflow:auto;
  padding:5px;
}

.nearby-devices .button {
  justify-content:start;
}

@media(min-width:1650px) {
  .live-layout {
    grid-template-columns:minmax(300px,.64fr) minmax(0,2fr);
  }
}

@media(max-width:1180px) {
  .sidebar {
    width:192px;
    padding-inline:11px;
  }
  .content {
    margin-left:192px;
    padding-inline:20px;
  }
  .stat {
    padding-inline:12px;
  }
  .stat-icon {
    right:9px;
    width:29px;
    height:29px;
  }
  .live-layout {
    grid-template-columns:minmax(220px,.8fr) minmax(0,1.7fr);
  }
  .card-head {
    padding-inline:14px;
  }
  .stats {
    gap:8px;
  }
}

@media(max-width:900px) {
  .sidebar {
    position:static;
    width:auto;
    height:auto;
    padding:12px 16px 0;
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
  }
  .sidebar .brand {
    margin:0;
    padding:0;
  }
  .sidebar .brand img {
    width:31px;
    height:31px;
  }
  .sidebar nav {
    order:3;
    grid-column:1/-1;
    flex-direction:row;
    overflow:auto;
    gap:3px;
  }
  .sidebar nav a {
    white-space:nowrap;
    padding:9px 10px;
    border-radius:8px 8px 0 0;
  }
  .sidebar nav a .icon {
    width:16px;
    height:16px;
  }
  .nav-divider {
    display:none;
  }
  .account {
    margin:0;
    border:0;
    padding:0;
  }
  .account small,.avatar {
    display:none;
  }
  .content {
    margin:0;
    padding:22px 17px 35px;
  }
  .page-head {
    margin-bottom:16px;
  }
  .live-layout {
    grid-template-columns:minmax(215px,.83fr) minmax(0,1.7fr);
  }
}

@media(max-width:650px) {
  .content {
    padding:18px 12px 30px;
  }
  .sidebar {
    padding-inline:11px;
  }
  .sidebar nav a {
    font-size:.8rem;
    padding:9px 7px;
    gap:5px;
  }
  .sidebar nav a .icon {
    width:15px;
    height:15px;
  }
  .page-head {
    align-items:start;
    gap:5px;
  }
  .page-head p {
    font-size:.81rem;
  }
  .sync {
    gap:5px;
    font-size:.68rem;
  }
  .sync .icon-button {
    width:27px;
    height:27px;
  }
  .stats {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .stat {
    min-height:72px;
    padding:10px 12px;
  }
  .stat strong {
    font-size:1.52rem;
  }
  .stat-name {
    font-size:.76rem;
  }
  .live-layout {
    grid-template-columns:1fr;
    gap:12px;
  }
  .live-layout .map-card {
    grid-row:1;
  }
  .live-layout .map-slot {
    min-height:310px;
  }
  .live-list {
    max-height:330px;
  }
  .filters {
    grid-template-columns:1.2fr 1fr;
  }
  .license-layout {
    grid-template-columns:1fr;
  }
  .report-stats {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .report-stats .stat {
    padding:9px;
  }
  .report-stats .stat-icon {
    display:none;
  }
  .report-bar {
    gap:9px;
    padding:12px;
  }
  .report-bar label:first-child {
    flex:1;
    min-width:140px;
  }
  .exports {
    margin-left:0;
  }
  .card-head {
    min-height:52px;
  }
  .table-wrap th,.table-wrap td {
    padding:10px;
  }
  .detail {
    padding:12px;
  }
  .caption {
    font-size:.75rem;
  }
}

@media(max-width:400px) {
  .sync>span {
    display:none;
  }
  .sidebar nav a .icon {
    display:none;
  }
  .form-grid {
    grid-template-columns:1fr;
  }
  .login-card {
    padding:24px;
  }
  .stat-icon {
    width:26px;
    height:26px;
  }
}

@media print {
  @page {
    size:auto;
    margin:12mm;
  }
  body,:root {
    background:white;
    color:black;
    font-size:11pt;
  }
  .sidebar,.skip-link,.sync,.page-head,.report-bar,.toast,dialog,#error-banner,.maplibregl-ctrl-top-right,.map-notice {
    display:none!important;
  }
  .content {
    margin:0;
    padding:0;
    max-width:none;
    min-height:0;
  }
  .page-view {
    display:none!important;
  }
  #view-report:not([hidden]) {
    display:block!important;
  }
  .report-stats {
    display:flex;
    gap:5mm;
  }
  .report-stats>.stat {
    flex:1;
  }
  .stat-icon {
    display:none;
  }
  .card,.stat {
    border-radius:0;
    margin-bottom:4mm;
  }
  .card {
    overflow:visible;
  }
  .report-map-card {
    break-inside:avoid;
  }
  .report-map-card .map-slot {
    height:70mm;
    min-height:0;
  }
  .table-wrap {
    overflow:visible;
  }
  thead {
    display:table-header-group;
  }
  tr {
    break-inside:avoid;
  }
  .card-head {
    min-height:0;
    padding:6px 10px;
  }
  .card-head,.map-host,.stat {
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
}
