@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
:root {
  font-family: "DM Sans", sans-serif;
  color: #203b34;
  background: #f4f6f2;
  font-synthesis: none;
  --paper: #fff;
  --bg: #f4f6f2;
  --ink: #203b34;
  --muted: #718079;
  --line: #e2e8e0;
  --green: #245f4e;
  --soft: #e8f0e7;
  --amber: #896322;
  --amber-bg: #faf0d9;
  --red: #ad4141;
  --shadow: 0 12px 35px #233f3210;
}
* {
  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 {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #9dbd69;
  outline-offset: 3px;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3,
.brand {
  font-family: Manrope, sans-serif;
}
h1 {
  font-size: 30px;
  letter-spacing: -1.1px;
  line-height: 1.25;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.65;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
}
a {
  color: var(--green);
}
svg {
  vertical-align: middle;
}
button svg {
  flex-shrink: 0;
}
.shell {
  max-width: 1500px;
  margin: auto;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  padding: 35px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.7px;
}
.brandmark {
  height: 39px;
  width: 39px;
  display: grid;
  place-items: center;
  background: #1c493c;
  color: #e4eec4;
  border-radius: 12px;
  font-family: Georgia, serif;
  font-size: 27px;
}
.brand small {
  display: block;
  letter-spacing: 2px;
  font-size: 8px;
  text-transform: uppercase;
  margin-top: 3px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: 10px;
  font-size: 14px;
}
.nav button.active {
  color: var(--green);
  background: var(--soft);
  font-weight: 700;
}
.sidebar-foot {
  margin-top: auto;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 88px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  gap: 16px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  height: 38px;
  width: 38px;
  display: grid;
  place-items: center;
  background: #e8ebdf;
  color: #4b6355;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
}
.user b {
  font-size: 12px;
  display: block;
}
.user small {
  font-size: 10px;
}
.content {
  padding: 35px 42px 60px;
  max-width: 1190px;
  margin: auto;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 17px;
  background: var(--green);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
}
.button.secondary {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}
.button.quiet {
  background: var(--soft);
  color: var(--green);
}
.button.danger {
  background: #f9e9e5;
  color: var(--red);
}
.icon-button {
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 25px;
}
.stat {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 19px;
  text-align: left;
  color: var(--ink);
}
.stat .number {
  display: block;
  font-family: Manrope, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 14px 0 7px;
}
.stat .label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.stat small {
  font-size: 10px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 23px;
  min-width: 0;
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.card-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.hero {
  background: #1c493c;
  color: #f7f8ee;
  border: 0;
  position: relative;
  overflow: hidden;
  padding: 29px;
}
.hero:after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border: 1px solid #ffffff18;
  border-radius: 50%;
  right: -70px;
  top: -60px;
  pointer-events: none;
  box-shadow:
    0 0 0 35px #ffffff06,
    0 0 0 70px #ffffff04;
}
.hero h2 {
  font-size: 26px;
  margin: 17px 0 10px;
}
.hero p {
  color: #c5d5c7;
  font-size: 13px;
  max-width: 400px;
}
.hero .eyebrow {
  color: #c2d8a0;
}
.hero .button {
  background: #dcebb6;
  color: #224335;
  margin-top: 25px;
}
.hero small {
  color: #c5d5c7;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--soft);
  color: var(--green);
  white-space: nowrap;
}
.badge.pending,
.badge.clarification,
.badge.outside,
.badge.poor_accuracy,
.badge.missing,
.badge.unconfigured,
.badge.manual,
.badge.legacy {
  background: var(--amber-bg);
  color: var(--amber);
}
.badge.rejected,
.badge.suspended {
  background: #f9e9e5;
  color: var(--red);
}
.badge.active:before {
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  text-align: left;
  font-weight: 600;
  padding: 12px 10px;
  background: var(--bg);
}
td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
}
td b {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
tr[data-visit] {
  cursor: pointer;
}
tr[data-visit]:hover {
  background: var(--bg);
}
.text-button {
  background: none;
  border: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
  padding: 8px;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters input,
.filters select {
  width: auto;
  flex: 1;
  min-width: 130px;
  font-size: 12px;
  padding: 11px;
}
.filters label {
  font-size: 10px;
  flex: 1;
  min-width: 125px;
}
.filters label input {
  width: 100%;
  margin-top: 5px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border: 0;
}
.row strong {
  font-size: 13px;
  display: block;
  margin-bottom: 5px;
}
.row p {
  font-size: 12px;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}
.empty svg {
  display: block;
  margin: 0 auto 15px;
  color: #9cae9c;
}
.bar-row {
  margin: 16px 0;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 9px;
}
.bar-track {
  height: 7px;
  background: var(--bg);
  border-radius: 5px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #72987b;
  border-radius: 5px;
}
.bar-row:nth-child(2n) .bar-fill {
  background: #bacb8c;
}
.note {
  padding: 14px 17px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--green);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.note.warning {
  background: var(--amber-bg);
  color: var(--amber);
}
.note.error {
  background: #f9e9e5;
  color: var(--red);
}
form {
  display: grid;
  gap: 18px;
}
label {
  font-size: 12px;
  color: var(--ink);
  display: grid;
  gap: 8px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-error {
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
}
.form-card {
  max-width: 680px;
  margin: auto;
}
.location-box {
  padding: 17px;
  border: 1px dashed #9db79d;
  border-radius: 12px;
  background: var(--bg);
}
.location-box p {
  font-size: 12px;
  margin: 10px 0;
  color: var(--muted);
}
.step-label {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 600;
}
.step-label span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.detail-grid dt {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 7px;
}
.detail-grid dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.detail-grid .wide {
  grid-column: 1/-1;
}
.location-map {
  height: 260px;
  background: #edf0e6;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
  position: relative;
}
.location-map > svg {
  width: 100%;
  height: 100%;
}
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #235f4d;
  margin-right: 5px;
}
.legend .arrival {
  background: #c58c31;
}
.legend .departure {
  background: #6d76a7;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  font-size: 12px;
}
.loading {
  text-align: center;
  padding: 20vh 20px;
  color: var(--muted);
}
.loading .brandmark {
  margin: 0 auto 20px;
}
.loading h1 {
  color: var(--ink);
  margin-bottom: 10px;
}
.mobile-brand {
  display: none;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.tabs button {
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
}
.tabs button.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 95px;
  transform: translateX(-50%);
  z-index: 100;
  background: #203b34;
  color: #fff;
  border-radius: 12px;
  padding: 13px 20px;
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 90vw;
  display: none;
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  width: min(550px, 94vw);
  padding: 25px;
  max-height: 88vh;
}
dialog::backdrop {
  background: #162c2966;
}
dialog .card-head {
  margin-bottom: 25px;
}
.subtle {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.timeline {
  border-left: 2px solid var(--line);
  padding-left: 18px;
  margin-left: 5px;
}
.timeline .event {
  padding: 0 0 22px;
  position: relative;
}
.timeline .event:before {
  content: "";
  position: absolute;
  left: -23px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8da18d;
}
.timeline p {
  font-size: 12px;
}
.timeline small {
  display: block;
  margin-top: 6px;
}
.welcome {
  max-width: 450px;
  margin: 10vh auto;
  padding: 30px;
}
.welcome h1 {
  margin: 25px 0 12px;
}
.welcome p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 25px;
}
.wide {
  grid-column: 1/-1;
}
.linkrow {
  color: var(--green);
  text-decoration: none;
}
.busy {
  opacity: 0.65;
  pointer-events: none;
}
@media (min-width: 1200px) {
  .home-grid {
    grid-template-columns: 1.35fr 1fr;
  }
  .stats {
    gap: 18px;
  }
  .content {
    padding-top: 40px;
  }
}
@media (max-width: 1000px) {
  .shell {
    grid-template-columns: 195px 1fr;
  }
  .sidebar {
    padding: 28px 14px;
  }
  .content {
    padding: 28px 24px 50px;
  }
  .topbar {
    padding: 0 24px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid {
    gap: 15px;
  }
  .brand {
    font-size: 21px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    height: auto;
    width: 100%;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    z-index: 20;
    border: 0;
    border-top: 1px solid var(--line);
    background: var(--paper);
  }
  .sidebar > .brand,
  .sidebar-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    justify-content: space-around;
    gap: 1px;
  }
  .nav button {
    flex: 1;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    padding: 9px 3px;
    font-size: 9px;
    border-radius: 8px;
  }
  .nav svg {
    width: 19px;
    height: 19px;
  }
  .topbar {
    height: 76px;
    padding: 0 20px;
    padding-top: env(safe-area-inset-top);
  }
  .breadcrumb {
    display: none;
  }
  .mobile-brand {
    display: flex;
  }
  .mobile-brand .brandmark {
    width: 32px;
    height: 32px;
    font-size: 23px;
  }
  .mobile-brand.brand {
    font-size: 19px;
  }
  .user b {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user small {
    font-size: 9px;
  }
  .content {
    padding: 25px 18px 115px;
  }
  .heading {
    margin-bottom: 22px;
    align-items: flex-start;
    gap: 12px;
  }
  .heading h1 {
    font-size: 25px;
  }
  .heading p {
    font-size: 12px;
  }
  .heading > .button {
    padding: 10px;
    font-size: 11px;
  }
  .grid,
  .home-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 15px;
  }
  .stat .number {
    font-size: 27px;
    margin: 10px 0 5px;
  }
  .card {
    padding: 19px;
    border-radius: 13px;
    margin-bottom: 16px;
  }
  .hero {
    padding: 24px;
  }
  .hero h2 {
    font-size: 24px;
  }
  .grid > .card {
    margin-bottom: 0;
  }
  .grid {
    margin-bottom: 16px;
  }
  .card-head {
    margin-bottom: 16px;
  }
  .filters {
    gap: 8px;
  }
  .filters input,
  .filters select {
    min-width: 120px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    gap: 17px;
  }
  .user .avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
  .welcome {
    margin: 4vh auto;
  }
  .location-map {
    height: 220px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .content {
    animation: enter 0.2s ease;
  }
  @keyframes enter {
    from {
      opacity: 0.5;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  button {
    transition:
      background 0.15s,
      opacity 0.15s;
  }
}
:root[data-theme="dark"] {
  --paper: #1c2925;
  --bg: #14211d;
  --ink: #e2e9de;
  --muted: #a2b2a7;
  --line: #344139;
  --green: #9bc39c;
  --soft: #2b4135;
  --amber: #dfc17b;
  --amber-bg: #443b27;
  background: var(--bg);
  color: var(--ink);
}
[data-theme="dark"] .button {
  background: #9bc39c;
  color: #14211d;
}
[data-theme="dark"] .hero {
  background: #254c3e;
}
[data-theme="dark"] .location-map {
  background: #dce5d5;
}
[data-theme="dark"] .brandmark {
  background: #dcebb6;
  color: #1c493c;
}
[data-theme="dark"] .avatar {
  background: #344c3d;
  color: #dcebb6;
}

.leaflet-container { z-index: 0; }

/* Compact task navigation and contained filters. */
.heading { margin-bottom: 20px; }
.heading h1 { font-size: 27px; }
.heading .eyebrow { font-size: 9px; letter-spacing: 1px; margin-bottom: 7px; }
.tabs { flex-wrap: nowrap; gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; position: relative; }
.tabs > button, .more-nav > summary { border: 0; background: transparent; min-height: 44px; padding: 10px 14px; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 9px; white-space: nowrap; }
.tabs > button.active, .more-nav > summary.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px #00000012; }
.more-nav { margin-left: auto; }
.more-nav > summary { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: 200px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.more-menu button { display: block; width: 100%; text-align: left; min-height: 44px; }
.more-menu button:hover, .more-menu button[aria-current] { background: var(--soft); color: var(--ink); }
.filter-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin-bottom: 18px; }
.filter-panel > summary { cursor: pointer; list-style: none; min-height: 48px; padding: 12px 15px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.filter-panel > summary::after { content: '+'; margin-left: auto; font-size: 20px; color: var(--muted); }
.filter-panel[open] > summary::after { content: '−'; }
.filter-period { color: var(--muted); font-weight: 400; margin-left: 6px; }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; padding: 0 15px 15px; margin: 0; gap: 12px; }
.filters > input[name="search"] { grid-column: 1 / -1; }
.filters input, .filters select, .filters label { min-width: 0; width: 100%; margin: 0; font-size: 13px; }
.filters label input { margin: 0; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.filter-actions .button { flex: 1; }
input, select, textarea { min-width: 0; max-width: 100%; }
input[type="date"], input[type="datetime-local"] { appearance: none; -webkit-appearance: none; min-height: 46px; }
input::-webkit-date-and-time-value { text-align: left; }
summary:focus-visible { outline: 3px solid #9dbd69; outline-offset: 3px; }
.text-button { min-height: 44px; }
.row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.row > :last-child { flex-shrink: 0; }
.row > div:last-child:not(:first-child) { display: flex; align-items: flex-end; flex-direction: column; gap: 4px; }
.request-action { margin-bottom: 18px; }
[data-theme="dark"] .button.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .button.quiet { background: var(--soft); color: var(--green); }
[data-theme="dark"] .button.danger { background: #472d2c; color: #ffb3ab; }
[data-theme="dark"] .badge.rejected, [data-theme="dark"] .badge.suspended, [data-theme="dark"] .note.error { background: #472d2c; color: #ffb3ab; }
[data-theme="dark"] { color-scheme: dark; --red: #ffb3ab; }
@media (max-width: 700px) {
  .topbar { height: 65px; padding-left: 16px; padding-right: 16px; }
  .content { padding: 20px 16px calc(110px + env(safe-area-inset-bottom)); }
  .heading h1 { font-size: 24px; }
  .heading { margin-bottom: 18px; }
  .user .avatar { display: none; }
  .icon-button { width: 44px; height: 44px; }
  .tabs > button, .more-nav > summary { font-size: 12px; padding: 10px 8px; }
  .tabs > button { flex: 1; }
  .more-nav { flex: 1; margin-left: 0; }
  .more-nav > summary { height: 100%; }
  .stat { padding: 15px; border-radius: 12px; }
  .stat .label { font-size: 12px; align-items: center; }
  .stat .number { margin: 10px 0 0; }
  .button { font-size: 14px; }
  input, select, textarea, .filters input, .filters select { font-size: 16px; }
  .card { padding: 16px; }
  .visit-table, .visit-table tbody { display: block; white-space: normal; }
  .visit-table thead { display: none; }
  .visit-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .visit-table tr:first-child { padding-top: 0; }
  .visit-table tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .visit-table td { border: 0; padding: 0; font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
  .visit-table td:first-child { grid-column: 1 / -1; }
  .visit-table td:first-child b { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; margin-bottom: 5px; }
  .visit-table td:nth-child(2) { grid-column: 1 / -1; color: var(--muted); }
  .visit-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
  .visit-table td:nth-child(4), .visit-table td:last-child { text-align: right; }
  .visit-table td:nth-child(5) { align-self: center; }
  .visit-table .text-button { padding: 10px 0 10px 12px; }
  .pagination { flex-wrap: wrap; font-size: 11px; }
  .pagination .button { padding: 10px 12px; font-size: 12px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  dialog { padding: 20px; max-height: 85dvh; }
}

/* Eskedan Properties: navy #141F35 and orange #FFA310. */
:root {
  --paper: #ffffff; --bg: #f4f6fa; --ink: #141f35;
  --muted: #627087; --line: #dfe4ec; --green: #885000;
  --soft: #fff1d8; --amber: #885000; --amber-bg: #fff1d8;
  --shadow: 0 12px 35px #141f3514;
  color: var(--ink); background: var(--bg); color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #18243a; --bg: #101827; --ink: #f0f3f9;
  --muted: #a5b1c5; --line: #2d3a51; --green: #ffa310;
  --soft: #342b20; --amber: #ffc56b; --amber-bg: #3b2e1d;
  --shadow: 0 12px 35px #00000030;
  color: var(--ink); background: var(--bg); color-scheme: dark;
}
.brand-logo { display: block; width: 180px; max-width: 100%; height: auto; background: #fff; padding: 9px 12px; border-radius: 9px; }
.loading .brand-logo { margin: 0 auto 20px; }
.brandmark, [data-theme="dark"] .brandmark { background: #ffa310; color: #141f35; }
.button, [data-theme="dark"] .button { background: #ffa310; color: #141f35; }
.button.secondary, [data-theme="dark"] .button.secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.button.quiet, [data-theme="dark"] .button.quiet { background: var(--soft); color: var(--green); }
.button.danger { background: #f9e9e5; color: #ad4141; }
[data-theme="dark"] .button.danger { background: #472d2c; color: #ffb3ab; }
.hero, [data-theme="dark"] .hero { background: #141f35; color: #f0f3f9; border: 1px solid #2d3a51; }
.hero p, .hero small { color: #bdc8dc; }
.hero .eyebrow { color: #ffc56b; }
.hero .button { background: #ffa310; color: #141f35; }
.avatar, [data-theme="dark"] .avatar { background: var(--soft); color: var(--green); }
.bar-fill { background: #ffa310; }
.bar-row:nth-child(2n) .bar-fill { background: #b97919; }
.empty svg { color: var(--muted); }
.location-box { border-color: var(--line); }
.tabs > button.active, .more-nav > summary.active { color: var(--green); }
#toast { background: #141f35; color: #fff; border: 1px solid #2d3a51; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline-color: #ffa310; }
@media (max-width: 700px) {
  .mobile-brand .brand-logo { width: 122px; padding: 7px 8px; border-radius: 7px; }
  .topbar { gap: 10px; }
  .user { gap: 7px; }
  .user b { max-width: 90px; }
  .user .icon-button { width: 40px; min-width: 40px; }
}
@media (max-width: 370px) {
  .mobile-brand .brand-logo { width: 105px; }
  .user b { max-width: 65px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
}

/* Use the supplied transparent artwork directly on each theme surface. */
.brand-art { display: block; width: 170px; flex-shrink: 0; }
.brand-art .brand-logo { width: 100%; height: auto; max-width: none; padding: 0; border-radius: 0; background: transparent; margin: 0; }
.brand-art .logo-dark { display: none; }
[data-theme="dark"] .brand-art .logo-light { display: none; }
[data-theme="dark"] .brand-art .logo-dark { display: block; }
.loading .brand-art { width: 190px; margin: 0 auto 28px; }
.loading p { font-size: 13px; }
.welcome .brand-art { width: 170px; }
@media (max-width: 700px) {
  .mobile-brand .brand-art { width: 32px; height: 36px; overflow: hidden; }
  .mobile-brand .brand-art .brand-logo { width: auto; height: 36px; max-width: none; padding: 0; border-radius: 0; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .user { gap: 10px; }
  .user b { max-width: 140px; }
}
@media (max-width: 370px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .user b { max-width: 100px; }
}
