:root {
  --bhkh-ink: #21312f;
  --bhkh-muted: #687876;
  --bhkh-line: #dbe4e1;
  --bhkh-canvas: #f3f7f6;
  --bhkh-surface: #ffffff;
  --bhkh-green: #2f6b58;
  --bhkh-green-dark: #204d40;
  --bhkh-blue: #477691;
  --bhkh-gold: #c58a2b;
  --bhkh-coral: #b85f50;
  --bhkh-soft-green: #eaf3ef;
  --bhkh-soft-blue: #eaf1f5;
  --bhkh-soft-gold: #f8f0df;
  --bhkh-soft-coral: #f7ebe8;
  --bhkh-shadow: 0 8px 24px rgba(39, 65, 60, .07);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  background: var(--bhkh-canvas);
  color: var(--bhkh-ink);
  font-family: Inter, Aptos, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

a {
  color: var(--bhkh-green);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--bhkh-green-dark);
}

.app-container {
  max-width: 1180px;
}

.app-main {
  min-height: calc(100vh - 142px);
  padding-bottom: 3.5rem;
}

.site-header {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--bhkh-line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .navbar {
  min-height: 68px;
  padding: .55rem 0;
}

.brand {
  align-items: center;
  color: var(--bhkh-ink);
  display: inline-flex;
  gap: .75rem;
  text-decoration: none;
}

.brand:hover {
  color: var(--bhkh-ink);
}

.brand-mark {
  background: var(--bhkh-green-dark);
  border-radius: 7px;
  display: grid;
  flex: 0 0 36px;
  gap: 3px;
  grid-template-columns: repeat(2, 1fr);
  height: 36px;
  padding: 7px;
  width: 36px;
}

.brand-mark span {
  background: #fff;
  border-radius: 2px;
}

.brand-mark span:nth-child(2) {
  background: #e7c577;
}

.brand-mark span:nth-child(3) {
  background: #8db2c3;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1.02rem;
  font-weight: 800;
}

.brand-copy small {
  color: var(--bhkh-muted);
  font-size: .7rem;
  margin-top: .25rem;
}

.site-nav {
  align-items: center;
  gap: .45rem;
}

.site-nav .nav-link {
  border-radius: 6px;
  color: #4c5d5a;
  font-size: .9rem;
  font-weight: 650;
  padding: .65rem .8rem;
}

.site-nav .nav-link:hover {
  background: #f1f5f4;
  color: var(--bhkh-green-dark);
}

.site-nav .nav-link.active {
  background: var(--bhkh-soft-green);
  color: var(--bhkh-green-dark);
}

.navbar-toggler {
  border-color: var(--bhkh-line);
  border-radius: 6px;
}

.workspace-header {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  padding: 3rem 0 1.75rem;
}

.workspace-header h1 {
  font-size: 2.55rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0;
}

.dashboard-header {
  border-bottom: 1px solid var(--bhkh-line);
  margin-bottom: 1.5rem;
  padding-bottom: 2rem;
}

.eyebrow {
  color: var(--bhkh-coral);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 .65rem;
  text-transform: uppercase;
}

.lede {
  color: var(--bhkh-muted);
  font-size: 1.02rem;
  line-height: 1.6;
  margin: .8rem 0 0;
  max-width: 42rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: flex-end;
}

.btn {
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 700;
  min-height: 42px;
  padding: .6rem 1rem;
}

.btn-primary {
  background: var(--bhkh-green);
  border-color: var(--bhkh-green);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--bhkh-green-dark);
  border-color: var(--bhkh-green-dark);
}

.btn-secondary {
  background: var(--bhkh-surface);
  border-color: #b8c7c3;
  color: var(--bhkh-green-dark);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--bhkh-soft-green);
  border-color: #91aaa2;
  color: var(--bhkh-green-dark);
}

.metric-grid,
.work-grid,
.form-grid {
  display: grid;
  gap: 1rem;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.work-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
  align-items: start;
  grid-template-columns: minmax(25rem, 31rem) minmax(0, 1fr);
}

.metric-card,
.work-panel,
.form-panel {
  background: var(--bhkh-surface);
  border: 1px solid var(--bhkh-line);
  border-radius: 8px;
  box-shadow: var(--bhkh-shadow);
}

.metric-card {
  border-top: 3px solid var(--bhkh-green);
  min-height: 9rem;
  padding: 1rem 1.1rem;
}

.metric-card.metric-hours {
  border-top-color: var(--bhkh-gold);
}

.metric-card.metric-parts {
  border-top-color: var(--bhkh-blue);
}

.metric-card.metric-territories {
  border-top-color: var(--bhkh-coral);
}

.metric-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.metric-heading > span:first-child {
  color: var(--bhkh-muted);
  font-size: .84rem;
  font-weight: 700;
}

.metric-mark {
  align-items: center;
  background: var(--bhkh-soft-green);
  border-radius: 50%;
  color: var(--bhkh-green-dark);
  display: inline-flex;
  font-size: .72rem;
  font-weight: 800;
  height: 1.8rem;
  justify-content: center;
  width: 1.8rem;
}

.metric-hours .metric-mark {
  background: var(--bhkh-soft-gold);
  color: #80570e;
}

.metric-parts .metric-mark {
  background: var(--bhkh-soft-blue);
  color: #315b73;
}

.metric-territories .metric-mark {
  background: var(--bhkh-soft-coral);
  color: #8b463a;
}

.metric-card strong {
  display: block;
  font-size: 2.45rem;
  font-weight: 760;
  line-height: 1;
  margin-top: .75rem;
}

.metric-card small {
  color: var(--bhkh-muted);
  display: block;
  font-size: .76rem;
  margin-top: .35rem;
}

.work-panel,
.form-panel {
  overflow: hidden;
  padding: 1.1rem;
}

.form-panel {
  position: sticky;
  top: 88px;
}

.panel-heading {
  align-items: center;
  border-bottom: 1px solid var(--bhkh-line);
  display: flex;
  justify-content: space-between;
  margin: -1.1rem -1.1rem 1.1rem;
  min-height: 52px;
  padding: .85rem 1.1rem;
}

.panel-heading h2 {
  font-size: .98rem;
  font-weight: 760;
  margin: 0;
}

.panel-heading a {
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
}

.empty-state {
  color: var(--bhkh-muted);
  margin: 0;
  padding: .4rem 0;
}

.timeline-list,
.data-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-list li,
.data-list li {
  align-items: center;
  border-bottom: 1px solid #edf1f0;
  display: flex;
  gap: 1rem;
  min-height: 58px;
  padding: .75rem 0;
}

.timeline-list li:last-child,
.data-list li:last-child {
  border-bottom: 0;
}

.timeline-list span {
  color: var(--bhkh-muted);
  flex: 0 0 5.5rem;
  font-size: .82rem;
  font-weight: 650;
}

.timeline-list strong,
.data-list strong {
  font-size: .91rem;
}

.timeline-list small,
.data-list small {
  color: var(--bhkh-muted);
  display: block;
  line-height: 1.45;
  margin-top: .15rem;
}

.status-pill {
  background: var(--bhkh-soft-green);
  border-radius: 999px;
  color: var(--bhkh-green-dark);
  display: inline-block;
  font-size: .72rem;
  font-weight: 750;
  padding: .3rem .6rem;
}

.form-label {
  color: #40524f;
  font-size: .8rem;
  font-weight: 750;
  margin-bottom: .4rem;
}

.form-control,
.form-select {
  border-color: #cbd7d4;
  border-radius: 6px;
  color: var(--bhkh-ink);
  min-height: 42px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #6b9789;
  box-shadow: 0 0 0 .2rem rgba(47, 107, 88, .13);
}

.form-check-input:checked {
  background-color: var(--bhkh-green);
  border-color: var(--bhkh-green);
}

.role-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.role-fieldset legend {
  color: #40524f;
  float: none;
  font-size: .8rem;
  font-weight: 750;
  margin-bottom: .5rem;
  width: auto;
}

.role-selector {
  display: grid;
  gap: .45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-option {
  align-items: flex-start;
  background: #fbfcfc;
  border: 1px solid #d4dfdc;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  font-size: .78rem;
  font-weight: 650;
  gap: .5rem;
  line-height: 1.3;
  min-height: 42px;
  padding: .62rem .65rem;
}

.role-option:hover {
  background: #f3f8f6;
  border-color: #aabfba;
}

.role-option:has(input:checked) {
  background: var(--bhkh-soft-green);
  border-color: #7da397;
  color: var(--bhkh-green-dark);
}

.role-option .form-check-input {
  flex: 0 0 auto;
  margin: .05rem 0 0;
}

.role-validation {
  display: block;
  font-size: .76rem;
  margin-top: .45rem;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .5rem;
}

.role-tags span {
  background: var(--bhkh-soft-blue);
  border-radius: 4px;
  color: #315b73;
  font-size: .68rem;
  font-weight: 700;
  padding: .22rem .4rem;
}

.alert {
  border-radius: 7px;
}

.site-footer {
  background: var(--bhkh-surface);
  border-top: 1px solid var(--bhkh-line);
  color: var(--bhkh-muted);
  font-size: .78rem;
}

.footer-content {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 58px;
}

.footer-content a {
  color: var(--bhkh-muted);
}

@media (max-width: 991.98px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: minmax(23rem, 27rem) minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .site-header .navbar {
    min-height: 62px;
  }

  .site-nav {
    align-items: stretch;
    border-top: 1px solid var(--bhkh-line);
    gap: .2rem;
    margin-top: .65rem;
    padding-top: .65rem;
  }

  .site-nav .nav-link {
    padding: .7rem .75rem;
  }

  .workspace-header {
    align-items: start;
    flex-direction: column;
    padding-top: 2.25rem;
  }

  .workspace-header h1 {
    font-size: 2.1rem;
  }

  .header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .metric-grid,
  .work-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }

  .role-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .brand-copy small {
    display: none;
  }

  .header-actions .btn {
    flex: 1 1 100%;
  }

  .metric-grid {
    gap: .75rem;
  }

  .metric-card {
    min-height: 8.25rem;
  }

  .timeline-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: .3rem;
  }

  .timeline-list span {
    flex-basis: auto;
  }

  .role-selector {
    grid-template-columns: 1fr;
  }
}
