:root {
  font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #173431; background: #f4f7f6; color-scheme: light;
  --muted: #58706c; --line: #dfe8e5; --teal: #0b6b58; --deep: #123b35;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #148c75; outline-offset: 3px; }
svg { width: 19px; height: 19px; flex: none; vertical-align: middle; }
h1, h2, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.loading { min-height: 100dvh; display: grid; place-content: center; padding: 28px; }
.layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
  background: var(--deep); color: #f0f8f5; padding: 28px 16px 18px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.sidebar .brand { margin: 0 5px 42px; }
.brand-icon { display: grid; place-items: center; background: #bfe5d5; color: #125a49; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.brand-icon svg { width: 24px; height: 24px; }
.brand strong, .brand span, .profile strong, .profile span { display: block; }
.brand strong { font-size: 15px; font-weight: 700; white-space: nowrap; }
.brand span, .profile div span { font-size: 12px; color: #b1cdc5; }
.nav-wrap { margin-bottom: 24px; }
.nav-caption { color: #a5c3ba; font-size: 10px; font-weight: 700; letter-spacing: .14em; padding: 0 12px 8px; }
.nav-item { color: #d3e8e1; text-decoration: none; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; margin-bottom: 4px; font-weight: 550; }
.nav-item:hover, .nav-item.selected { background: #22574d; color: #fff; }
.nav-item.selected svg { color: #a7e1c8; }
.profile { margin-top: auto; border-top: 1px solid #386057; padding: 17px 3px 0; display: flex; align-items: center; gap: 9px; }
.profile div { min-width: 0; flex: 1; }
.profile strong { font-size: 13px; overflow-wrap: anywhere; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid !important; place-items: center; background: #d6eee6; color: #155c4b; font-size: 11px; font-weight: 750; flex: none; }
.avatar.small { width: 24px; height: 24px; font-size: 9px; }
.avatar.client { width: 38px; height: 38px; border-radius: 11px; }
.color-1 { background: #e6eaf7; color: #475686; }
.color-2 { background: #f4e9dd; color: #7b5630; }
.color-3 { background: #eae3f5; color: #634780; }
.topbar { min-height: 66px; padding: 0 36px; display: flex; align-items: center; gap: 9px; color: var(--muted); background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; }
.topbar svg { width: 13px; height: 13px; }
.topbar strong { color: #22413d; }
.demo-label { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: #745019; background: #f9f0d9; border-radius: 30px; padding: 4px 10px; font-weight: 650; font-size: 11px; white-space: nowrap; }
.demo-label i, .eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.main { max-width: 1470px; margin: 0 auto; padding: 33px 36px 48px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 24px; }
.eyebrow { font-size: 10px; letter-spacing: .15em; color: #176e5b; font-weight: 750; display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
h1 { font-size: clamp(32px, 3.4vw, 45px); line-height: 1.1; letter-spacing: -.045em; overflow-wrap: anywhere; }
.page-heading p, .auth p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 41px; padding: 8px 15px; border-radius: 8px; font-weight: 680; border: 1px solid transparent; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.primary { background: var(--teal); color: #fff; }
.primary:hover { background: #095547; }
.secondary { color: #1c5449; border-color: #cdded8; background: #fff; }
.secondary:hover, .icon-button:hover { background: #eaf4ef; }
button:disabled { opacity: .65; cursor: wait; }
.icon-button { padding: 6px; border: 0; background: transparent; color: inherit; display: inline-grid; place-items: center; border-radius: 6px; }
.profile .icon-button:hover { background: #22574d; }
.stats, .detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.detail-grid { grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); }
.stat, .detail-grid > div, .panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 2px 3px #13382c04; }
.stat, .detail-grid > div { padding: 15px; }
.stat-head { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #42605b; font-weight: 650; }
.stat-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: #e5f5ee; color: #18765f; flex: none; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.blue { background: #e7f2fa; color: #386d91; }
.stat-icon.lavender { background: #f1ebfa; color: #71509d; }
.stat-icon.amber { background: #faf0de; color: #895e20; }
.stat > strong { display: block; font-size: 29px; letter-spacing: -.04em; line-height: 1.15; margin-top: 8px; }
.stat > small { color: var(--muted); font-size: 11px; }
.panel { overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; gap: 12px; }
h2 { font-size: 19px; letter-spacing: -.025em; line-height: 1.25; }
.panel-head p, .dialog-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; padding: 0 20px 14px; gap: 10px; flex-wrap: wrap; }
.toolbar-fields { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-fields .field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.toolbar-fields .field select { min-height: 37px; width: auto; max-width: min(220px, 60vw); }
.tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; border-radius: 7px; font-size: 12px; font-weight: 650; padding: 7px 11px; color: #48625d; }
.tab:hover { background: #f1f5f3; }
.tab.current { background: #e5f3ed; color: #145c4c; }
.search { display: flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.search svg { width: 15px; height: 15px; }
.search input { width: 157px; min-height: 35px; font-size: 12px; background: transparent; color: #193832; border: 0; }
.search:focus-within { outline: 2px solid #148c75; }
.search input:focus { outline: 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; text-align: left; }
thead { background: #f4f8f6; border-top: 1px solid #ebf0ee; border-bottom: 1px solid #ebf0ee; }
th { color: #4f6963; font-size: 11px; font-weight: 700; padding: 10px 10px; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #eaf0ed; font-size: 12px; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:hover { background: #fbfdfc; }
.table-footer { padding: 11px 20px; color: var(--muted); font-size: 12px; }
.record { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: normal; overflow-wrap: anywhere; min-width: 140px; }
.record strong, .job-title strong { display: block; color: #1c3934; font-size: 13px; }
.record:hover strong, .job-title:hover strong { text-decoration: underline; }
.record small, .job-title small, .row-subtitle { display: block; color: var(--muted); margin-top: 1px; font-size: 11px; }
.person { display: inline-flex; align-items: center; gap: 6px; }
.row-arrow { display: inline-grid; place-items: center; padding: 4px; color: #466b61; }
.row-arrow svg { width: 15px; height: 15px; }
.badge { display: inline-flex; gap: 5px; align-items: center; color: #4f605c; background: #edf1ef; padding: 3px 8px; border-radius: 20px; font-size: 11px; line-height: 1.35; font-weight: 690; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.active, .badge.complete { background: #e1f3e9; color: #186045; }
.badge.new, .badge.in-progress, .badge.invited { background: #e7effb; color: #365b90; }
.badge.needs-attention { background: #fce9e5; color: #91392a; }
.badge.on-hold, .badge.waiting { background: #fbf1da; color: #7d551b; }
.late { color: #9a3e28; font-weight: 700; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); text-decoration: none; margin-bottom: 16px; font-weight: 650; }
.back:hover, .table-link:hover { text-decoration: underline; }
.detail-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.detail-grid dd { font-weight: 650; overflow-wrap: anywhere; }
.contact-panel { margin-bottom: 23px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px 22px; padding: 0 20px 20px; }
.contact-grid dt { color: var(--muted); font-size: 12px; font-weight: 650; margin-bottom: 6px; }
.contact-grid dd { overflow-wrap: anywhere; }
.contact-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact-grid li small { display: block; color: var(--muted); }
.contact-grid a { color: var(--teal); }
.portal-header { background: #fff; border-bottom: 1px solid var(--line); }
.portal-header > div { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.portal-header .brand span { color: var(--muted); }
.portal-main { max-width: 1180px; }
.submission-details { padding: 0 20px 20px; }
.submission-details-content { display: grid; gap: 12px; overflow-wrap: anywhere; }
.submission-details-content p, .submission-details-content ul { margin: 3px 0 0; }
.submission-reason { white-space: pre-wrap; }
.submission-details-content a { color: var(--teal); }
.text-button { color: var(--teal); border: 0; padding: 3px 0; background: transparent; text-align: left; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.job-title { white-space: normal; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.record-type-name { white-space: normal; overflow-wrap: anywhere; }
.empty { display: grid; gap: 5px; justify-items: center; padding: 45px 16px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.empty svg { color: #498675; width: 25px; height: 25px; margin-bottom: 5px; }
.empty strong { color: #24433d; }
dialog { width: min(480px, calc(100% - 30px)); padding: 0; border: 1px solid var(--line); border-radius: 15px; color: #173431; box-shadow: 0 22px 90px #102b2960; max-height: calc(100dvh - 24px); }
dialog::backdrop { background: #17363178; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; padding: 20px 22px 15px; gap: 10px; border-bottom: 1px solid var(--line); }
.dialog-form, .auth form { display: grid; gap: 13px; }
.dialog-form { padding: 17px 22px 20px; }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 650; min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 7px 9px; border: 1px solid #cbdbd5; border-radius: 7px; color: #193832; background: #fff; font-weight: 450; }
.field textarea { resize: vertical; }
.field-pair { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-help { color: var(--muted); font-size: 12px; }
.contact-group, .contact-entries, .contact-entry { display: grid; gap: 9px; }
.contact-group h3 { font-size: 14px; margin: 0; }
.contact-group > button, .contact-entry > button { justify-self: start; }
.contact-entry { min-inline-size: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 12px; margin: 0; }
.contact-entry legend { padding: 0 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; padding-top: 6px; }
.form-error { color: #8d302a !important; margin: 0 !important; font-size: 13px; }
#notice { position: fixed; right: 20px; bottom: 20px; border-radius: 9px; padding: 12px 16px; color: #fff; background: #123b35; box-shadow: 0 6px 25px #173e3330; z-index: 5; pointer-events: none; opacity: 0; }
#notice.visible { opacity: 1; }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 15% 5%, #d7eee3, #f4f7f6 65%); }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px; width: min(420px, 100%); box-shadow: 0 10px 40px #123b350b; }
.auth .brand { margin-bottom: 26px; }
.auth .brand span { color: var(--muted); }
.auth form { margin-top: 20px; }
.auth form .primary { justify-content: space-between; }
.auth-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.auth .demo-code { margin: 0; padding: 8px 10px; border-radius: 7px; color: #745019; background: #f9f0d9; }
.recovery-codes { display: grid; gap: 6px; padding: 12px; margin: 16px 0; list-style: none; background: #f4f7f6; border-radius: 7px; }
.recovery-codes code { overflow-wrap: anywhere; }
#audit-form { grid-template-columns: minmax(140px, 220px) auto; justify-content: start; align-items: end; }
.portal-header a.button { text-decoration: none; }
@media (max-width: 1070px) {
  .layout { grid-template-columns: 198px minmax(0, 1fr); }
  .main, .topbar { padding-left: 24px; padding-right: 24px; }
  .stats, .detail-grid { gap: 9px; }
  .stat, .detail-grid > div { padding: 12px; }
}
@media (max-width: 780px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px 8px; }
  .sidebar .brand { margin: 0 auto 0 0; }
  .profile { margin: 0; padding: 0; border: 0; order: 0; }
  .nav-wrap { margin: 0; order: 1; }
  .nav-wrap nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-caption { display: none; }
  .nav-item { margin: 0; padding: 6px 8px; gap: 5px; font-size: 13px; }
  .nav-item svg { width: 16px; height: 16px; }
  .topbar { min-height: 43px; padding: 0 16px; }
  .main { padding: 22px 16px 32px; }
}
@media (max-width: 540px) {
  .sidebar { gap: 8px 5px; }
  .sidebar .brand { flex-basis: 60%; }
  .profile div { display: none; }
  .stats, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { flex-wrap: wrap; align-items: start; gap: 12px; }
  .panel-head, .toolbar { padding-left: 12px; padding-right: 12px; }
  .panel-head h2 { font-size: 17px; }
  .table-scroll { overscroll-behavior-x: contain; }
  #notice { max-width: calc(100% - 40px); }
}
