:root {
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  color: #172a35;
  background: #f4f6f7;
  font-size: 16px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #12202b;
  color: #edf5f5;
  padding: 24px 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid #49626b;
  color: #5dd3bd;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 28px;
  line-height: 1;
}
.brand b {
  display: block;
  font-size: 1rem;
}
.brand small {
  display: block;
  color: #a7b8bd;
  font-size: 0.79rem;
  margin-top: 3px;
}
.sidebar-label {
  margin: 8px 11px -16px;
  color: #91a5ab;
  font-size: 0.71rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}
.nav {
  display: grid;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 43px;
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  background: transparent;
  color: #c5d2d6;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.nav-item > span {
  width: 19px;
  text-align: center;
  color: #83b9b3;
  font-size: 1rem;
}
.nav-item:hover,
.nav-item:focus-visible {
  background: #243946;
  color: white;
}
.nav-item.active {
  background: #284857;
  color: #fff;
  box-shadow: inset 3px 0 #5dd3bd;
}
.sidebar-note {
  margin-top: auto;
  border-top: 1px solid #354751;
  padding: 17px 9px 3px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar-note b,
.sidebar-note small {
  display: block;
}
.sidebar-note b {
  font-size: 0.83rem;
  font-weight: 600;
}
.sidebar-note small {
  font-size: 0.73rem;
  color: #a5b6bc;
  margin-top: 3px;
}
.local-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #66d3b5;
}
.main {
  min-width: 0;
}
.topbar {
  height: 66px;
  background: #fff;
  border-bottom: 1px solid #e0e6e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 34px;
  color: #3e545f;
  font-size: 0.87rem;
}
.crumb {
  color: #778992;
}
.crumb-sep {
  padding: 0 10px;
  color: #a5b2b6;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-picker-label {
  font-size: 0.68rem;
  color: #72848b;
  font-weight: 750;
  letter-spacing: 0.1em;
}
.top-actions select {
  max-width: 235px;
  height: 37px;
  border: 1px solid #d6e0e3;
  border-radius: 8px;
  background: white;
  padding: 0 28px 0 10px;
  color: #243c47;
  font: inherit;
}
.view {
  max-width: 1440px;
  margin: 0 auto;
  padding: 33px 34px 70px;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.eyebrow {
  color: #087f78;
  letter-spacing: 0.13em;
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}
.page-heading h1 {
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 8px 0;
}
.page-heading p {
  color: #687c84;
  line-height: 1.5;
  margin: 0;
  max-width: 760px;
}
.heading-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid #d1dee1;
  border-radius: 9px;
  background: #fff;
  padding: 10px 14px;
  color: #31525d;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover,
.btn:focus-visible {
  border-color: #168d84;
  color: #00665f;
}
.btn.primary {
  background: #117f78;
  border-color: #117f78;
  color: #fff;
}
.btn.primary:hover {
  background: #086d67;
}
.btn.small {
  padding: 7px 10px;
  font-size: 0.8rem;
}
.btn.danger {
  color: #9e3c37;
}
.grid {
  display: grid;
  gap: 14px;
}
.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 21px;
}
.panel,
.stat-card,
.project-card {
  background: #fff;
  border: 1px solid #dfe7e9;
  border-radius: 13px;
  box-shadow: 0 3px 12px #243a4208;
}
.stat-card {
  padding: 17px 18px;
}
.stat-card .label {
  font-size: 0.78rem;
  color: #71838a;
}
.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #193844;
  line-height: 1.15;
  margin-top: 9px;
}
.stat-card .hint {
  font-size: 0.75rem;
  color: #788991;
  margin-top: 5px;
}
.dashboard-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
}
.panel {
  padding: 18px 19px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 0.98rem;
}
.panel-title small {
  font-size: 0.75rem;
  color: #73858c;
  font-weight: 450;
}
.stack {
  display: grid;
  gap: 9px;
}
.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #e5ebed;
  border-radius: 9px;
}
.work-row button.row-title {
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  color: #263d47;
  font: inherit;
  cursor: pointer;
}
.work-row button.row-title b {
  display: block;
  font-size: 0.87rem;
  line-height: 1.4;
}
.work-row button.row-title small {
  display: block;
  color: #70828a;
  margin-top: 4px;
  font-size: 0.76rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #dbe4e6;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.7rem;
  white-space: nowrap;
  color: #526b73;
  background: #f8fafb;
}
.badge.green {
  color: #236c59;
  border-color: #cae6d9;
  background: #f0faf5;
}
.badge.gold {
  color: #896619;
  border-color: #efdfb8;
  background: #fffbef;
}
.badge.red {
  color: #a14540;
  border-color: #efcfcd;
  background: #fff5f4;
}
.empty {
  padding: 27px 15px;
  border: 1px dashed #ccdadd;
  border-radius: 10px;
  text-align: center;
  color: #71838a;
  font-size: 0.88rem;
  line-height: 1.5;
}
.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search {
  height: 41px;
  min-width: 210px;
  max-width: 430px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #d7e1e4;
  border-radius: 9px;
  color: #55747d;
}
.search input {
  border: 0;
  outline: 0;
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  color: #18323e;
  background: transparent;
}
.toolbar select,
.field select,
.field input,
.field textarea {
  min-height: 40px;
  border: 1px solid #d6e0e3;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: #223c47;
  font: inherit;
  font-size: 0.87rem;
}
.field textarea {
  min-height: 88px;
  resize: vertical;
}
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #dfe7e9;
  border-radius: 12px;
}
.table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  text-align: left;
}
.table th {
  padding: 11px 13px;
  background: #f7f9f9;
  color: #74858b;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.table td {
  padding: 12px 13px;
  border-top: 1px solid #ebeff0;
  color: #324c56;
  font-size: 0.83rem;
  vertical-align: middle;
}
.table tr:hover td {
  background: #fbfdfd;
}
.table .link {
  border: 0;
  background: none;
  padding: 0;
  color: #126f70;
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.timeline-box {
  overflow: auto;
  background: #fff;
  border: 1px solid #dfe7e9;
  border-radius: 13px;
}
.timeline {
  min-width: 980px;
  padding: 17px 19px;
}
.timeline-head,
.timeline-row {
  display: grid;
  grid-template-columns: 275px repeat(16, minmax(31px, 1fr));
  align-items: center;
}
.timeline-head {
  padding-bottom: 10px;
  color: #778990;
  font-size: 0.69rem;
  font-weight: 750;
  text-align: center;
}
.timeline-head > span:first-child {
  text-align: left;
}
.timeline-row {
  min-height: 49px;
  border-top: 1px solid #edf1f2;
}
.timeline-name {
  padding-right: 12px;
  font-size: 0.78rem;
  color: #38515b;
  line-height: 1.3;
}
.timeline-name b {
  display: block;
  color: #1e3945;
  font-size: 0.8rem;
}
.week {
  height: 28px;
  border-left: 1px solid #edf1f2;
}
.bar {
  height: 10px;
  margin: 0 1px;
  border-radius: 8px;
  background: #198d83;
  position: relative;
  z-index: 1;
}
.bar.soft {
  background: #8cc9bb;
}
.timeline-caption {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 11px 2px 0;
  color: #71838a;
  font-size: 0.76rem;
  line-height: 1.5;
}
.stage-list {
  display: grid;
  gap: 10px;
}
.stage-item {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e3e9ea;
  border-radius: 10px;
  background: #fff;
}
.stage-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8f4f2;
  color: #087f78;
  font-size: 0.76rem;
  font-weight: 800;
}
.stage-item b {
  font-size: 0.86rem;
}
.stage-item small {
  display: block;
  color: #71838a;
  font-size: 0.75rem;
  margin-top: 4px;
}
.doc-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.doc-card {
  border: 1px solid #e2e9ea;
  border-radius: 10px;
  padding: 13px;
}
.doc-card b {
  display: block;
  font-size: 0.86rem;
}
.doc-card small {
  display: block;
  color: #73858c;
  margin-top: 5px;
  line-height: 1.45;
}
.calendar-list {
  display: grid;
  gap: 9px;
}
.calendar-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e2e9ea;
  border-radius: 10px;
  background: #fff;
}
.calendar-date {
  color: #216c6b;
  font-weight: 700;
  font-size: 0.81rem;
}
.calendar-item b {
  font-size: 0.86rem;
}
.calendar-item small {
  display: block;
  color: #73858c;
  margin-top: 4px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 0.78rem;
  color: #516a73;
  font-weight: 650;
}
.field.wide {
  grid-column: 1/-1;
}
.dialog {
  width: min(650px, calc(100% - 28px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #d4e0e2;
  border-radius: 15px;
  padding: 0;
  color: #203842;
  box-shadow: 0 20px 70px #152c3570;
}
.dialog::backdrop {
  background: #12212b78;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 19px 22px;
  border-bottom: 1px solid #e7ecee;
}
.dialog-head h2 {
  font-size: 1.12rem;
  margin: 0;
}
.dialog-head p {
  margin: 5px 0 0;
  color: #74858b;
  font-size: 0.8rem;
}
.icon-button {
  border: 0;
  background: transparent;
  color: #60747c;
  font-size: 1.3rem;
  cursor: pointer;
}
.dialog-body {
  padding: 20px 22px;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid #e7ecee;
}
.form-error {
  color: #a33832;
  font-size: 0.8rem;
}
.timeline-input {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: #70828a;
}
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 5;
  background: #173e43;
  color: white;
  padding: 12px 16px;
  border-radius: 9px;
  box-shadow: 0 6px 24px #0002;
  opacity: 0;
  transform: translateY(7px);
  transition: 0.18s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.muted {
  color: #73858c;
}
.section-gap {
  margin-top: 16px;
}
.checklist {
  display: grid;
  gap: 7px;
}
.checklist label {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 0.86rem;
  color: #435c65;
}
.checklist input {
  accent-color: #087f78;
}
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .view {
    padding: 26px 23px 60px;
  }
  .topbar {
    padding: 0 23px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: sticky;
    z-index: 3;
    height: auto;
    padding: 11px 12px 8px;
    gap: 9px;
  }
  .brand {
    padding: 0 5px;
  }
  .brand-mark {
    height: 34px;
    width: 34px;
  }
  .sidebar-label,
  .sidebar-note {
    display: none;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    scrollbar-width: thin;
  }
  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 39px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
  .topbar {
    height: 55px;
    padding: 0 15px;
  }
  .view {
    padding: 22px 15px 48px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .heading-actions {
    width: 100%;
  }
  .heading-actions .btn {
    flex: 1;
  }
  .stats {
    gap: 9px;
  }
  .stat-card {
    padding: 13px;
  }
  .stat-card .value {
    font-size: 1.5rem;
  }
  .field-grid,
  .doc-cards {
    grid-template-columns: 1fr;
  }
  .field.wide {
    grid-column: auto;
  }
  .calendar-item {
    grid-template-columns: 82px 1fr;
  }
  .calendar-item > .badge {
    grid-column: 2;
  }
  .project-picker-label {
    display: none;
  }
  .top-actions select {
    max-width: 150px;
  }
  .timeline-caption {
    display: block;
  }
  .timeline-caption span {
    display: block;
    margin-top: 4px;
  }
}

/* Full project workflow and numbered-group status */
.sequence-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0;
  padding: 18px 20px;
  background: #f1f8f6;
  border: 1px solid #d6e9e3;
  border-radius: 12px;
}
.sequence-summary h2 {
  margin: 6px 0;
  font-size: 1.05rem;
}
.sequence-summary p {
  margin: 4px 0;
  color: #617780;
}
.sequence-list {
  display: grid;
  gap: 12px;
}
.sequence-group {
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #dfe7e9;
  border-radius: 13px;
}
.sequence-group.current {
  border-color: #108078;
  box-shadow: 0 0 0 2px #10807818;
}
.sequence-group.locked {
  background: #f8f9f9;
}
.sequence-group.complete {
  border-color: #cce6d8;
}
.sequence-group > header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sequence-group > header h2 {
  font-size: 0.98rem;
  margin: 0;
}
.sequence-group > header p {
  font-size: 0.8rem;
  color: #71838a;
  margin: 4px 0 0;
}
.sequence-number {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: #e8f3f1;
  color: #087f78;
  font-weight: 800;
}
.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.branch-card {
  padding: 12px;
  border: 1px solid #e4eaeb;
  border-radius: 10px;
}
.branch-card > b {
  display: block;
  margin-bottom: 8px;
  color: #294650;
  font-size: 0.82rem;
}
.sequence-task {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 9px 6px;
  text-align: left;
  border: 0;
  border-top: 1px solid #edf0f0;
  background: transparent;
  color: #28434d;
  cursor: pointer;
}
.sequence-task > span:first-child {
  min-width: 18px;
  color: #168578;
}
.sequence-task b {
  font-size: 0.79rem;
  line-height: 1.35;
}
.sequence-task small {
  display: block;
  margin-top: 4px;
  color: #74858b;
  font-size: 0.7rem;
  line-height: 1.4;
}
.sequence-task.is-done > span:first-child {
  font-weight: 800;
  color: #238357;
}
.sequence-task.is-locked {
  color: #6e7c81;
}
.sequence-task.is-locked > span:first-child {
  color: #8c7b53;
}
.group-rule {
  margin: 12px 0 0;
  color: #735b28;
  font-size: 0.8rem;
}
.lock-message {
  padding: 12px;
  border: 1px solid #efdfb8;
  border-radius: 8px;
  background: #fffbef;
  color: #725a26;
}
.lock-message span {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
}
.stage-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stage-card h2 {
  font-size: 0.9rem;
  margin: 10px 0 5px;
}
.stage-card p {
  margin: 0;
  color: #72848a;
  font-size: 0.8rem;
}
@media (max-width: 760px) {
  .sequence-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .branch-grid {
    grid-template-columns: 1fr;
  }
}
