:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #243d3a;
  background: #f6f8f9;
  font-synthesis: none;
  font-size: 14px;
  --green: #1b5750;
  --muted: #798984;
  --line: #e5ebe8;
  --light: #f2f6f4
}

* {
  box-sizing: border-box
}

body {
  margin: 0
}

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

button,
a,
input,
select,
textarea {
  outline-offset: 4px
}

button,
a {
  -webkit-tap-highlight-color: transparent
}

button {
  cursor: pointer
}

button:disabled {
  opacity: .55;
  cursor: wait
}

button {
  border: 0;
  background: none;
  color: inherit
}

a {
  color: var(--green);
  text-decoration: none
}

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

svg {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round
}

button svg {
  flex-shrink: 0
}

.shell {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh
}

.sidebar {
  overflow-y: auto;
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 30px 17px 17px;
  z-index: 20
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-size: 25px;
  font-weight: 730;
  letter-spacing: -1px
}

.brand img {
  width: 33px;
  height: 33px
}

.brand small {
  font-size: 10px;
  background: #edf3ef;
  padding: 3px 5px;
  border-radius: 4px;
  color: #657b72;
  letter-spacing: .4px;
  margin-left: 2px
}

.workspace {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 32px 4px 25px;
  padding: 11px;
  display: flex;
  gap: 10px;
  align-items: center
}

.workspace-icon {
  background: #edf3ef;
  border-radius: 7px;
  padding: 7px;
  color: #638375
}

.workspace strong {
  display: block;
  font-size: 12px
}

.workspace span {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 4px
}

.nav-label {
  color: #98a69f;
  font-size: 9px;
  letter-spacing: 1.6px;
  font-weight: 700;
  padding: 10px 16px
}

.nav-list {
  display: grid;
  gap: 3px
}

.nav {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  width: 100%;
  border-radius: 7px;
  padding: 10px 14px;
  color: #77867f;
  font-size: 12px;
  font-weight: 510
}

.nav.active {
  background: #eaf2ed;
  color: #245b4a;
  font-weight: 650
}

.nav:hover {
  background: #f0f5f2
}

.nav .count {
  margin-left: auto;
  background: #dae8dd;
  border-radius: 4px;
  font-size: 10px;
  padding: 2px 6px
}

.nav.secondary {
  font-size: 11px;
  padding-top: 8px;
  padding-bottom: 8px
}

.nav.secondary svg {
  width: 16px;
  height: 16px
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px
}

.sidebar-note {
  margin: 12px 6px 18px;
  padding: 15px;
  border-radius: 9px;
  background: #f3f6ee;
  font-size: 11px;
  color: #708367;
  line-height: 1.6
}

.sidebar-note strong {
  display: block;
  color: #4a6244;
  margin-bottom: 4px
}

.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 16px 7px 0
}

.avatar {
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ece7dc;
  color: #85734d;
  font-size: 11px;
  font-weight: 650;
  flex-shrink: 0
}

.profile strong {
  font-size: 11px;
  display: block
}

.profile small {
  font-size: 10px;
  color: var(--muted)
}

.profile button {
  margin-left: auto
}

.main {
  grid-column: 2;
  min-width: 0
}

.topbar {
  height: 78px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  gap: 20px
}

.breadcrumb {
  font-size: 11px;
  color: #97a19c;
  display: flex;
  align-items: center;
  gap: 13px
}

.breadcrumb b {
  color: #40564c;
  font-weight: 500
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 20px
}

.global-search {
  border: 0;
  background: transparent;
  width: 180px;
  font-size: 11px;
  color: #586f62
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a49b
}

.kbd {
  font-size: 9px;
  border: 1px solid var(--line);
  padding: 3px 5px;
  border-radius: 4px
}

.top-actions select {
  border: 0;
  background: transparent;
  font-size: 11px;
  color: #667a6e
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6px
}

.dot {
  width: 5px;
  height: 5px;
  position: absolute;
  right: 6px;
  top: 3px;
  background: #d99665;
  border: 1px solid white;
  border-radius: 50%
}

.mobile-menu {
  display: none
}

.content {
  padding: 33px 38px 24px;
  max-width: 1650px;
  margin: auto
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px
}

.eyebrow {
  font-size: 10px;
  color: #94a39a;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px
}

.page-heading h1 {
  font-size: 27px;
  letter-spacing: -.85px;
  line-height: 1.3;
  font-weight: 630
}

.page-heading p {
  font-size: 11px;
  color: #8a9890;
  margin-top: 8px
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #dfe6e1;
  border-radius: 7px;
  background: #fff;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 570;
  white-space: nowrap
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 2px 3px #163c3210
}

.button:hover {
  filter: brightness(.97)
}

.button.danger {
  background: #fff1ef;
  color: #a8443a
}

.button svg {
  width: 15px;
  height: 15px
}

.date-button {
  font-size: 10px;
  color: #6a7d70
}

.welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e9eee3;
  border: 1px solid #e2e8d9;
  border-radius: 11px;
  padding: 24px 27px;
  margin-bottom: 23px;
  min-height: 132px
}

.welcome h2 {
  font-size: 20px;
  font-weight: 560;
  letter-spacing: -.5px;
  margin-bottom: 9px
}

.welcome p {
  font-size: 11px;
  line-height: 1.75;
  color: #798571;
  max-width: 530px
}

.welcome .link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #496c41;
  font-size: 10px;
  font-weight: 650
}

.welcome-art {
  width: 220px;
  height: 108px;
  color: #7c966b;
  position: relative;
  flex-shrink: 0
}

.welcome-art svg {
  height: 110px;
  width: 215px;
  stroke-width: 1.2
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px
}

.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 19px 20px;
  text-align: left;
  min-height: 131px
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7b8c80;
  font-size: 11px
}

.metric-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #edf4ee;
  color: #7f9e80
}

.metric:nth-child(2) .metric-icon {
  background: #f0eef8;
  color: #a395bf
}

.metric:nth-child(3) .metric-icon {
  background: #fff4e7;
  color: #c69d5c
}

.metric:nth-child(4) .metric-icon {
  background: #eaf2f7;
  color: #8aacc1
}

.metric-value {
  font-size: 29px;
  font-weight: 570;
  letter-spacing: -.8px;
  margin: 3px 0 8px
}

.metric-foot {
  font-size: 9px;
  color: #96a197
}

.metric-foot b {
  font-weight: 500;
  color: #6b8d65
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr);
  gap: 22px
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 21px 17px;
  gap: 10px
}

.panel-head h2 {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.1px
}

.panel-head p {
  font-size: 10px;
  color: #98a39b;
  margin-top: 5px
}

.text-button {
  font-size: 10px;
  font-weight: 550;
  color: #7b8e7f;
  display: flex;
  align-items: center;
  gap: 5px
}

.text-button svg {
  width: 13px;
  height: 13px
}

.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  padding: 0 21px
}

.tab {
  font-size: 10px;
  color: #94a196;
  padding: 1px 0 12px;
  position: relative
}

.tab.active {
  color: #3e6550;
  font-weight: 600
}

.tab.active:after {
  content: '';
  position: absolute;
  height: 2px;
  background: #4b7859;
  bottom: -1px;
  left: 0;
  right: 0
}

.tab small {
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 8px;
  background: #f0f4f1;
  margin-left: 4px
}

.table-wrap {
  overflow: auto
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap
}

th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .65px;
  font-weight: 550;
  color: #9da9a1;
  background: #fafbfa;
  padding: 12px 18px;
  border-bottom: 1px solid #edf0ed
}

td {
  padding: 16px 18px;
  font-size: 11px;
  border-bottom: 1px solid #f0f3f0;
  color: #677c6e
}

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

tbody tr.clickable {
  cursor: pointer
}

tbody tr.clickable:hover {
  background: #f7faf7
}

td strong {
  font-size: 11px;
  font-weight: 570;
  color: #3c5747;
  display: block
}

td small {
  font-size: 9px;
  color: #9aa79d;
  display: block;
  margin-top: 5px
}

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

.person .avatar {
  width: 30px;
  height: 30px;
  background: #f0ede6;
  font-size: 9px
}

.person .avatar.v1 {
  background: #e9edf4;
  color: #8596ae
}

.person .avatar.v2 {
  background: #f2e9e7;
  color: #b28f80
}

.person .avatar.v3 {
  background: #ebeee1;
  color: #8b9774
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  padding: 5px 7px;
  background: #f0f3f1;
  color: #829289;
  border-radius: 5px
}

.badge:before {
  content: '';
  height: 4px;
  width: 4px;
  background: currentColor;
  border-radius: 50%
}

.badge.completed,
.badge.active,
.badge.available,
.badge.paid {
  background: #edf5eb;
  color: #78a071
}

.badge.scheduled,
.badge.issued {
  background: #eef2f8;
  color: #8a9dba
}

.badge.en-route,
.badge.arrived {
  background: #fff4e5;
  color: #c39b5e
}

.badge.unassigned,
.badge.maintenance {
  background: #fcf0eb;
  color: #c08a72
}

.panel-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #a1aaa4;
  align-items: center
}

.panel-footer button {
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 6px
}

.map {
  height: 247px;
  background: #edf0e9;
  position: relative;
  overflow: hidden
}

.map svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none
}

.map-label {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #ffffffed;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 8px;
  color: #798775
}

.map-pin {
  fill: #52795b;
  stroke: #fff;
  stroke-width: 3;
  cursor: pointer
}

.map-pin:focus {
  outline: 2px solid #1b5750
}

.map-caption {
  padding: 13px 19px;
  display: flex;
  gap: 18px;
  font-size: 9px;
  color: #8d9b90
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6e8f6a;
  margin-right: 5px
}

.lower-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 22px;
  margin-top: 22px
}

.team-row {
  width: 100%;
  text-align: left;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 10px
}

.team-row .avatar {
  width: 30px;
  height: 30px;
  font-size: 9px
}

.team-row strong {
  font-size: 10px;
  font-weight: 550;
  display: block
}

.team-row small {
  font-size: 9px;
  color: #9ba69e;
  display: block;
  margin-top: 3px
}

.team-row .badge {
  margin-left: auto;
  font-size: 8px
}

.alert-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 19px;
  text-align: left;
  width: 100%
}

.alert-row .alert-icon {
  border-radius: 6px;
  background: #fbf2e6;
  color: #c3a47a;
  padding: 7px
}

.alert-row strong {
  font-size: 10px;
  font-weight: 550;
  display: block;
  margin: 2px 0 6px
}

.alert-row p {
  font-size: 9px;
  color: #9a9f95;
  line-height: 1.6
}

.activity {
  display: flex;
  gap: 11px;
  padding: 9px 20px 15px
}

.activity .activity-dot {
  width: 7px;
  height: 7px;
  border: 2px solid #a4b4a1;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0
}

.activity p {
  font-size: 10px;
  line-height: 1.6;
  color: #7a8a7e
}

.activity small {
  font-size: 8px;
  color: #adb5ad
}

.footer {
  display: flex;
  justify-content: space-between;
  color: #a1aaa4;
  font-size: 9px;
  margin-top: 25px;
  gap: 12px
}

.footer span {
  display: flex;
  align-items: center;
  gap: 5px
}

.footer svg {
  width: 12px;
  height: 12px
}

.toolbar {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  flex-wrap: wrap
}

.toolbar input,
.toolbar select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 11px;
  font-size: 11px;
  color: #526c5b
}

.toolbar input[type=search] {
  min-width: 230px
}

.empty {
  text-align: center;
  padding: 50px 20px;
  color: #8b9d90;
  font-size: 12px;
  line-height: 1.8
}

.empty strong {
  color: #41634d;
  display: block
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px
}

.settings-section {
  padding: 23px
}

.settings-section h2 {
  font-size: 15px;
  margin-bottom: 9px
}

.settings-section>p {
  color: #8b998e;
  font-size: 11px;
  line-height: 1.7;
  margin-bottom: 18px
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eef2ee;
  padding: 10px 0;
  font-size: 12px
}

.toggle-row input {
  accent-color: var(--green);
  width: 17px;
  height: 17px
}

.settings-section textarea {
  width: 100%;
  min-height: 130px
}

.setting-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap
}

.settings-section pre {
  font-size: 10px;
  overflow: auto;
  max-height: 200px;
  white-space: pre-wrap
}

.notice {
  background: #f4f6ec;
  border: 1px solid #e6eadb;
  border-radius: 7px;
  padding: 13px 15px;
  color: #7c896a;
  font-size: 11px;
  line-height: 1.7;
  margin-bottom: 20px
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr
}

.login-story {
  background: #1c524a;
  color: #fff;
  padding: 65px 12%;
  display: flex;
  flex-direction: column;
  justify-content: space-between
}

.login-story .brand {
  padding: 0;
  color: #fff
}

.login-story h1 {
  font-size: 58px;
  letter-spacing: -2px;
  line-height: 1.1;
  font-weight: 520
}

.login-story p {
  font-size: 15px;
  color: #b6ccc0;
  line-height: 1.9;
  margin-top: 25px;
  max-width: 350px
}

.login-story small {
  font-size: 11px;
  color: #b6ccc0
}

.login-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px
}

.login-form {
  width: 340px
}

.login-form h2 {
  font-size: 26px;
  letter-spacing: -.7px
}

.login-form>p {
  margin: 12px 0 30px;
  color: #8c9b91;
  font-size: 12px;
  line-height: 1.7
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px
}

.field label {
  font-size: 11px;
  color: #687d6e;
  font-weight: 550
}

.field input,
.field select,
.field textarea {
  border: 1px solid #dfe6e0;
  border-radius: 6px;
  background: #fff;
  padding: 11px;
  color: #344f3e;
  width: 100%;
  min-width: 0
}

.field textarea {
  min-height: 100px;
  resize: vertical
}

.login-form .button {
  width: 100%;
  padding: 13px
}

.error {
  color: #b45646;
  font-size: 11px;
  line-height: 1.7;
  margin: 12px 0;
  min-height: 18px
}

.login-hint {
  font-size: 10px;
  color: #8d9d91;
  line-height: 1.8;
  margin-top: 22px
}

.loading {
  padding: 100px;
  text-align: center;
  color: #879889
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: 600px;
  max-width: calc(100vw - 30px);
  max-height: 90vh;
  color: #294634;
  box-shadow: 0 25px 100px #19382433
}

dialog::backdrop {
  background: #183f3655;
  backdrop-filter: blur(3px)
}

.dialog-head {
  padding: 22px 25px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line)
}

.dialog-head h2 {
  font-size: 19px;
  letter-spacing: -.3px
}

.dialog-body {
  padding: 22px 25px
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px
}

.field.wide {
  grid-column: 1/-1
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 16px;
  border-top: 1px solid var(--line)
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px
}

.detail-grid dt {
  font-size: 10px;
  color: #99a69c;
  margin-bottom: 7px
}

.detail-grid dd {
  font-size: 12px;
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap
}

.detail-grid .wide {
  grid-column: 1/-1
}

.detail-total {
  display: flex;
  gap: 20px;
  background: #f3f7f2;
  padding: 15px;
  margin: 20px 0;
  border-radius: 8px;
  font-size: 11px
}

.detail-total strong {
  display: block;
  margin-top: 6px;
  font-size: 17px
}

.detail-section {
  margin: 25px 0
}

.detail-section h3 {
  font-size: 12px;
  margin-bottom: 12px
}

.detail-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.8
}

.detail-item small {
  color: #98a69b
}

.portal-hero {
  background: #e9eee3;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 22px
}

.portal-hero h2 {
  font-size: 24px;
  font-weight: 550
}

.portal-hero p {
  margin-top: 10px;
  color: #829279;
  line-height: 1.8
}

.portal-tracking {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0
}

.tracking-step {
  flex: 1;
  border-top: 3px solid #dce4d9;
  padding-top: 12px;
  font-size: 11px;
  color: #95a28e
}

.tracking-step.done {
  border-color: #61825a;
  color: #53794a
}

.eta {
  font-size: 38px;
  letter-spacing: -1px;
  margin-top: 20px
}

.eta small {
  font-size: 13px;
  letter-spacing: 0;
  color: #809575;
  margin-left: 12px
}

.message-card {
  padding: 20px;
  border-bottom: 1px solid var(--line)
}

.message-card h3 {
  font-size: 13px;
  margin: 8px 0
}

.message-card p {
  font-size: 12px;
  line-height: 1.9;
  color: #788a7d;
  white-space: pre-wrap
}

.message-card small {
  font-size: 10px;
  color: #94a198
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #214e40;
  color: #fff;
  padding: 13px 22px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 100;
  transition: transform .2s;
  max-width: 90vw
}

#toast.show {
  transform: translateX(-50%) translateY(0)
}

.route-panel {
  margin-bottom: 20px
}

.proposal-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.8
}

.search-result {
  padding: 15px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between
}

.search-result small {
  color: #95a090;
  font-size: 10px
}

@media(min-width:1500px) {
  .content {
    padding-top: 40px
  }

  .welcome {
    min-height: 150px
  }

  .metric {
    min-height: 148px
  }

  .map {
    height: 264px
  }

  td {
    padding-top: 19px;
    padding-bottom: 19px
  }

  .lower-grid .panel {
    min-height: 230px
  }
}

@media(max-width:1150px) {
  .shell {
    grid-template-columns: 205px 1fr
  }

  .sidebar {
    width: 205px;
    padding-left: 10px;
    padding-right: 10px
  }

  .content {
    padding: 25px
  }

  .topbar {
    padding: 0 25px
  }

  .metrics {
    gap: 10px
  }

  .metric {
    padding: 15px
  }

  .dashboard-grid {
    grid-template-columns: 1fr
  }

  .lower-grid {
    grid-template-columns: 1fr 1fr
  }

  .lower-grid .panel:last-child {
    grid-column: 1/-1
  }

  .welcome-art {
    width: 170px
  }

  .welcome-art svg {
    width: 170px
  }

  .global-search {
    width: 130px
  }

  .section-grid {
    grid-template-columns: 1fr
  }

  .map {
    height: 240px
  }
}

@media(max-width:760px) {
  .shell {
    display: block
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s;
    box-shadow: 8px 0 30px #163e3115;
    width: 230px;
    overflow: auto
  }

  .sidebar.open {
    transform: translateX(0)
  }

  .main {
    width: 100%
  }

  .topbar {
    height: 62px;
    padding: 0 18px
  }

  .mobile-menu {
    display: block
  }

  .breadcrumb {
    display: none
  }

  .top-actions {
    gap: 12px
  }

  .kbd {
    display: none
  }

  .content {
    padding: 24px 16px
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px
  }

  .page-heading h1 {
    font-size: 25px
  }

  .heading-actions {
    width: 100%;
    justify-content: space-between
  }

  .welcome {
    padding: 21px
  }

  .welcome h2 {
    font-size: 18px
  }

  .welcome-art {
    display: none
  }

  .metrics {
    grid-template-columns: 1fr 1fr
  }

  .metric-value {
    font-size: 25px
  }

  .metric {
    min-height: 125px
  }

  .dashboard-grid,
  .lower-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px
  }

  .lower-grid .panel:last-child {
    grid-column: auto
  }

  .footer {
    font-size: 8px;
    flex-wrap: wrap
  }

  .login {
    display: block
  }

  .login-story {
    padding: 25px
  }

  .login-story h1 {
    font-size: 35px;
    margin-top: 30px
  }

  .login-story p,
  .login-story small {
    display: none
  }

  .login-card {
    padding: 35px 25px
  }

  .form-grid {
    grid-template-columns: 1fr
  }

  .field.wide {
    grid-column: auto
  }

  .detail-grid {
    gap: 18px
  }

  .portal-tracking {
    flex-wrap: wrap
  }

  .tracking-step {
    min-width: 40%
  }

  .toolbar input[type=search] {
    min-width: 140px;
    flex: 1
  }

  .global-search {
    width: 120px
  }
}

/* Theme surfaces and semantic states are shared by all modules and dialogs. */
.badge.sgb-v { background: #edf1fb; color: #375987; }
.badge.sgb-xi { background: #eaf4ec; color: #366547; }
.badge.example { background: #fff0db; color: #8a510c; }
.badge.published-reference { background: #f0ecf7; color: #665082; }
[data-theme="dark"] .badge.sgb-v { background: #293b4f; color: #b4cfee; }
[data-theme="dark"] .badge.sgb-xi { background: #264735; color: #ace0b9; }
[data-theme="dark"] .badge.example { background: #493d29; color: #e9c48b; }
[data-theme="dark"] .badge.published-reference { background: #3a304c; color: #cebaec; }
:root { color-scheme: light; }
.theme-toggle { width: 34px; height: 34px; flex-shrink: 0; border-radius: 7px; }
.theme-toggle:hover { background: var(--light); }
.theme-sun { display: none; }
.login-card { position: relative; }
.login-card > .theme-toggle { position: absolute; top: 22px; right: 24px; }
:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e0ebe7;
  background: #101a19;
  --green: #94d3b6;
  --muted: #a4b8ae;
  --line: #334740;
  --light: #243a32;
}
[data-theme="dark"] .theme-sun { display: block; }
[data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] :is(.sidebar, .topbar, .panel, .metric, dialog) {
  background: #182623;
  color: #e0ebe7;
}
[data-theme="dark"] :is(.button, .field input, .field select, .field textarea, .toolbar input, .toolbar select) {
  background: #20322c;
  color: #e0ebe7;
  border-color: var(--line);
}
[data-theme="dark"] :is(.field input, .field select, .field textarea) { background: #12211c; }
[data-theme="dark"] :is(.global-search, .top-actions select) { color: #c3d5cb; }
[data-theme="dark"] option { background: #182623; color: #e0ebe7; }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #a4b8ae; opacity: 1; }
[data-theme="dark"] .button.primary { background: #30765d; color: #fff; border-color: #438b70; }
[data-theme="dark"] .button.danger { background: #492c2a; color: #ffb9ac; }
[data-theme="dark"] :is(.welcome, .portal-hero, .sidebar-note, .notice, .detail-total) {
  background: #26382e;
  color: #c7d8bb;
  border-color: #3d5140;
}
[data-theme="dark"] :is(.welcome p, .portal-hero p, .sidebar-note strong, .welcome .link, .eta small) { color: #bfd5af; }
[data-theme="dark"] .welcome-art { opacity: .7; }
[data-theme="dark"] :is(.brand small, .workspace-icon, .nav .count, .tab small) { background: #2b4137; color: #b3d1be; }
[data-theme="dark"] .nav { color: #b3c7bb; }
[data-theme="dark"] :is(.nav.active, .nav:hover) { background: #294638; color: #c4ebd5; }
[data-theme="dark"] :is(.breadcrumb b, td strong, .empty strong, .tab.active) { color: #d4e7da; }
[data-theme="dark"] :is(.nav-label, .breadcrumb, .eyebrow, .page-heading p, .metric-head, .metric-foot, .panel-head p, .text-button, .tab, th, td small, .panel-footer, .map-caption, .team-row small, .alert-row p, .activity small, .footer, .settings-section > p, .login-form > p, .login-hint, .detail-grid dt, .detail-item small, .message-card small, .search-result small, .date-button) { color: #a8bfb0; }
[data-theme="dark"] :is(td, .field label, .activity p, .message-card p, .empty) { color: #c0d1c5; }
[data-theme="dark"] :is(td, th, .toggle-row) { border-color: var(--line); }
[data-theme="dark"] th { background: #14211c; }
[data-theme="dark"] tbody tr.clickable:hover { background: #243c2f; }
[data-theme="dark"] :is(.metric-icon, .avatar, .person .avatar, .badge) { background: #2c4035; color: #c7d8b9; }
[data-theme="dark"] :is(.person .avatar.v1, .metric:nth-child(4) .metric-icon, .badge.scheduled, .badge.issued) { background: #293b4f; color: #b4cfee; }
[data-theme="dark"] :is(.person .avatar.v2, .badge.unassigned, .badge.maintenance) { background: #4a332d; color: #eeb9a3; }
[data-theme="dark"] .person .avatar.v3 { background: #39422b; color: #cad8aa; }
[data-theme="dark"] .metric:nth-child(2) .metric-icon { background: #3a304c; color: #cebaec; }
[data-theme="dark"] :is(.metric:nth-child(3) .metric-icon, .alert-row .alert-icon, .badge.en-route, .badge.arrived) { background: #493d29; color: #e9c48b; }
[data-theme="dark"] :is(.badge.completed, .badge.active, .badge.available, .badge.paid) { background: #264735; color: #ace0b9; }
[data-theme="dark"] :is(.metric-foot b, .tracking-step.done) { color: #9ed7ad; }
[data-theme="dark"] .tracking-step { color: #b0c2ad; border-color: #4b5b47; }
[data-theme="dark"] .tracking-step.done { border-color: #92cda0; }
[data-theme="dark"] .tab.active:after { background: #94d3b6; }
[data-theme="dark"] .error { color: #ffb0a1; }
[data-theme="dark"] .login-story { background: #162f28; }
[data-theme="dark"] dialog::backdrop { background: #030a08b3; }
[data-theme="dark"] .dot { border-color: #182623; }
[data-theme="dark"] .map { background: #1d3028; }
[data-theme="dark"] .map svg > rect { fill: #1d3028; }
[data-theme="dark"] .map path[stroke="#e2e7dc"] { stroke: #304638; }
[data-theme="dark"] .map path[stroke="#f9faf6"] { stroke: #3b5042; }
[data-theme="dark"] .map path[stroke="#d3e3e3"] { stroke: #2e4b50; }
[data-theme="dark"] .map-pin { fill: #86bb95; stroke: #1d3028; }
[data-theme="dark"] .map-label { background: #182623ed; color: #bfd5b8; }
[data-theme="dark"] :focus-visible { outline: 2px solid #ace0b9; }
@media (max-width: 760px) {
  .top-actions { gap: 8px; min-width: 0; }
  .global-search { width: 100%; min-width: 0; }
  .top-actions .search-wrap { min-width: 0; flex: 1; }
  .top-actions > .avatar { display: none; }
}

.profile-tabs { flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.profile-panel { padding: 24px; }
.profile-filters { flex-wrap: wrap; padding: 0 0 20px; }
.profile-filters label { display: grid; gap: 6px; font-size: 12px; }
.care-card { border-bottom: 1px solid var(--line); padding: 20px 0; }
.care-card p { white-space: pre-wrap; }
.care-card-heading { display: flex; justify-content: space-between; gap: 16px; }
.care-card .text-button { text-align: left; }
.choice-list { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.choice-list label { display: flex; align-items: center; gap: 8px; padding: 5px; font-weight: normal; }
.choice-list input { width: auto; min-height: auto; }
.route-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 16px; margin-bottom: 20px; }
.route-card { padding: 20px; }
.route-card li { padding: 10px 0; }
.route-card small { display: block; line-height: 1.6; }
.badge.on-hold,.badge.review-due { background: #fff0cd; color: #79560d; }
