:root {
  --ink: #17221f;
  --muted: #69736f;
  --line: #e6e1d8;
  --paper: #f5f1e9;
  --surface: #fffdf9;
  --surface-soft: #f8f5ef;
  --green-950: #102c26;
  --green-900: #153b32;
  --green-800: #1d5043;
  --green-100: #dfece6;
  --orange: #d9683d;
  --orange-soft: #fff0e8;
  --red: #b8443d;
  --red-soft: #fcecea;
  --amber: #b97820;
  --amber-soft: #fff3dc;
  --blue: #3e6f8e;
  --blue-soft: #eaf3f8;
  --success: #397b5d;
  --success-soft: #e9f4ed;
  --shadow: 0 18px 50px rgba(25, 45, 38, 0.08);
  --shadow-small: 0 8px 22px rgba(25, 45, 38, 0.07);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --sidebar-width: 248px;
  --project-rail-width: 292px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 4%, rgba(216, 164, 116, 0.17), transparent 24rem),
    var(--paper);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

.auth-locked {
  overflow: hidden;
}

.auth-locked .app-shell {
  display: none;
}

.auth-screen {
  position: relative;
  z-index: 100;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 34px 20px 58px;
  color: #eff7f3;
  background:
    radial-gradient(circle at 18% 10%, rgba(239, 176, 125, 0.16), transparent 24rem),
    linear-gradient(145deg, #173f35 0%, #0b241e 72%);
}

.auth-screen.is-hidden {
  display: none;
}

.auth-ambient {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.auth-ambient-one {
  width: 520px;
  height: 520px;
  left: -230px;
  bottom: -260px;
  box-shadow:
    0 0 0 80px rgba(255, 255, 255, 0.018),
    0 0 0 160px rgba(255, 255, 255, 0.012);
}

.auth-ambient-two {
  width: 420px;
  height: 420px;
  right: -180px;
  top: -210px;
  box-shadow: 0 0 0 90px rgba(239, 176, 125, 0.025);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(590px, 100%);
  padding: clamp(27px, 5vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), transparent 42%),
    #f8f4ec;
  box-shadow: 0 36px 100px rgba(0, 12, 9, 0.35);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e1dbd0;
}

.auth-brand > div {
  display: grid;
  gap: 1px;
}

.auth-brand strong {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.auth-brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.auth-step {
  padding-top: 28px;
}

.auth-step[hidden] {
  display: none;
}

.auth-step h1 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(29px, 4vw, 39px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.auth-intro {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-submit {
  width: 100%;
  min-height: 45px;
  margin-top: 2px;
}

.form-error {
  min-height: 16px;
  margin: -5px 0 0;
  color: var(--red);
  font-size: 10px;
}

.form-error.is-success {
  color: var(--success);
}

.demo-access {
  margin-top: 16px;
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
}

.demo-access strong {
  color: var(--green-800);
  font-weight: 700;
}

.auth-switch-link {
  display: block;
  margin: 15px auto 0;
  padding: 5px;
  border: 0;
  color: var(--orange);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.role-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.role-choice {
  min-height: 136px;
  padding: 17px;
  display: grid;
  grid-template-columns: 39px 1fr;
  grid-template-rows: auto 1fr;
  gap: 5px 11px;
  align-items: start;
  border: 1px solid #ddd5c9;
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.role-choice:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 104, 61, 0.42);
  box-shadow: 0 12px 25px rgba(38, 45, 40, 0.08);
}

.role-choice-icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--green-900);
  background: var(--green-100);
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 16px;
  font-weight: 700;
}

.role-choice strong {
  align-self: end;
  font-size: 13px;
}

.role-choice small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.auth-back {
  display: block;
  margin: 18px auto 0;
  padding: 5px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.auth-footnote {
  position: absolute;
  z-index: 1;
  bottom: 22px;
  left: 50%;
  margin: 0;
  color: rgba(239, 247, 243, 0.35);
  font-size: 9px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transform: translateX(-50%);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(217, 104, 61, 0.28);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--project-rail-width);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  color: #eef6f2;
  background:
    radial-gradient(circle at 25% -10%, rgba(255, 255, 255, 0.12), transparent 18rem),
    linear-gradient(175deg, var(--green-900), var(--green-950));
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 0 8px;
}

.brand-mark {
  position: relative;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  overflow: hidden;
  border: 1px solid rgba(241, 195, 155, 0.48);
  border-radius: 12px;
  background: linear-gradient(145deg, #1d5043, #173f35);
  box-shadow: 0 7px 16px rgba(10, 31, 25, 0.2);
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 17px;
  height: 15px;
  left: 9px;
  top: 7px;
  border: 2px solid #f1c39b;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  transform: rotate(45deg) scale(0.78);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 8px;
  bottom: 10px;
  border-radius: 50%;
  background: #f1c39b;
  box-shadow:
    10px -3px 0 #f1c39b,
    21px 1px 0 #f1c39b;
}

.brand-mark > span {
  position: absolute;
  width: 23px;
  height: 1.5px;
  left: 9px;
  bottom: 13px;
  background: rgba(241, 195, 155, 0.88);
  transform: rotate(5deg);
}

.brand-mark.is-logo {
  padding: 3px;
  border-color: rgba(241, 195, 155, 0.62);
  background: #fffdf9;
}

.brand-mark.is-logo::before,
.brand-mark.is-logo::after {
  display: none;
}

.brand-mark.is-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: rgba(238, 246, 242, 0.58);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 42px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(238, 246, 242, 0.66);
  display: grid;
  grid-template-columns: 21px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-icon {
  position: relative;
  width: 19px;
  height: 19px;
  display: inline-block;
  opacity: 0.88;
}

.nav-icon-overview {
  border: 1.5px solid currentColor;
  border-radius: 5px;
}

.nav-icon-overview::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  border: 1px solid currentColor;
  opacity: 0.65;
}

.nav-icon-calendar {
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.nav-icon-calendar::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 5px;
  border-top: 1.5px solid currentColor;
}

.nav-icon-calendar::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 4px;
  left: 4px;
  top: -2px;
  background: currentColor;
  box-shadow: 9px 0 0 currentColor;
}

.nav-icon-alert::before {
  content: "!";
  position: absolute;
  inset: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.nav-icon-brief::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 1px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.nav-icon-brief::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.nav-icon-message::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 2px;
  bottom: 4px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.nav-icon-message::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 1px;
  width: 5px;
  height: 5px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: skew(-27deg);
}

.nav-icon-material::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  bottom: 3px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  transform: rotate(45deg) scale(0.72);
}

.nav-icon-audit::before {
  content: "✓";
  position: absolute;
  inset: 0;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.nav-icon-admin::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  left: 6px;
  top: 1px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.nav-icon-admin::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 1px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.nav-icon-settings {
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.nav-icon-settings::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.nav-icon-steward {
  border: 1.5px solid currentColor;
  border-radius: 5px;
}

.nav-icon-steward::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 4px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.nav-icon-steward::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  left: 1px;
  top: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.nav-count {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--orange);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.nav-count:empty,
.nav-count[data-count="0"] {
  display: none;
}

.side-project {
  margin-top: auto;
  padding: 15px 13px 13px;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  max-height: min(46vh, 440px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.side-project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 3px;
}

.side-label {
  display: block;
  margin-bottom: 5px;
  color: rgba(238, 246, 242, 0.78);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.side-project-count {
  min-width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(238, 246, 242, 0.72);
  background: rgba(255, 255, 255, 0.09);
  font-size: 10px;
  font-weight: 700;
}

.side-project-search {
  position: relative;
  display: block;
  margin-top: 8px;
}

.side-project-search > span {
  position: absolute;
  width: 8px;
  height: 8px;
  left: 10px;
  top: 50%;
  border: 1.5px solid rgba(238, 246, 242, 0.45);
  border-radius: 50%;
  transform: translateY(-60%);
}

.side-project-search > span::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 6px;
  top: 7px;
  background: rgba(238, 246, 242, 0.45);
  transform: rotate(45deg);
}

.side-project-search input {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px 6px 29px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: #eef6f2;
  background: rgba(9, 30, 24, 0.24);
  font-size: 11px;
}

.side-project-search input::placeholder {
  color: rgba(238, 246, 242, 0.36);
}

.side-project-list {
  flex: 1 1 auto;
  min-height: 72px;
  margin-top: 8px;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: rgba(239, 176, 125, 0.58) rgba(255, 255, 255, 0.055);
  padding-right: 4px;
}

.side-project-list::-webkit-scrollbar {
  width: 9px;
}

.side-project-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.side-project-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(239, 176, 125, 0.62);
  background-clip: padding-box;
}

.side-project-list::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 176, 125, 0.86);
  background-clip: padding-box;
}

.side-project-empty {
  padding: 16px 8px;
  color: rgba(238, 246, 242, 0.42);
  text-align: center;
  font-size: 10px;
}

.side-project-item {
  width: 100%;
  padding: 9px 8px;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(238, 246, 242, 0.68);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.side-project-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.side-project-item.is-active {
  color: #fff;
  border-color: rgba(239, 176, 125, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.side-project-item[hidden] {
  display: none;
}

.side-project-risk-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ba995;
}

.side-project-risk-dot.is-red {
  background: #f08b7e;
  box-shadow: 0 0 0 4px rgba(240, 139, 126, 0.09);
}

.side-project-risk-dot.is-orange {
  background: #e6aa5f;
}

.side-project-risk-dot.is-blue {
  background: #79b9da;
}

.side-project-main {
  min-width: 0;
}

.side-project-name {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-project-sub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: rgba(238, 246, 242, 0.38);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-project-risk-count {
  min-width: 36px;
  padding: 3px 5px;
  border-radius: 999px;
  color: rgba(238, 246, 242, 0.48);
  background: rgba(255, 255, 255, 0.055);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.side-project-risk-count.has-risk {
  color: #f1b495;
  background: rgba(217, 104, 61, 0.12);
}

.project-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.project-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 18px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.9), rgba(244, 240, 232, 0.94));
}

.project-rail .side-project {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 16px 13px 13px;
  border: 1px solid rgba(220, 212, 201, 0.88);
  border-radius: 17px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.86);
  box-shadow: var(--shadow-small);
}

.project-rail .side-label {
  color: var(--ink);
  font-size: 14px;
}

.project-rail .side-project-count {
  color: var(--green-800);
  background: var(--green-100);
}

.project-rail .side-project-search input {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-soft);
}

.project-rail .side-project-search input::placeholder {
  color: #9a948a;
}

.project-rail .side-project-search > span,
.project-rail .side-project-search > span::after {
  border-color: #9a948a;
  background-color: transparent;
}

.project-rail .side-project-search > span::after {
  background: #9a948a;
}

.project-rail .side-project-list {
  scrollbar-color: rgba(21, 59, 50, 0.28) rgba(21, 59, 50, 0.05);
}

.project-rail .side-project-list::-webkit-scrollbar-track {
  background: rgba(21, 59, 50, 0.05);
}

.project-rail .side-project-list::-webkit-scrollbar-thumb {
  background: rgba(21, 59, 50, 0.28);
  background-clip: padding-box;
}

.project-rail .side-project-item {
  color: var(--muted);
  border-color: transparent;
}

.project-rail .side-project-item:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.project-rail .side-project-item.is-active {
  color: var(--ink);
  border-color: rgba(217, 104, 61, 0.28);
  background: var(--orange-soft);
}

.project-rail .side-project-sub {
  color: #8d928e;
}

.project-rail .side-project-risk-count {
  color: var(--muted);
  background: #f0ece5;
}

.project-rail .side-project-risk-count.has-risk {
  color: #a65435;
  background: #f9e7dc;
}

.project-rail .side-project-meta {
  color: var(--muted);
}

.project-rail .side-add-project {
  color: var(--green-800);
  border-color: rgba(21, 59, 50, 0.14);
  background: var(--green-100);
}

.project-rail .side-add-project:hover {
  color: #fff;
  background: var(--green-800);
}

.app-version {
  position: fixed;
  z-index: 45;
  left: 12px;
  right: auto;
  bottom: 8px;
  padding: 2px 5px;
  border-radius: 5px;
  color: rgba(90, 101, 95, 0.62);
  background: rgba(245, 241, 233, 0.78);
  font-size: 8px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.offline-sync-status {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 10px 14px;
  border: 1px solid rgba(211, 170, 123, 0.36);
  border-radius: 10px;
  color: #f6e8d4;
  background: rgba(22, 47, 37, 0.96);
  box-shadow: 0 16px 42px rgba(4, 18, 12, 0.34);
  font-size: 11px;
  line-height: 1.55;
}

.offline-sync-actions {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.offline-sync-actions button {
  padding: 5px 9px;
  border: 1px solid rgba(246, 232, 212, 0.35);
  border-radius: 7px;
  color: #fff7e9;
  background: rgba(255, 255, 255, 0.09);
  font: inherit;
  cursor: pointer;
}

.offline-sync-actions button:hover {
  background: rgba(255, 255, 255, 0.17);
}

body.auth-locked .offline-sync-status {
  display: none;
}

.notification-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.preacceptance-section {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(53, 104, 172, 0.2);
  border-radius: 12px;
  background: rgba(53, 104, 172, 0.05);
}

.preacceptance-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.preacceptance-item {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 10px;
  background: #fff;
}

.preacceptance-item img,
.preacceptance-item video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 7px;
  background: #111;
}

.preacceptance-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preacceptance-meta strong,
.preacceptance-meta span,
.preacceptance-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preacceptance-meta strong {
  color: var(--ink);
  font-size: 10px;
}

.preacceptance-meta span,
.preacceptance-meta small {
  color: var(--muted);
  font-size: 9px;
}

.preacceptance-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preacceptance-upload input {
  max-width: 280px;
  font-size: 10px;
}

.preacceptance-rectification-block {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(47, 123, 95, 0.2);
  border-radius: 10px;
  background: rgba(47, 123, 95, 0.055);
}

.preacceptance-rectification-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preacceptance-rectification-heading strong {
  color: var(--green-900);
  font-size: 11px;
}

.preacceptance-rectification-heading span {
  color: var(--muted);
  font-size: 9px;
}

.preacceptance-rectification-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.manager-rectification-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(47, 123, 95, 0.24);
  border-radius: 11px;
  background: #edf8f2;
}

.manager-rectification-upload > div {
  display: grid;
  gap: 3px;
}

.manager-rectification-upload strong {
  color: var(--green-900);
  font-size: 11px;
}

.manager-rectification-upload small,
.manager-rectification-upload span {
  color: var(--muted);
  font-size: 9px;
}

.manager-rectification-upload select {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.manager-rectification-upload > span {
  grid-column: 1 / -1;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.site-completion-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 8px 14px;
  align-items: end;
  padding: 13px;
  border: 1px solid rgba(217, 119, 69, 0.24);
  border-radius: 11px;
  background: #fff8f2;
}

.site-completion-section > div:first-child {
  display: grid;
  gap: 3px;
}

.site-completion-section strong {
  color: #9a4f2d;
  font-size: 12px;
}

.site-completion-section small {
  color: var(--muted);
  font-size: 9px;
}

.site-completion-preview {
  grid-column: 1 / -1;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--green-900);
  background: rgba(47, 123, 95, 0.09);
  font-size: 10px;
  font-weight: 700;
}

.site-completion-preview.is-error {
  color: var(--red);
  background: var(--red-soft);
}

.rectification-photo-card {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.rectification-photo-card button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rectification-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 7px;
}

.rectification-photo-card strong,
.rectification-photo-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rectification-photo-card strong {
  font-size: 9px;
}

.rectification-photo-card small {
  color: var(--muted);
  font-size: 8px;
}

.final-acceptance-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(47, 123, 95, 0.24);
  border-radius: 13px;
  background: linear-gradient(110deg, #edf8f2, #fff);
}

.final-acceptance-actions > div {
  display: grid;
  gap: 4px;
}

.final-acceptance-actions strong {
  color: var(--green-900);
  font-size: 13px;
}

.final-acceptance-actions small {
  color: var(--muted);
  font-size: 9px;
}

.final-acceptance-submit-button {
  flex: 0 0 auto;
  min-height: 52px !important;
  padding-inline: 20px;
  border-color: #1f7057;
  color: #fff;
  background: #1f7057;
  box-shadow: 0 10px 24px rgba(31, 112, 87, 0.2);
  font-size: 14px !important;
  font-weight: 800;
}

.final-acceptance-submit-button:disabled {
  color: #6b7772;
  background: #e8eeeb;
  box-shadow: none;
}

body.auth-locked .app-version {
  display: none;
}

.side-project strong {
  display: block;
  font-size: 13px;
  line-height: 1.55;
}

.project-select {
  width: 100%;
  min-height: 38px;
  padding: 7px 28px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.project-select option {
  color: var(--ink);
  background: #fffdf9;
}

.side-project-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(238, 246, 242, 0.64);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.status-dot-blue {
  color: #79b9da;
}

.side-add-project {
  width: 100%;
  margin-top: 13px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  color: rgba(238, 246, 242, 0.76);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.side-add-project:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.side-add-project span {
  font-size: 15px;
  line-height: 1;
}

.sidebar-note {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  padding: 13px 10px;
  color: rgba(238, 246, 242, 0.52);
  font-size: 11px;
  line-height: 1.55;
}

.sidebar-note-mark {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 11px;
}

.sidebar-note p {
  margin: 0;
}

.sidebar-footer {
  margin-top: 4px;
  padding: 14px 9px 0;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(238, 246, 242, 0.32);
  font-size: 10px;
}

.role-switch {
  padding: 0;
  border: 0;
  color: rgba(238, 246, 242, 0.5);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.role-switch:hover {
  color: #fff;
}

.role-switch.is-leader {
  color: #efbf95;
}

.role-switch.is-material {
  color: #8ec9e6;
}

.workspace {
  min-width: 0;
}

.mobile-project-bar {
  display: none;
}

.topbar {
  min-height: 118px;
  padding: 25px clamp(22px, 4vw, 52px) 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}

.mobile-brand {
  display: none;
  max-width: min(46vw, 220px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

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

.user-chip {
  min-width: 150px;
  padding: 6px 10px 6px 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(218, 210, 199, 0.9);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.68);
}

.user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--green-800);
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 14px;
  font-weight: 700;
}

.user-chip > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.user-chip strong {
  max-width: 105px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--green-900);
  box-shadow: 0 7px 18px rgba(21, 59, 50, 0.16);
}

.button-primary:hover {
  background: var(--green-800);
}

.button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 253, 249, 0.7);
}

.button-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.button-danger {
  color: var(--red);
  border-color: rgba(184, 68, 61, 0.18);
  background: var(--red-soft);
}

.button-plus {
  display: inline-block;
  margin-right: 5px;
  font-size: 17px;
  line-height: 1;
  vertical-align: -1px;
}

.main-content {
  padding: 0 clamp(18px, 4vw, 52px) 56px;
}

.view {
  display: none;
  animation: view-in 280ms ease both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.portfolio-glance {
  grid-column: 1 / -1;
  padding: 17px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.78);
  box-shadow: var(--shadow-small);
}

.portfolio-glance .eyebrow {
  margin-bottom: 3px;
}

.portfolio-glance strong {
  font-size: 13px;
}

.portfolio-glance-numbers {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 10px;
}

.portfolio-glance-numbers b,
.brief-stat strong {
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
}

.is-red {
  color: var(--red) !important;
}

.is-orange {
  color: var(--amber) !important;
}

.brief-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.brief-stat {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.brief-stat > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.brief-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.brief-stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.brief-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.brief-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.portfolio-risk-list {
  display: grid;
  gap: 9px;
}

.portfolio-risk-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.portfolio-risk-row[data-severity="red"] {
  background: var(--red-soft);
  border-color: rgba(184, 68, 61, 0.12);
}

.portfolio-risk-row[data-severity="orange"] {
  background: var(--amber-soft);
  border-color: rgba(185, 120, 32, 0.12);
}

.portfolio-risk-row[data-severity="blue"] {
  background: var(--blue-soft);
  border-color: rgba(62, 111, 142, 0.12);
}

.portfolio-risk-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.portfolio-risk-row[data-severity="red"] .portfolio-risk-dot {
  background: var(--red);
}

.portfolio-risk-row[data-severity="blue"] .portfolio-risk-dot {
  background: var(--blue);
}

.portfolio-risk-project {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.portfolio-risk-project span {
  margin-left: 7px;
}

.portfolio-risk-main strong {
  font-size: 12px;
}

.portfolio-risk-main p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.portfolio-risk-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.portfolio-project-grid {
  display: grid;
  gap: 10px;
}

.portfolio-project-card {
  position: relative;
  padding: 15px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.portfolio-project-card:hover {
  border-color: rgba(21, 59, 50, 0.24);
  background: var(--surface-soft);
}

.portfolio-project-card > strong {
  padding-right: 62px;
  font-size: 12px;
}

.portfolio-project-card > small {
  color: var(--muted);
  font-size: 9px;
}

.portfolio-project-level {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 8px;
  font-weight: 700;
}

.portfolio-project-level.is-red {
  color: var(--red);
  background: var(--red-soft);
}

.portfolio-project-level.is-orange {
  color: var(--amber);
  background: var(--amber-soft);
}

.portfolio-project-stage {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.portfolio-project-stage b {
  color: var(--green-800);
  font-weight: 700;
}

.portfolio-project-counts {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
}

.portfolio-project-counts .has-red {
  color: var(--red);
}

.portfolio-project-counts .has-orange {
  color: var(--amber);
}

.material-task-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.material-task-row {
  display: grid;
  grid-template-columns: 18px 8px minmax(170px, 1fr) minmax(150px, 0.85fr) minmax(190px, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 78px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
}

.material-task-select,
.material-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.material-task-select-spacer {
  width: 16px;
  height: 16px;
}

.material-task-row:last-child {
  border-bottom: 0;
}

.material-task-row[data-severity="red"] {
  background: linear-gradient(90deg, var(--red-soft), var(--surface) 28%);
}

.material-task-row[data-severity="orange"] {
  background: linear-gradient(90deg, var(--amber-soft), var(--surface) 28%);
}

.material-task-row[data-severity="green"] {
  background: linear-gradient(90deg, var(--success-soft), var(--surface) 28%);
}

.material-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.material-task-row[data-severity="red"] .material-task-dot {
  background: var(--red);
}

.material-task-row[data-severity="orange"] .material-task-dot {
  background: var(--amber);
}

.material-task-row[data-severity="green"] .material-task-dot {
  background: var(--success);
}

.material-task-project strong,
.material-task-node strong {
  display: block;
  font-size: 12px;
}

.material-task-project small,
.material-task-node small,
.material-task-node span,
.material-task-dates span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.material-task-node small {
  line-height: 1.45;
}

.material-task-dates {
  display: grid;
  gap: 3px;
}

.material-task-dates span {
  margin-top: 0;
}

.material-task-dates b {
  color: var(--ink);
}

.material-workbench-tools,
.material-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.material-task-search {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 240px;
}

.material-task-search input {
  flex: 1;
  min-width: 0;
}

.material-task-filter,
.material-select-all {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.material-task-result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.material-bulk-bar {
  flex-wrap: wrap;
  background: rgba(31, 77, 61, 0.08);
}

.material-bulk-bar > span {
  color: var(--muted);
  font-size: 10px;
}

.material-load-more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.material-cache-error {
  margin: 10px 0;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: start;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.notification-item.is-unread {
  border-color: rgba(217, 104, 61, 0.22);
  background: linear-gradient(90deg, var(--orange-soft), var(--surface) 28%);
}

.notification-indicator {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #c8c1b6;
}

.notification-item.is-unread .notification-indicator {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(217, 104, 61, 0.1);
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  color: var(--muted);
  font-size: 9px;
}

.notification-delivery {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--amber);
  background: var(--amber-soft);
  font-weight: 700;
}

.notification-delivery.is-sent {
  color: var(--success);
  background: var(--success-soft);
}

.notification-delivery.is-failed {
  color: var(--red);
  background: var(--red-soft);
}

.notification-main h3 {
  margin: 6px 0 0;
  font-size: 13px;
}

.notification-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.notification-error {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 9px;
}

.notification-actions {
  min-width: 100px;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.ack-state {
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
}

.hero-card {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  padding: clamp(24px, 3.4vw, 38px);
  border-radius: var(--radius-lg);
  color: #f4faf7;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(135deg, #193f36 0%, #102c26 100%);
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  right: -105px;
  top: -170px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  box-shadow:
    0 0 0 44px rgba(255, 255, 255, 0.025),
    0 0 0 104px rgba(255, 255, 255, 0.018);
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  right: 122px;
  top: 84px;
  border-radius: 50%;
  background: #efb07d;
  box-shadow: 0 0 0 8px rgba(239, 176, 125, 0.12);
}

.hero-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.hero-label {
  margin: 0 0 10px;
  color: rgba(244, 250, 247, 0.52);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.hero-title {
  margin: 0;
  max-width: 560px;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(23px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.hero-address {
  margin: 8px 0 0;
  color: rgba(244, 250, 247, 0.62);
  font-size: 13px;
}

.hero-badge {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #d9e9e2;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 600;
}

.hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8bb9a6;
}

.hero-progress {
  position: relative;
  z-index: 1;
  margin-top: 48px;
}

.hero-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  color: rgba(244, 250, 247, 0.67);
  font-size: 11px;
}

.hero-progress-copy strong {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.hero-progress-dual {
  display: grid;
  gap: 13px;
  margin-top: 34px;
}

.hero-progress-row .hero-progress-copy {
  margin-bottom: 6px;
}

.hero-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.hero-progress-bar span {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #dc9b68, #efc49e);
}

.hero-progress-normal span {
  background: linear-gradient(90deg, #82b49f, #b8d9ca);
}

.hero-progress-actual span {
  background: linear-gradient(90deg, #d88858, #efc49e);
}

.hero-meta {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: rgba(244, 250, 247, 0.62);
  font-size: 12px;
}

.hero-meta strong {
  color: #fff;
  font-weight: 600;
}

.mobile-overview-aux-cost {
  display: none;
}

.focus-card,
.panel {
  border: 1px solid rgba(226, 219, 207, 0.78);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.86);
  box-shadow: var(--shadow-small);
}

.focus-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.section-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.section-kicker h2,
.panel-title h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-kicker p,
.panel-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  color: var(--orange);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.focus-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.focus-item {
  width: 100%;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 0;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.focus-item:first-child {
  border-radius: 13px 13px 0 0;
}

.focus-item:last-child {
  border-radius: 0 0 13px 13px;
}

.focus-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--severity, var(--green-800));
}

.focus-item strong {
  display: block;
  font-size: 13px;
}

.focus-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.focus-date {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.focus-footer {
  margin-top: auto;
  padding-top: 18px;
}

.current-stage-card {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.4fr) auto;
  gap: 28px;
  align-items: center;
  padding: 24px 27px;
  border: 1px solid rgba(217, 104, 61, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(105deg, rgba(255, 238, 224, 0.94), rgba(255, 253, 249, 0.94) 58%),
    var(--surface);
  box-shadow: 0 16px 40px rgba(133, 74, 37, 0.08);
}

.current-stage-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: var(--orange);
}

.current-stage-identity {
  display: flex;
  align-items: center;
  gap: 17px;
}

.current-stage-number {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 9px 22px rgba(217, 104, 61, 0.22);
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 23px;
  font-weight: 700;
}

.current-stage-kicker {
  margin: 0 0 3px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.current-stage-identity h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.current-stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.current-stage-tag {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 9px;
  font-weight: 700;
}

.current-stage-tag.is-owner {
  color: var(--blue);
  background: var(--blue-soft);
}

.current-stage-tag.is-paused {
  color: var(--amber);
  background: var(--amber-soft);
}

.current-stage-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  padding-left: 24px;
  border-left: 1px solid rgba(193, 155, 126, 0.24);
}

.current-stage-detail {
  min-width: 0;
}

.current-stage-detail span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.current-stage-detail strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.55;
}

.stage-trigger strong {
  color: var(--orange);
}

.current-stage-action {
  min-width: 116px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 8px 20px rgba(217, 104, 61, 0.2);
}

.current-stage-action:hover {
  background: #c55b34;
}

.stage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 14px;
  color: #ecf5f1;
  background: var(--green-900);
}

.stage-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 13px;
}

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

.stage-row small {
  display: block;
  margin-top: 1px;
  color: rgba(236, 245, 241, 0.56);
  font-size: 10px;
}

.stat-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-grid.has-overview-cost {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
  min-height: 112px;
  padding: 19px 20px;
  border: 1px solid rgba(226, 219, 207, 0.78);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.72);
}

.overview-aux-cost-card {
  border-color: rgba(169, 107, 56, 0.26);
  background:
    radial-gradient(circle at 100% 0, rgba(211, 151, 94, 0.16), transparent 46%),
    linear-gradient(145deg, #fffaf1, #f7efe2);
}

.overview-aux-cost-value {
  color: #8a572f;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.stat-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--stat-color, var(--orange));
}

.stat-value {
  display: block;
  margin-top: 14px;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-value small {
  margin-left: 3px;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.stat-foot {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.lower-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.panel {
  padding: 23px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.milestone-list {
  display: grid;
  gap: 0;
}

.milestone {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-height: 59px;
}

.milestone::before {
  content: "";
  position: absolute;
  width: 1px;
  left: 13px;
  top: 25px;
  bottom: -2px;
  background: var(--line);
}

.milestone:last-child::before {
  display: none;
}

.milestone-marker {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--green-900);
  background: var(--green-100);
  font-size: 10px;
  font-weight: 800;
}

.milestone.owner .milestone-marker {
  color: var(--blue);
  background: var(--blue-soft);
}

.milestone strong {
  display: block;
  padding-top: 2px;
  font-size: 12px;
}

.milestone small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.milestone-date {
  padding-top: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.note-stack {
  display: grid;
  gap: 10px;
}

.insight {
  padding: 13px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid rgba(226, 219, 207, 0.6);
}

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

.insight p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.insight.warning {
  background: var(--amber-soft);
  border-color: rgba(185, 120, 32, 0.12);
}

.insight.blue {
  background: var(--blue-soft);
  border-color: rgba(62, 111, 142, 0.12);
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
}

.schedule-header h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.project-context-line {
  margin: 0 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.project-context-line span {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--green-900);
  background: var(--green-100);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.schedule-header p {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  color: var(--muted);
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-800);
}

.legend .legend-owner {
  background: var(--blue);
}

.legend .legend-blocked {
  background: var(--amber);
}

.schedule-panel {
  overflow: hidden;
  border: 1px solid rgba(226, 219, 207, 0.85);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.schedule-table-head {
  display: grid;
  grid-template-columns: 48px minmax(180px, 1.2fr) minmax(195px, 1fr) 120px 110px 90px 52px;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.schedule-row {
  display: grid;
  grid-template-columns: 48px minmax(180px, 1.2fr) minmax(195px, 1fr) 120px 110px 90px 52px;
  gap: 12px;
  align-items: center;
  min-height: 73px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(230, 225, 216, 0.75);
  transition: background 150ms ease;
}

.schedule-row:hover {
  background: #fbf8f2;
}

.schedule-row.is-current {
  background:
    linear-gradient(90deg, rgba(255, 236, 221, 0.78), rgba(255, 253, 249, 0.75));
  box-shadow: inset 4px 0 0 var(--orange);
}

.schedule-row:last-child {
  border-bottom: 0;
}

.schedule-index {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--green-900);
  background: var(--green-100);
  font-size: 11px;
  font-weight: 800;
}

.mobile-node-meta {
  display: none;
}

.schedule-row.owner .schedule-index {
  color: var(--blue);
  background: var(--blue-soft);
}

.schedule-row.blocked .schedule-index {
  color: var(--amber);
  background: var(--amber-soft);
}

.schedule-node {
  min-width: 0;
}

.schedule-node strong {
  display: block;
  font-size: 13px;
}

.current-row-tag {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--orange);
  background: var(--orange-soft);
  font-size: 8px;
  font-weight: 800;
  vertical-align: 2px;
}

.schedule-node small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.date-range span {
  display: block;
}

.date-range small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.date-range .completion-date {
  color: var(--success);
  font-weight: 600;
}

.date-range .completion-date:not(:empty) {
  margin-top: 5px;
}

.duration-cell,
.contract-cell {
  color: var(--muted);
  font-size: 11px;
}

.contract-cell strong {
  color: var(--ink);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-owner {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge-company {
  color: var(--green-800);
  background: var(--green-100);
}

.badge-blocked {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge-complete {
  color: var(--success);
  background: var(--success-soft);
}

.badge-progress {
  color: var(--orange);
  background: var(--orange-soft);
}

.edit-node {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.edit-node:hover {
  color: var(--ink);
  border-color: #cfc6b8;
}

.edit-node::before {
  content: "···";
  font-size: 15px;
  line-height: 1;
  transform: translateY(-2px);
}

.operation-log-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.operation-log-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--line);
}

.operation-log-item {
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) minmax(0, 1.35fr);
  gap: 18px;
  padding: 14px 16px;
  background: var(--surface);
}

.operation-log-time strong {
  display: block;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.operation-log-time span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.operation-log-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.operation-log-heading strong {
  font-size: 12px;
}

.operation-log-heading span {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--orange);
  background: var(--orange-soft);
  font-size: 9px;
}

.operation-change-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.operation-change-list span {
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
}

.operation-change-list b {
  color: var(--ink);
}

.operation-empty {
  padding-block: 30px;
}

.risk-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.risk-stat {
  padding: 17px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.risk-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.risk-stat strong {
  display: block;
  margin-top: 8px;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 25px;
}

.alert-list {
  display: grid;
  gap: 11px;
}

.alert-card {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.alert-card::before {
  content: "";
  width: 8px;
  height: 8px;
  align-self: start;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--severity, var(--muted));
}

.alert-card[data-severity="red"] {
  background: linear-gradient(90deg, var(--red-soft), var(--surface) 24%);
}

.alert-card[data-severity="orange"] {
  background: linear-gradient(90deg, var(--amber-soft), var(--surface) 24%);
}

.alert-card[data-severity="blue"] {
  background: linear-gradient(90deg, var(--blue-soft), var(--surface) 24%);
}

.alert-card[data-severity="green"] {
  background: linear-gradient(90deg, var(--success-soft), var(--surface) 24%);
}

.alert-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

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

.alert-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.alert-meta {
  min-width: 98px;
  text-align: right;
}

.alert-meta time {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.alert-meta button {
  margin-top: 8px;
}

.empty-state {
  padding: 50px 24px;
  text-align: center;
  border: 1px dashed #d6cec1;
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.6);
}

.empty-state-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border-radius: 50%;
  color: var(--success);
  background: var(--success-soft);
  font-size: 19px;
  font-weight: 700;
}

.empty-state h3 {
  margin: 0;
  font-size: 15px;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.steward-hero {
  position: relative;
  overflow: hidden;
  padding: 30px 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius-lg);
  color: #f9fffc;
  background:
    radial-gradient(circle at 86% 18%, rgba(240, 178, 111, 0.28), transparent 30%),
    linear-gradient(125deg, #173f35, #245f4e 58%, #15372f);
  box-shadow: 0 18px 40px rgba(15, 54, 44, 0.18);
}

.steward-hero::after {
  content: "";
  position: absolute;
  right: -65px;
  bottom: -105px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(255, 255, 255, 0.035),
    0 0 0 68px rgba(255, 255, 255, 0.025);
}

.steward-hero > * {
  position: relative;
  z-index: 1;
}

.steward-hero .eyebrow {
  color: rgba(238, 255, 248, 0.58);
}

.steward-hero h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.steward-hero p:last-child {
  max-width: 720px;
  margin: 10px 0 0;
  color: rgba(239, 251, 246, 0.72);
  font-size: 12px;
  line-height: 1.75;
}

.steward-hero .badge {
  flex: 0 0 auto;
  color: #e9fff7;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
}

.steward-kpis {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.steward-kpis article {
  padding: 18px 20px;
  border: 1px solid rgba(21, 59, 50, 0.11);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.8);
}

.steward-kpis span,
.steward-kpis small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.steward-kpis strong {
  display: inline-block;
  margin: 9px 4px 7px 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 30px;
  line-height: 1;
}

.steward-kpis .is-red {
  color: var(--red);
}

.steward-kpis .is-orange {
  color: var(--amber);
}

.steward-directory {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(21, 59, 50, 0.11);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.72);
}

.steward-directory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.steward-directory-heading h3 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 22px;
}

.steward-directory-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.steward-search {
  width: min(340px, 42vw);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.steward-search > span {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

.steward-search > span::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  margin: 10px 0 0 9px;
  background: var(--muted);
  transform: rotate(45deg);
}

.steward-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.steward-search-result {
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.steward-manager-list {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.steward-manager-group {
  overflow: hidden;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 15px;
  background: #fffdf9;
}

.steward-manager-group > details > summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.steward-manager-group > details > summary::-webkit-details-marker {
  display: none;
}

.steward-manager-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--green-700), var(--green-900));
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 17px;
  font-weight: 700;
}

.steward-manager-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.steward-manager-identity > span,
.steward-manager-identity small {
  color: var(--muted);
  font-size: 9px;
}

.steward-manager-identity strong {
  overflow: hidden;
  color: var(--green-900);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steward-manager-metrics {
  display: flex;
  align-items: center;
  gap: 7px;
}

.steward-manager-metrics > span {
  min-width: 68px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(21, 59, 50, 0.055);
  font-size: 9px;
  text-align: center;
}

.steward-manager-metrics b {
  color: var(--green-900);
}

.steward-manager-metrics .is-red {
  color: var(--red);
  background: var(--red-soft);
}

.steward-manager-metrics .is-red b {
  color: var(--red);
}

.steward-manager-metrics .is-orange {
  color: var(--amber);
  background: var(--amber-soft);
}

.steward-manager-metrics .is-orange b {
  color: var(--amber);
}

.steward-manager-toggle {
  color: var(--muted);
  font-size: 16px;
  transition: transform 160ms ease;
}

.steward-manager-group details:not([open]) .steward-manager-toggle {
  transform: rotate(-90deg);
}

.steward-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(21, 59, 50, 0.08);
}

.steward-project-card {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(21, 59, 50, 0.1);
  border-radius: 12px;
  background: #fff;
}

.steward-project-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.steward-project-heading h4 {
  margin: 0;
  font-size: 15px;
}

.steward-project-heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.steward-risk-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 9px;
  font-weight: 800;
}

.steward-risk-badge.is-red {
  color: var(--red);
  background: var(--red-soft);
}

.steward-risk-badge.is-orange {
  color: var(--amber);
  background: var(--amber-soft);
}

.steward-project-progress {
  display: grid;
  gap: 7px;
}

.steward-project-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}

.steward-project-progress strong {
  color: var(--green-800);
}

.steward-project-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.steward-project-facts div {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(21, 59, 50, 0.04);
}

.steward-project-facts dt {
  color: var(--muted);
  font-size: 8px;
}

.steward-project-facts dd {
  margin: 4px 0 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steward-project-alert {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--amber);
  border-radius: 5px;
  color: #7a4c18;
  background: var(--amber-soft);
  font-size: 9px;
  line-height: 1.5;
}

.steward-project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 3px;
}

.steward-project-footer > span {
  color: var(--muted);
  font-size: 9px;
}

.steward-project-footer .button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 9px;
}

.steward-manager-empty {
  grid-column: 1 / -1;
  margin: 0 16px 16px;
  padding: 20px;
  display: grid;
  gap: 5px;
  border: 1px dashed rgba(21, 59, 50, 0.18);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}

.steward-manager-empty strong {
  color: var(--green-800);
  font-size: 11px;
}

@media (max-width: 980px) {
  .steward-project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .steward-hero,
  .steward-directory-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .steward-search {
    width: 100%;
  }

  .steward-manager-group > details > summary {
    grid-template-columns: 38px minmax(0, 1fr) 16px;
  }

  .steward-manager-avatar {
    width: 38px;
    height: 38px;
  }

  .steward-manager-metrics {
    grid-column: 2 / -1;
    grid-row: 2;
    flex-wrap: wrap;
  }

  .steward-manager-toggle {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .steward-hero,
  .steward-directory {
    padding: 20px;
  }

  .steward-project-heading,
  .steward-project-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .steward-risk-badge {
    align-self: flex-start;
  }

  .steward-manager-metrics > span {
    min-width: 58px;
    flex: 1;
  }
}

.steward-command-hero {
  padding: 28px 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius-lg);
  color: #f8fffc;
  background:
    radial-gradient(circle at 12% 115%, rgba(209, 153, 93, 0.25), transparent 34%),
    linear-gradient(120deg, #173e34, #245d4d 58%, #173a31);
  box-shadow: 0 18px 42px rgba(15, 54, 44, 0.16);
}

.steward-command-hero .eyebrow {
  color: rgba(239, 255, 249, 0.56);
}

.steward-command-hero h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(27px, 3.3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.steward-command-hero p:last-child {
  max-width: 680px;
  margin: 9px 0 0;
  color: rgba(239, 251, 246, 0.7);
  font-size: 11px;
  line-height: 1.75;
}

.steward-manager-select {
  width: min(320px, 36vw);
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
}

.steward-manager-select > span {
  color: rgba(239, 255, 249, 0.62);
  font-size: 9px;
}

.steward-manager-select select {
  width: 100%;
  min-height: 43px;
  padding: 9px 34px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: #f7fffb;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.steward-manager-select option {
  color: var(--ink);
  background: #fff;
}

.steward-command-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(0, 1.65fr);
  gap: 12px;
}

.steward-manager-profile {
  position: relative;
  padding: 21px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 15px;
  background: #fffdf9;
}

.steward-manager-profile .steward-manager-avatar {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  font-size: 21px;
}

.steward-manager-profile > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.steward-manager-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.steward-manager-profile h3 {
  margin: 0;
  font-size: 18px;
}

.steward-manager-profile > div > span {
  color: var(--muted);
  font-size: 9px;
}

.steward-readonly-tag {
  position: absolute;
  right: 15px;
  top: 15px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 8px;
}

.steward-command-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.steward-command-kpis article {
  min-width: 0;
  padding: 16px 14px;
  border: 1px solid rgba(21, 59, 50, 0.1);
  border-radius: 13px;
  background: rgba(255, 253, 249, 0.82);
}

.steward-command-kpis span,
.steward-command-kpis small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.steward-command-kpis strong {
  display: block;
  margin: 10px 0 7px;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 25px;
  line-height: 1;
}

.steward-command-kpis strong.is-red {
  color: var(--red);
}

.steward-command-kpis strong.is-orange {
  color: var(--amber);
}

.steward-command-layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.62fr);
  gap: 14px;
}

.steward-command-panel,
.steward-rail-guide {
  border: 1px solid rgba(21, 59, 50, 0.11);
  border-radius: 15px;
  background: rgba(255, 253, 249, 0.78);
}

.steward-command-panel {
  padding: 20px;
}

.steward-command-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.steward-command-panel-heading h3,
.steward-rail-guide h3 {
  margin: 0;
  font-size: 16px;
}

.steward-command-panel-heading p,
.steward-rail-guide p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.steward-command-alert-list {
  display: grid;
  gap: 7px;
}

.steward-command-alert {
  width: 100%;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  border: 1px solid rgba(21, 59, 50, 0.09);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.steward-command-alert-mark {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--amber);
}

.steward-command-alert.is-red .steward-command-alert-mark {
  background: var(--red);
}

.steward-command-alert > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.steward-command-alert small {
  color: var(--muted);
  font-size: 8px;
}

.steward-command-alert strong {
  font-size: 11px;
}

.steward-command-alert > span:nth-child(2) > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steward-command-alert time {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.steward-rail-guide {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(150deg, rgba(235, 247, 240, 0.92), rgba(255, 253, 249, 0.95));
}

.steward-rail-guide-mark {
  position: absolute;
  right: 15px;
  top: 6px;
  color: rgba(25, 82, 67, 0.1);
  font-size: 82px;
  font-weight: 300;
  line-height: 1;
}

.steward-rail-guide h3 {
  margin-top: 8px;
}

.steward-rail-guide-list {
  margin-top: 16px;
  display: grid;
  gap: 7px;
}

.steward-rail-guide-list span {
  padding: 8px 9px;
  border-left: 2px solid rgba(25, 82, 67, 0.26);
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.56);
  font-size: 9px;
}

@media (max-width: 1100px) {
  .steward-command-summary,
  .steward-command-layout {
    grid-template-columns: 1fr;
  }

  .steward-command-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .steward-command-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }

  .steward-manager-select {
    width: 100%;
  }

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

  .steward-command-panel,
  .steward-rail-guide {
    padding: 17px;
  }

  .steward-command-alert {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .steward-command-alert time {
    grid-column: 2;
  }
}

.project-admin-strip {
  margin-bottom: 18px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(115deg, rgba(223, 236, 230, 0.6), transparent 52%),
    var(--surface);
  box-shadow: var(--shadow-small);
}

.project-admin-strip h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 21px;
}

.project-admin-strip p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.project-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.manager-assignment-control {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 9px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 10px;
  background: #fffdf9;
}

.manager-assignment-control select {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

.material-project-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}

.material-project-results {
  display: grid;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  margin-top: 10px;
}

.material-project-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 10px;
  background: #fffdf9;
}

.material-project-result > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.material-project-result strong {
  overflow: hidden;
  color: var(--green-900);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-project-result span {
  color: var(--muted);
  font-size: 9px;
}

.material-project-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(31, 77, 61, 0.08);
  color: var(--muted);
  font-size: 10px;
}

.material-project-result-actions,
.node-material-actions,
.material-template-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.material-template-save {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0 8px;
}

.material-template-list {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.material-template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.material-template-item strong,
.material-template-item span,
.material-template-item small {
  display: block;
}

.material-template-item span,
.material-template-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.compact-empty {
  padding: 20px 10px;
}

.project-progress {
  max-width: 360px;
  margin-top: 12px;
}

.project-progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.project-progress-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e3d9;
}

.project-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green-800);
}

.request-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.request-state.is-pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.request-state.is-rejected {
  color: var(--red);
  background: var(--red-soft);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.audit-hero {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  color: #eef6f2;
  background: linear-gradient(135deg, var(--green-900), var(--green-950));
}

.audit-hero h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 25px;
}

.audit-hero p {
  margin: 5px 0 0;
  color: rgba(238, 246, 242, 0.58);
  font-size: 11px;
}

.audit-hero .button-secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.audit-list {
  display: grid;
  gap: 12px;
}

.audit-section {
  margin-bottom: 22px;
}

.audit-section-title {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-section-title h3 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 17px;
}

.audit-section-title span {
  color: var(--muted);
  font-size: 9px;
}

.audit-card {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.audit-card h3 {
  margin: 0;
  font-size: 14px;
}

.audit-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.audit-actions {
  display: flex;
  gap: 8px;
}

.audit-locked {
  padding: 34px;
  text-align: center;
  border: 1px dashed #d2c9bb;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.audit-locked h3 {
  margin: 0;
  font-size: 16px;
}

.audit-locked p {
  max-width: 520px;
  margin: 7px auto 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.completed-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.completed-project-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 15px;
  background: #fffdf9;
  box-shadow: 0 10px 30px rgba(44, 53, 49, 0.06);
}

.completed-project-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.completed-project-heading p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.completed-project-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.completed-project-stats span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
}

.completed-project-stats b {
  color: var(--green-900);
  font-size: 11px;
}

.completed-project-details {
  border-top: 1px solid rgba(21, 59, 50, 0.1);
  padding-top: 10px;
}

.completed-project-details summary {
  color: var(--green-800);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.completed-node-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.completed-node-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f7f3eb;
  font-size: 9px;
}

.completed-node-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completed-node-row span {
  color: var(--green-800);
  font-weight: 700;
}

.completed-node-row small {
  color: var(--muted);
}

.completed-project-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
}

.completed-media-slot:empty {
  display: none;
}

.completed-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.completed-media-grid figure {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.completed-media-grid img,
.completed-media-grid video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
}

.completed-media-grid figcaption {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.completed-media-grid figcaption strong {
  color: var(--green-800);
  font-size: 9px;
}

.completed-media-grid figcaption span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-list {
  margin-top: 24px;
}

.archive-list h3 {
  margin: 0 0 10px;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 18px;
}

.archive-item {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.archive-item span {
  color: var(--muted);
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.admin-stat span {
  color: var(--muted);
  font-size: 10px;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 26px;
  line-height: 1;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-toolbar-copy h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 21px;
}

.admin-toolbar-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.employee-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.employee-head,
.employee-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(110px, 0.6fr) minmax(250px, 1.4fr) minmax(100px, 0.6fr) 138px;
  gap: 14px;
  align-items: center;
}

.employee-head {
  min-height: 42px;
  padding: 0 18px;
  color: var(--muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.employee-row {
  min-height: 74px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(230, 225, 216, 0.75);
}

.employee-row:last-child {
  border-bottom: 0;
}

.employee-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.employee-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--green-900);
  background: var(--green-100);
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.employee-person strong,
.employee-id strong {
  display: block;
  font-size: 12px;
}

.employee-person small,
.employee-id small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.role-chip {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 9px;
  font-weight: 700;
}

.role-chip.is-admin {
  color: var(--orange);
  background: var(--orange-soft);
}

.account-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
}

.account-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.account-state.is-disabled {
  color: var(--muted);
}

.account-state.is-disabled::before {
  background: #a69f94;
}

.employee-edit {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.employee-actions {
  justify-self: end;
  display: flex;
  gap: 6px;
}

.employee-delete {
  padding: 6px 9px;
  border: 1px solid rgba(184, 68, 61, 0.18);
  border-radius: 8px;
  color: var(--red);
  background: var(--red-soft);
  cursor: pointer;
  font-size: 10px;
}

.permission-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-checks label {
  min-height: 34px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 10px;
}

.permission-checks input {
  accent-color: var(--green-800);
}

.admin-backup-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.backup-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.backup-row {
  min-height: 64px;
  padding: 11px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.backup-row:last-child {
  border-bottom: 0;
}

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

.backup-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.backup-empty {
  padding: 22px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
  font-size: 10px;
}

.settings-panel {
  padding: 25px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-small);
}

.settings-panel h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 21px;
}

.settings-panel > p {
  margin: 5px 0 22px;
  color: var(--muted);
  font-size: 11px;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.account-security-panel {
  margin-bottom: 20px;
}

.company-restore-panel {
  margin-bottom: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), transparent 45%),
    var(--surface);
}

.company-restore-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.company-restore-controls select {
  width: 100%;
}

.company-restore-actions {
  display: flex;
  gap: 8px;
}

.company-restore-warning {
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(173, 104, 53, 0.2);
  border-radius: 10px;
  color: #745139;
  background: rgba(188, 124, 66, 0.08);
  font-size: 10px;
  line-height: 1.65;
}

.company-restore-warning strong {
  display: block;
  margin-bottom: 3px;
  color: #8b4c24;
}

.calendar-header {
  align-items: flex-end;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-controls strong {
  min-width: 112px;
  text-align: center;
  font-family: "Songti SC", serif;
  font-size: 20px;
}

.calendar-filter-bar {
  margin-bottom: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: end;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.calendar-filter-bar label {
  display: grid;
  gap: 5px;
}

.calendar-filter-bar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.calendar-filter-bar select {
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.calendar-event-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.calendar-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  background: #173f33;
}

.calendar-weekdays span {
  padding: 11px 8px;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.calendar-day {
  min-height: 154px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fffdf9;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-outside {
  background: #f3eee5;
  opacity: 0.68;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(42, 110, 87, 0.34);
}

.calendar-day header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.calendar-day header span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.calendar-day header b {
  color: var(--green-700);
  font-size: 11px;
}

.calendar-events {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.calendar-event {
  min-width: 0;
  padding: 7px 8px;
  display: grid;
  gap: 3px;
  border: 0;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  color: #17382e;
  background: rgba(62, 133, 105, 0.1);
  text-align: left;
}

.calendar-event.is-material {
  border-left-color: var(--amber);
  background: rgba(201, 145, 73, 0.12);
}

.calendar-event.is-acceptance {
  border-left-color: var(--blue);
  background: rgba(79, 130, 164, 0.12);
}

.calendar-event small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.calendar-event span {
  overflow: hidden;
  display: -webkit-box;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.node-materials-section {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(32, 96, 74, 0.16);
  border-radius: 12px;
  background: #f7f3eb;
}

.internal-briefing-section {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid rgba(32, 96, 74, 0.18);
  border-radius: 13px;
  background: #f7f3eb;
}

.internal-assignment-editor {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 15px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
}

.internal-assignment-editor .field {
  flex: 1;
}

.internal-briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.internal-briefing-grid .field-wide {
  grid-column: 1 / -1;
}

.internal-briefing-grid textarea {
  min-height: 88px;
  resize: vertical;
}

.node-material-list {
  margin-top: 15px;
  display: grid;
  gap: 11px;
}

.node-material-item {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px auto auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdf9;
}

.node-material-item.is-missing {
  border-color: rgba(180, 76, 60, 0.25);
  background: rgba(190, 76, 60, 0.045);
}

.node-material-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.node-material-copy strong {
  color: var(--green-900);
  font-size: 16px;
  line-height: 1.35;
}

.node-material-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

.material-required {
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #a24e3e;
  background: rgba(190, 76, 60, 0.1);
  font-size: 10px;
}

.node-material-item select {
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
}

.material-view-only {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.node-material-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.55;
}

.node-materials-section .node-photo-header strong {
  font-size: 16px;
}

.node-materials-section .node-photo-header small {
  font-size: 12px;
  line-height: 1.45;
}

.node-aux-materials-section {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(159, 112, 62, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 247, 230, 0.96), rgba(247, 242, 232, 0.92));
}

.node-aux-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
}

.node-aux-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.node-aux-heading .eyebrow {
  font-size: 9px;
}

.node-aux-heading strong {
  color: var(--green-900);
  font-size: 16px;
}

.node-aux-heading small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.node-aux-totals {
  display: flex;
  align-items: center;
  gap: 7px;
}

.node-aux-totals span {
  min-width: 118px;
  padding: 8px 10px;
  border: 1px solid rgba(159, 112, 62, 0.18);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
  font-size: 10px;
}

.node-aux-totals b {
  display: block;
  margin-top: 3px;
  color: #8a572f;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.node-aux-material-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.node-aux-material-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(159, 112, 62, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.74);
}

.node-aux-material-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.node-aux-material-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.node-aux-material-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  white-space: normal;
}

.node-aux-amount {
  color: #8a572f;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.node-aux-empty {
  padding: 17px;
  border: 1px dashed rgba(159, 112, 62, 0.24);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
  text-align: center;
  font-size: 11px;
}

.node-aux-status {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.aux-material-editor-modal {
  width: min(680px, 100%);
}

.aux-material-amount-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(159, 112, 62, 0.2);
  border-radius: 10px;
  background: #f8f1e5;
}

.aux-material-amount-preview span {
  color: var(--muted);
  font-size: 11px;
}

.aux-material-amount-preview strong {
  color: #8a572f;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.material-editor-modal {
  width: min(760px, 100%);
}

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

.material-spec-editor {
  padding: 12px;
  border: 1px solid rgba(32, 96, 74, 0.16);
  border-radius: 11px;
  background: #f7f3eb;
}

.material-spec-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.material-spec-heading > div {
  display: grid;
  gap: 3px;
}

.material-spec-heading small,
.material-spec-total {
  color: var(--muted);
  font-size: 9px;
}

.material-spec-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.material-spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 100px 30px;
  gap: 8px;
  align-items: center;
}

.material-spec-row input {
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-spec-remove {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(190, 76, 60, 0.25);
  border-radius: 8px;
  color: #a24e3e;
  background: rgba(190, 76, 60, 0.06);
  cursor: pointer;
}

.material-required-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.material-required-field small {
  grid-column: 1 / -1;
}

.material-required-field input {
  width: 18px;
  height: 18px;
}

.material-photo-section {
  margin: 18px 0;
  padding: 15px;
  border: 1px solid rgba(32, 96, 74, 0.16);
  border-radius: 12px;
  background: #f7f3eb;
}

.material-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.material-photo-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
}

.material-photo-item img {
  width: 100%;
  height: 105px;
  object-fit: cover;
  display: block;
}

.material-photo-item div {
  padding: 8px;
}

.material-photo-item strong,
.material-photo-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-photo-item strong {
  font-size: 9px;
}

.material-photo-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.material-photo-item .text-button {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 3px 6px;
  border-radius: 6px;
  color: #fff;
  background: rgba(22, 47, 37, 0.8);
}

.material-photo-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.material-photo-upload input {
  max-width: 100%;
}

.material-photo-upload span {
  color: var(--muted);
  font-size: 9px;
}

.danger-text {
  color: #a24e3e !important;
}

@media (max-width: 700px) {
  .internal-briefing-grid {
    grid-template-columns: 1fr;
  }

  .internal-assignment-editor {
    align-items: stretch;
    flex-direction: column;
  }

  .node-material-item {
    grid-template-columns: 1fr auto;
  }

  .node-material-copy {
    grid-column: 1 / -1;
  }

  .node-materials-section .node-photo-header {
    align-items: stretch;
    flex-direction: column;
  }

  .node-material-actions {
    width: 100%;
  }

  .node-material-actions .button {
    flex: 1;
  }

  .node-materials-section .button,
  .node-materials-section .text-button {
    font-size: 12px;
  }

  .node-material-item select {
    width: 100%;
    grid-column: 1 / -1;
  }

  .node-aux-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .node-aux-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .node-aux-totals span {
    min-width: 0;
  }

  .node-aux-heading > .button {
    width: 100%;
  }

  .node-aux-material-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .node-aux-material-copy {
    grid-column: 1 / -1;
  }

  .node-aux-amount {
    grid-column: 1;
    grid-row: 2;
  }

  .node-aux-material-item .text-button {
    grid-row: 2;
  }

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

  .material-spec-row {
    grid-template-columns: minmax(0, 1fr) 78px 78px 30px;
  }

  .material-template-save,
  .material-template-item,
  .material-project-bulk-bar,
  .material-project-result {
    grid-template-columns: 1fr;
  }

  .material-project-bulk-bar,
  .material-project-result {
    align-items: stretch;
    flex-direction: column;
  }

  .material-photo-upload {
    align-items: flex-start;
    flex-direction: column;
  }

  .final-acceptance-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .final-acceptance-submit-button {
    width: 100%;
  }

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

  .manager-rectification-upload {
    grid-template-columns: 1fr;
  }

  .site-completion-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .company-restore-controls {
    grid-template-columns: 1fr;
  }

  .company-restore-actions {
    flex-direction: column;
  }

  .company-restore-actions .button {
    width: 100%;
  }

  .calendar-header,
  .calendar-controls,
  .calendar-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-event-count {
    margin-left: 0;
  }

  .calendar-shell {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 900px;
  }
}

.holiday-period-section {
  padding: 13px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 11px;
  background: #f8f4ec;
}

.holiday-period-list {
  display: grid;
  gap: 7px;
}

.holiday-period-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fffdf9;
}

.holiday-period-item > div {
  display: grid;
  gap: 2px;
}

.holiday-period-item strong {
  color: var(--green-900);
  font-size: 11px;
}

.holiday-period-item span,
.holiday-period-empty {
  color: var(--muted);
  font-size: 9px;
}

.holiday-period-editor {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr) auto;
  align-items: end;
  gap: 8px;
}

.holiday-period-editor label {
  display: grid;
  gap: 5px;
}

.holiday-period-editor label span {
  color: var(--muted);
  font-size: 9px;
}

.holiday-period-editor input {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
}

.account-security-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.account-security-heading p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.password-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.password-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

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

.material-project-hidden {
  display: none;
}

.half-package-fields {
  display: none;
}

.modal[data-package-type="half"] .full-package-field {
  display: none;
}

.modal[data-package-type="half"] .half-package-fields {
  display: grid;
  gap: 8px;
}

.half-package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.half-package-grid label {
  display: grid;
  gap: 5px;
}

.half-package-grid label span {
  color: var(--muted);
  font-size: 9px;
}

.half-package-grid select {
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
}

.field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field-help {
  color: var(--muted);
  font-size: 9px;
}

.waterproof-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.waterproof-date-grid label {
  display: grid;
  gap: 5px;
}

.waterproof-date-grid label > span {
  color: var(--muted);
  font-size: 9px;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #ddd6ca;
  border-radius: 10px;
  color: var(--ink);
  background: #fffdf9;
}

.field input[readonly] {
  color: var(--green-800);
  border-color: rgba(21, 59, 50, 0.16);
  background: var(--green-100);
  cursor: default;
}

.field textarea {
  width: 100%;
  min-height: 150px;
  padding: 11px;
  border: 1px solid #ddd6ca;
  border-radius: 10px;
  color: var(--ink);
  background: #fffdf9;
  resize: vertical;
  line-height: 1.65;
}

@media (max-width: 680px) {
  .waterproof-date-grid {
    grid-template-columns: 1fr;
  }
}

.weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.weekday {
  min-width: 43px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
}

.weekday.is-off {
  color: #a49b8e;
  background: #f1eee8;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 4px;
}

.settings-note {
  padding: 16px;
  border-radius: 14px;
  color: #31443e;
  background: var(--green-100);
  font-size: 11px;
  line-height: 1.7;
}

.settings-note strong {
  display: block;
  margin-bottom: 4px;
}

.rule-list {
  display: grid;
  gap: 13px;
}

.rule-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 11px;
  align-items: start;
}

.rule-number {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

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

.rule-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  z-index: 95;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 27, 23, 0.52);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: min(590px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(5, 20, 16, 0.28);
  transform: translateY(8px) scale(0.99);
  transition: transform 180ms ease;
}

.modal-backdrop.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.modal-header h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 24px;
}

.node-project-context {
  margin: -6px 0 18px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(21, 59, 50, 0.1);
  border-radius: 11px;
  background: var(--green-100);
}

.node-project-context span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.node-project-context strong {
  color: var(--green-900);
  font-size: 12px;
}

.node-photo-section {
  margin: -3px 0 19px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.node-photo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.node-photo-header strong {
  display: block;
  font-size: 12px;
}

.node-photo-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.node-photo-count {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 9px;
  font-weight: 700;
}

.node-photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.node-photo-empty {
  grid-column: 1 / -1;
  padding: 17px 12px;
  border: 1px dashed #d5ccbe;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.node-photo-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #15211c;
}

.node-photo-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.node-photo-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.node-photo-preview:hover img {
  filter: brightness(0.88);
}

.node-photo-review-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: rgba(23, 38, 32, 0.78);
  font-size: 8px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.node-photo-review-badge.is-approved {
  background: rgba(50, 123, 89, 0.9);
}

.node-photo-review-badge.is-rejected {
  background: rgba(177, 66, 60, 0.9);
}

.node-photo-meta {
  padding: 6px 7px;
  color: #e8f0eb;
  background: #172620;
  font-size: 8px;
}

.node-photo-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-photo-meta span {
  display: block;
  margin-top: 2px;
  color: rgba(232, 240, 235, 0.56);
}

.node-photo-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(20, 28, 24, 0.72);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.node-photo-review-controls {
  padding: 0 7px 7px;
  display: flex;
  gap: 5px;
  background: #172620;
}

.node-photo-review-controls button {
  flex: 1;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  color: #eaf3ee;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-size: 8px;
}

.node-photo-review-controls button.approve {
  color: #c9f0da;
  border-color: rgba(108, 191, 147, 0.3);
}

.node-photo-review-controls button.reject {
  color: #ffd1cb;
  border-color: rgba(225, 112, 105, 0.3);
}

.node-photo-upload {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.node-photo-upload input[type="file"] {
  min-width: 0;
  flex: 1;
  color: var(--muted);
  font-size: 9px;
}

.node-photo-upload input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 9px;
}

.node-photo-upload .button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 10px;
}

#photo-upload-status {
  flex-basis: 100%;
  min-height: 13px;
  color: var(--muted);
  font-size: 9px;
}

.photo-lightbox {
  position: fixed;
  z-index: 180;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(8, 18, 14, 0.84);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.photo-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.photo-lightbox-panel {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 18px;
  background: #111b17;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.photo-lightbox-panel > img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #0a100d;
}

.photo-lightbox-close {
  position: sticky;
  z-index: 2;
  top: 12px;
  float: right;
  width: 36px;
  height: 36px;
  margin: 12px 12px -48px 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 16, 13, 0.74);
  cursor: pointer;
  font-size: 22px;
}

.photo-lightbox-info {
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  color: #eef6f2;
}

.photo-lightbox-info strong {
  font-size: 13px;
}

.photo-lightbox-info p {
  margin: 4px 0 0;
  color: rgba(238, 246, 242, 0.58);
  font-size: 10px;
  line-height: 1.55;
}

.photo-lightbox-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
}

.photo-lightbox-actions button {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 10px;
}

.photo-lightbox-actions button.approve {
  color: #d1f2df;
  border-color: rgba(108, 191, 147, 0.3);
}

.photo-lightbox-actions button.reject {
  color: #ffd1cb;
  border-color: rgba(225, 112, 105, 0.3);
}

@media (max-width: 640px) {
  .preacceptance-gallery {
    grid-template-columns: 1fr;
  }

  .completed-media-grid {
    grid-template-columns: 1fr;
  }

  .material-project-search {
    grid-template-columns: 1fr;
  }

  .holiday-period-editor {
    grid-template-columns: 1fr;
  }

  .half-package-grid {
    grid-template-columns: 1fr;
  }


  .photo-lightbox {
    padding: 10px;
  }

  .photo-lightbox-info {
    display: grid;
  }

  .photo-lightbox-actions {
    justify-content: flex-end;
  }
}

.icon-button {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modal-compact {
  width: min(520px, 100%);
}

.modal-note {
  margin-top: 16px;
}

.delete-summary {
  padding: 14px;
  border-radius: 12px;
  color: #394640;
  background: var(--amber-soft);
  font-size: 11px;
  line-height: 1.7;
}

.delete-summary strong {
  display: block;
  margin-bottom: 3px;
}

.delete-summary + .field {
  margin-top: 16px;
}

.owner-only,
.company-only,
.owner-selectable,
.custom-mode-selectable,
.production-days-only,
.custom-order-date-field {
  display: none;
}

.modal[data-node-owner="true"] .owner-only {
  display: grid;
}

.modal[data-node-owner="false"] .company-only {
  display: grid;
}

.modal[data-install-only="true"] .company-only {
  display: none;
}

.modal[data-no-material-fields="true"] .company-only {
  display: none;
}

.modal[data-install-only="true"] .crew-status-field {
  display: none;
}

.modal[data-install-only="true"] .duration-field {
  display: none;
}

.modal[data-review-only="true"] .duration-field,
.modal[data-review-only="true"] .actual-start-field,
.modal[data-review-only="true"] .actual-end-field,
.modal[data-review-only="true"] .calculated-end-field,
.modal[data-review-only="true"] .crew-status-field {
  display: none;
}

.modal[data-dates-owner-only="true"] .status-field,
.modal[data-dates-owner-only="true"] .duration-field,
.modal[data-dates-owner-only="true"] .production-days-only,
.modal[data-dates-owner-only="true"] .calculated-end-field,
.modal[data-dates-owner-only="true"] .company-only,
.modal[data-dates-owner-only="true"] .crew-status-field,
.modal[data-dates-owner-only="true"] .note-field {
  display: none;
}

.modal[data-preacceptance-only="true"] .status-field,
.modal[data-preacceptance-only="true"] .duration-field,
.modal[data-preacceptance-only="true"] .production-days-only,
.modal[data-preacceptance-only="true"] .actual-start-field,
.modal[data-preacceptance-only="true"] .actual-end-field,
.modal[data-preacceptance-only="true"] .calculated-end-field,
.modal[data-preacceptance-only="true"] .company-only,
.modal[data-preacceptance-only="true"] .crew-status-field,
.modal[data-preacceptance-only="true"] .note-field {
  display: none;
}

.modal[data-owner-selectable="true"] .owner-selectable {
  display: grid;
}

.modal[data-custom-mode-selectable="true"] .custom-mode-selectable {
  display: grid;
}

.modal[data-production-days="true"] .production-days-only {
  display: grid;
}

.modal[data-custom-order-date="true"] .custom-order-date-field {
  display: grid;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 25px;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 11px;
  color: #fff;
  background: var(--green-900);
  box-shadow: 0 12px 35px rgba(5, 20, 16, 0.22);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-project-trigger,
.mobile-bottom-nav,
.project-drawer-backdrop {
  display: none;
}

.project-drawer-backdrop {
  position: fixed;
  z-index: 92;
  inset: 0;
  align-items: flex-end;
  background: rgba(8, 19, 16, 0.48);
}

.project-drawer-backdrop.is-open {
  display: flex;
}

.project-drawer-sheet {
  width: 100%;
  min-height: 0;
  max-height: 82vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 10px 18px max(24px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -20px 50px rgba(8, 19, 16, 0.22);
}

.project-drawer-handle {
  width: 42px;
  height: 4px;
  justify-self: center;
  border-radius: 999px;
  background: rgba(21, 59, 50, 0.22);
}

.project-drawer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.project-drawer-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.project-drawer-search {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.project-drawer-list {
  min-height: 0;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.project-drawer-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 11px;
  background: #fffdf9;
  text-align: left;
}

.project-drawer-item.is-active {
  border-color: var(--green-700);
  background: var(--green-100);
}

.project-drawer-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-700);
}

.project-drawer-item-dot.is-red {
  background: var(--red);
}

.project-drawer-item-dot.is-orange {
  background: var(--amber);
}

.project-drawer-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-drawer-item-copy strong,
.project-drawer-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-drawer-item-copy strong {
  font-size: 12px;
}

.project-drawer-item-copy small {
  color: var(--muted);
  font-size: 9px;
}

.project-drawer-item-count {
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}

.more-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.more-feature-button {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 14px;
  background: #fffdf9;
  text-align: left;
}

.more-feature-button strong {
  color: var(--green-900);
  font-size: 13px;
}

.more-feature-button span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.more-feature-button[data-more-action="add-project"] {
  border-color: rgba(21, 59, 50, 0.2);
  background: var(--green-100);
}

.more-account-card {
  margin-top: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 14px;
  background: #fffdf9;
}

.more-account-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.more-account-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--green-800);
  font-size: 14px;
  font-weight: 800;
}

.more-account-identity > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.more-account-identity strong {
  overflow: hidden;
  color: var(--green-900);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-account-identity small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-logout-button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid rgba(176, 63, 49, 0.22);
  border-radius: 9px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 220px;
    --project-rail-width: 242px;
  }

  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .focus-card {
    min-height: 0;
  }

  .brief-layout {
    grid-template-columns: 1fr;
  }

  .current-stage-card {
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  }

  .current-stage-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .schedule-table-head {
    display: none;
  }

  .schedule-row {
    grid-template-columns: 42px minmax(150px, 1fr) minmax(170px, 1fr) 90px 76px 42px;
  }

  .duration-cell {
    display: none;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .project-rail {
    display: none;
  }

  .mobile-project-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 0 20px 10px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 16px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    overflow: visible;
  }

  .brand-copy small,
  .side-project,
  .sidebar-note,
  .sidebar-footer {
    display: none;
  }

  .brand {
    padding: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .main-nav {
    margin: 0 0 0 auto;
    display: flex;
    gap: 3px;
  }

  .nav-item {
    width: auto;
    min-width: 44px;
    padding: 9px;
    display: flex;
    justify-content: center;
  }

  .nav-item > span:not(.nav-icon):not(.nav-count) {
    display: none;
  }

  .nav-count {
    position: absolute;
    margin: -22px -22px 0 0;
  }

  .topbar {
    min-height: 104px;
    padding: 20px 20px 15px;
  }

  .mobile-project-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 0 20px 10px;
  }

  .mobile-project-bar label {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 5px;
  }

  .mobile-project-bar label > span {
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-project-bar select {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: var(--surface);
    font-size: 12px;
  }

  .mobile-brand {
    display: none;
  }

  .main-content {
    padding: 0 18px 40px;
  }

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

  .stat-grid.has-overview-cost {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card.overview-aux-cost-card {
    display: none;
  }

  .mobile-overview-aux-cost {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 15px;
    border: 1px solid rgba(240, 212, 174, 0.28);
    border-radius: 12px;
    background: rgba(255, 247, 232, 0.11);
  }

  .mobile-overview-aux-cost > div {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .mobile-overview-aux-cost span {
    color: rgba(255, 245, 232, 0.72);
    font-size: 10px;
  }

  .mobile-overview-aux-cost small {
    color: rgba(255, 245, 232, 0.55);
    font-size: 9px;
    line-height: 1.45;
  }

  .mobile-overview-aux-cost > strong {
    flex: 0 0 auto;
    color: #ffe0b8;
    font-family: "Songti SC", "SimSun", Georgia, serif;
    font-size: 23px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

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

  .current-stage-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .current-stage-details {
    padding: 17px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(193, 155, 126, 0.24);
  }

  .current-stage-action {
    grid-column: auto;
  }

  .audit-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

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

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

  .portfolio-glance {
    grid-template-columns: 1fr auto;
  }

  .portfolio-glance-numbers {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .employee-head {
    display: none;
  }

  .material-task-row {
    grid-template-columns: 18px 8px minmax(0, 1fr) auto;
  }

  .material-task-project,
  .material-task-node,
  .material-task-dates {
    grid-column: 3;
  }

  .material-task-row .button {
    grid-column: 4;
    grid-row: 1 / 4;
    align-self: center;
  }

  .employee-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }

  .employee-id,
  .employee-roles {
    grid-column: 1;
  }

  .employee-status {
    grid-column: 1;
  }

  .employee-actions {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .auth-screen {
    align-items: start;
    overflow-y: auto;
    padding: 20px 14px 55px;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 22px;
  }

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

  .role-choice {
    min-height: 102px;
  }

  .demo-access {
    display: grid;
    gap: 3px;
  }

  .user-chip {
    min-width: 0;
    padding-right: 7px;
  }

  .user-chip > span:last-child {
    display: none;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .topbar {
    align-items: flex-end;
  }

  .topbar-actions .button-secondary {
    display: none;
  }

  .button {
    padding-inline: 13px;
  }

  .hero-card {
    padding: 24px 21px;
  }

  .hero-topline {
    display: block;
  }

  .hero-badge {
    margin-top: 15px;
  }

  .hero-progress {
    margin-top: 38px;
  }

  .hero-meta {
    gap: 7px 15px;
  }

  .stat-card {
    min-height: 100px;
    padding: 16px;
  }

  .stat-value {
    font-size: 23px;
  }

  .current-stage-card {
    padding: 20px 18px;
  }

  .current-stage-number {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 15px;
    font-size: 20px;
  }

  .current-stage-details {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .current-stage-action {
    width: 100%;
  }

  .portfolio-glance {
    grid-template-columns: 1fr;
  }

  .portfolio-glance .button {
    width: 100%;
  }

  .portfolio-risk-row {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .portfolio-risk-meta {
    grid-column: 2;
    grid-template-columns: 1fr auto;
    justify-items: start;
    align-items: center;
  }

  .brief-stat {
    padding: 15px;
  }

  .operation-log-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .notification-item {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .notification-actions {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .material-task-row {
    grid-template-columns: 18px 8px minmax(0, 1fr);
  }

  .material-task-row .button {
    grid-column: 2 / -1;
    grid-row: auto;
    justify-self: start;
  }

  .material-workbench-tools,
  .material-bulk-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .material-task-search {
    min-width: 0;
  }

  .material-task-result-count {
    margin-left: 0;
  }

  .panel,
  .focus-card {
    padding: 18px;
  }

  .schedule-header {
    display: block;
  }

  .legend {
    margin-top: 12px;
  }

  .schedule-row {
    grid-template-columns: 36px minmax(0, 1fr) 38px;
    gap: 10px;
    min-height: 89px;
    padding: 13px 14px;
  }

  .schedule-row > .date-range {
    grid-column: 2 / 3;
  }

  .schedule-row > .contract-cell,
  .schedule-row > .status-cell {
    display: none;
  }

  .mobile-node-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
  }

  .mobile-node-contract {
    color: var(--muted);
    font-size: 9px;
  }

  .mobile-node-duration {
    color: var(--green-800);
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-node-risk {
    width: 100%;
    padding: 5px 8px;
    border-radius: 7px;
    color: var(--amber);
    background: var(--amber-soft);
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-node-risk.is-red {
    color: var(--red);
    background: var(--red-soft);
  }

  .schedule-row[data-mobile-edit-node] {
    cursor: pointer;
  }

  .schedule-row > .edit-node {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .schedule-index {
    width: 29px;
    height: 29px;
  }

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

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

  .account-security-heading {
    display: grid;
  }

  .alert-card {
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 13px;
  }

  .alert-meta {
    grid-column: 2;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .alert-meta button {
    margin-top: 0;
  }

  .project-admin-strip,
  .audit-card {
    grid-template-columns: 1fr;
  }

  .project-admin-actions,
  .audit-actions {
    justify-content: flex-start;
  }

  .archive-item {
    display: grid;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .modal {
    padding: 20px;
  }
}

@media (max-width: 980px) {
  .completed-project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  html {
    scroll-behavior: auto;
  }

  body {
    background: var(--paper);
  }

  .topbar {
    position: relative;
    z-index: 1;
    background: #f7f9f8;
    backdrop-filter: none;
  }

  .mobile-bottom-nav {
    background: #fffdf9;
    box-shadow: 0 -4px 14px rgba(20, 32, 27, 0.06);
    backdrop-filter: none;
  }

  .modal-backdrop,
  .auth-card {
    backdrop-filter: none;
  }

  .schedule-row,
  .portfolio-project-card,
  .material-task-row,
  .notification-item,
  .alert-card,
  .operation-log-item {
    content-visibility: auto;
    contain-intrinsic-size: auto 92px;
  }

  .eyebrow,
  .badge,
  .completion-date,
  .mobile-node-contract,
  .mobile-node-duration,
  .mobile-node-risk,
  .current-row-tag,
  .schedule-node small,
  .material-task-project small,
  .material-task-node small,
  .material-task-node span,
  .material-task-dates span,
  .notification-item small,
  .notification-item span,
  .alert-card p,
  .alert-meta,
  .operation-log-item small {
    font-size: 11px !important;
    line-height: 1.5;
  }

  .schedule-node strong {
    font-size: 13px;
  }

  .date-range small {
    font-size: 11px !important;
    line-height: 1.5;
  }

  .sidebar .main-nav {
    display: none;
  }

  [data-action="add-project"] {
    display: none;
  }

  #quick-update-button,
  #print-button,
  #admin-shortcut {
    display: none;
  }

  .mobile-project-select-native {
    display: none;
  }

  .mobile-project-trigger {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
  }

  .mobile-project-trigger span:last-child {
    color: var(--muted);
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 72;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(21, 59, 50, 0.12);
    background: #fffdf9;
    box-shadow: 0 -4px 14px rgba(20, 32, 27, 0.07);
    backdrop-filter: none;
  }

  .mobile-bottom-item {
    position: relative;
    min-height: 52px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-bottom-item.is-active {
    color: var(--green-900);
    background: var(--green-100);
  }

  .mobile-bottom-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-bottom-count {
    position: absolute;
    top: 3px;
    right: calc(50% - 24px);
    display: none;
    min-width: 16px;
    height: 16px;
    place-items: center;
    padding: 0 4px;
    border-radius: 999px;
    color: #fff;
    background: var(--red);
    font-size: 9px;
  }

  .mobile-bottom-count[data-count]:not([data-count="0"]) {
    display: grid;
  }

  .main-content {
    padding-bottom: 104px;
  }

  .toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .app-version {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .mobile-project-bar {
    flex-wrap: wrap;
  }

  .mobile-project-bar label {
    flex-basis: 100%;
  }

  .more-feature-grid {
    grid-template-columns: 1fr;
  }

  .more-account-card {
    align-items: stretch;
    flex-direction: column;
  }

  .more-logout-button {
    width: 100%;
    min-height: 42px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 20px 20px 0 0;
  }

  .modal-footer {
    position: sticky;
    z-index: 4;
    bottom: -1px;
    margin-top: 18px;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
    background: var(--surface);
  }

}

/* Visual system refresh: calm construction operations console */
:root {
  --ink: #17231f;
  --muted: #6b7772;
  --line: #e2e8e5;
  --paper: #f3f6f5;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --green-950: #0d211b;
  --green-900: #14352c;
  --green-800: #1f5849;
  --green-100: #e5f2ed;
  --orange: #d97745;
  --orange-soft: #fff2e9;
  --red: #c34f48;
  --red-soft: #fff0ef;
  --amber: #b7791f;
  --amber-soft: #fff6df;
  --blue: #3c7194;
  --blue-soft: #eef6fa;
  --success: #2f7b5f;
  --success-soft: #ecf7f1;
  --shadow: 0 20px 55px rgba(17, 42, 33, 0.09);
  --shadow-small: 0 8px 24px rgba(17, 42, 33, 0.055);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 238px;
  --project-rail-width: 286px;
}

html {
  background: var(--paper);
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(circle at 84% -12%, rgba(77, 137, 113, 0.1), transparent 28rem),
    linear-gradient(180deg, #f7f9f8 0%, var(--paper) 32%, #f1f4f3 100%);
  overscroll-behavior-y: none;
  font-family:
    "Microsoft YaHei UI",
    "PingFang SC",
    "Noto Sans CJK SC",
    "Segoe UI",
    sans-serif;
}

.auth-screen {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 82% 12%, rgba(211, 142, 86, 0.2), transparent 28rem),
    linear-gradient(135deg, #0d241d 0%, #173a30 55%, #0d211b 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.auth-card {
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 32px 90px rgba(0, 15, 10, 0.34);
  backdrop-filter: blur(22px);
}

.auth-step h1 {
  font-family: inherit;
  font-size: clamp(28px, 3.6vw, 36px);
  font-weight: 750;
}

.auth-brand {
  border-color: #e7ece9;
}

.auth-brand strong {
  font-weight: 800;
}

.sidebar {
  padding: 24px 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 34%),
    linear-gradient(180deg, #122e26 0%, #0e241e 100%);
  box-shadow: 12px 0 35px rgba(13, 33, 27, 0.08);
}

.brand {
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: linear-gradient(145deg, #2a6857, #174537);
  box-shadow: 0 8px 20px rgba(1, 16, 11, 0.28);
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-copy small {
  margin-top: 2px;
  color: rgba(230, 245, 238, 0.48);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.main-nav {
  margin-top: 22px;
  gap: 3px;
}

.nav-item {
  position: relative;
  min-height: 42px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 9px;
  color: rgba(233, 245, 240, 0.63);
  font-size: 12px;
  font-weight: 600;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.105);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: #dfa173;
  transform: translateY(-50%);
}

.nav-icon {
  opacity: 0.78;
}

.nav-item.is-active .nav-icon {
  opacity: 1;
}

.sidebar-note {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-footer {
  border-color: rgba(255, 255, 255, 0.08);
}

.role-switch {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.topbar {
  position: sticky;
  z-index: 38;
  top: 0;
  min-height: 94px;
  padding: 20px clamp(24px, 3.4vw, 44px) 18px;
  border-bottom: 1px solid rgba(219, 227, 223, 0.86);
  background: rgba(247, 249, 248, 0.88);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin-bottom: 5px;
  color: #7a8882;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.topbar h1 {
  font-family: inherit;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.user-chip {
  min-height: 42px;
  border-color: #dfe6e2;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(14, 36, 29, 0.035);
}

.user-avatar {
  border-radius: 9px;
  font-family: inherit;
  font-weight: 750;
}

.button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.button-primary {
  background: var(--green-800);
  box-shadow: 0 5px 14px rgba(20, 74, 59, 0.16);
}

.button-secondary {
  border-color: #dfe6e2;
  background: #fff;
}

.button-secondary:hover {
  border-color: #bfcfc8;
  background: #f8fbf9;
}

.main-content {
  padding: 24px clamp(22px, 3.4vw, 44px) 52px;
}

.portfolio-glance,
.focus-card,
.current-stage-card,
.stat-card,
.panel,
.brief-panel,
.schedule-panel,
.settings-panel,
.admin-backup-panel,
.project-admin-strip,
.notification-item,
.audit-card,
.completed-project-card {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-small);
}

.portfolio-glance {
  padding: 14px 18px;
  border-radius: 12px;
}

.portfolio-glance strong {
  font-size: 12px;
  font-weight: 750;
}

.hero-card {
  min-height: 286px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(135deg, #174638 0%, #112e26 72%, #0c231c 100%);
  box-shadow: 0 20px 52px rgba(12, 45, 34, 0.16);
}

.hero-card::before {
  border-color: rgba(255, 255, 255, 0.08);
}

.hero-label,
.hero-address,
.hero-progress-copy,
.hero-meta {
  color: rgba(234, 246, 240, 0.62);
}

.hero-title,
.current-stage-identity h2,
.panel-title h2,
.hero-progress-copy strong,
.stat-value,
.brief-stat strong {
  font-family: inherit;
  font-weight: 700;
}

.hero-title {
  font-size: clamp(23px, 2.7vw, 33px);
  letter-spacing: -0.03em;
}

.hero-badge {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.09);
  font-size: 10px;
}

.focus-card {
  border-radius: 14px;
}

.focus-list {
  border-color: #e7ece9;
  background: #e7ece9;
}

.focus-item {
  padding: 13px;
}

.focus-item strong {
  font-size: 12px;
  font-weight: 700;
}

.current-stage-card {
  padding: 22px 24px;
  border-color: #e2e8e5;
  border-left: 3px solid var(--orange);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.current-stage-card::before {
  display: none;
}

.current-stage-number {
  border-radius: 12px;
  background: #d97745;
  box-shadow: 0 8px 20px rgba(199, 97, 52, 0.2);
  font-family: inherit;
  font-size: 20px;
}

.current-stage-kicker {
  color: #b76134;
}

.current-stage-details {
  border-color: #edf0ee;
}

.current-stage-action {
  background: #d97745;
}

.stat-card {
  position: relative;
  min-height: 106px;
  overflow: hidden;
  border-radius: 12px;
}

.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--stat-color, var(--orange));
  opacity: 0.75;
}

.stat-label {
  font-weight: 600;
}

.stat-value {
  font-size: 25px;
  letter-spacing: -0.035em;
}

.panel,
.brief-panel,
.settings-panel {
  border-radius: 14px;
}

.panel-title h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.schedule-header {
  margin-bottom: 18px;
}

.schedule-header h2 {
  font-family: inherit;
  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.schedule-panel {
  border-radius: 14px;
}

.schedule-table-head {
  min-height: 44px;
  background: #f5f8f6;
  font-weight: 700;
}

.schedule-row {
  min-height: 75px;
}

.schedule-row:hover {
  background: #f8faf9;
}

.schedule-row.is-current {
  background: linear-gradient(90deg, #fff3ec, #fff 45%);
  box-shadow: inset 3px 0 0 var(--orange);
}

.schedule-index {
  border-radius: 8px;
}

.risk-summary {
  gap: 10px;
}

.risk-stat,
.brief-stat {
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.alert-card {
  border-radius: 12px;
  background: #fff;
}

.badge {
  border-radius: 999px;
  font-weight: 700;
}

.project-rail {
  padding: 16px;
  border-color: #e0e7e3;
  background: #f5f8f6;
}

.project-rail .side-project {
  padding: 16px 14px 14px;
  border-color: #e0e7e3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 42, 33, 0.06);
}

.project-rail .side-label {
  font-size: 13px;
  font-weight: 800;
}

.project-rail .side-project-count {
  background: #e6f2ed;
}

.project-rail .side-project-search input {
  min-height: 38px;
  border-color: #e2e8e5;
  background: #f7f9f8;
}

.project-rail .side-project-item {
  border-radius: 9px;
}

.project-rail .side-project-item.is-active {
  border-color: #f0d5c4;
  background: #fff4ec;
}

.project-rail .side-add-project {
  min-height: 38px;
  border-radius: 9px;
}

.modal {
  border-color: #dfe6e2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 32px 90px rgba(6, 30, 22, 0.26);
}

.modal-header {
  border-color: #edf1ef;
}

.modal-header h2 {
  font-family: inherit;
  font-weight: 750;
}

.field > span {
  color: #4d5a55;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  border-color: #dce4e0;
  border-radius: 9px;
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #78a797;
  box-shadow: 0 0 0 3px rgba(67, 130, 108, 0.1);
}

.notification-item {
  border-radius: 12px;
}

.toast {
  border-radius: 9px;
  background: #17372e;
}

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 216px;
    --project-rail-width: 248px;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: relative;
    min-height: 90px;
    padding: 18px 18px 14px;
    background: transparent;
    backdrop-filter: none;
  }

  .mobile-project-bar {
    padding: 0 18px 12px;
  }

  .main-content {
    padding: 12px 16px 106px;
  }

  .mobile-bottom-nav {
    border-color: #e0e7e3;
    background: rgba(255, 255, 255, 0.96);
  }

  .mobile-bottom-item {
    border-radius: 8px;
  }

  .mobile-bottom-item.is-active {
    background: #e8f3ee;
  }
}

@media (max-width: 640px) {
  .topbar h1 {
    font-size: 25px;
  }

  .hero-card {
    min-height: auto;
    border-radius: 14px;
  }

  .current-stage-card,
  .panel,
  .brief-panel,
  .settings-panel {
    border-radius: 13px;
  }
}

.platform-admin-section {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid #dfe7e3;
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(32, 88, 73, 0.055), transparent 42%),
    #fff;
  box-shadow: var(--shadow-small);
}

.company-license-banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(47, 123, 95, 0.16);
  border-radius: 13px;
  background: linear-gradient(110deg, #edf8f2, #fff);
}

.company-license-banner.is-warning {
  border-color: rgba(195, 79, 72, 0.18);
  background: linear-gradient(110deg, #fff0ef, #fff);
}

.company-license-banner.is-expiring {
  border-color: rgba(183, 121, 31, 0.2);
  background: linear-gradient(110deg, #fff8e8, #fff);
}

.company-license-banner.is-expiring strong {
  color: var(--amber);
}

.company-license-banner > div {
  display: grid;
  gap: 3px;
}

.company-license-banner span,
.company-license-banner small {
  color: var(--muted);
  font-size: 9px;
}

.company-license-banner strong {
  color: var(--green-900);
  font-size: 15px;
}

.company-license-banner.is-warning strong {
  color: var(--red);
}

.project-changes-panel {
  margin-bottom: 16px;
}

.preacceptance-item {
  position: relative;
}

.issue-state {
  position: absolute;
  z-index: 2;
  left: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--amber);
  background: rgba(255, 246, 223, 0.94);
  font-size: 8px;
  font-weight: 800;
}

.issue-state.is-resolved {
  color: var(--success);
  background: rgba(236, 247, 241, 0.95);
}

.issue-resolution {
  color: var(--success) !important;
  line-height: 1.55;
}

.rectification-strip {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 9px 9px;
}

.rectification-strip button {
  width: 42px;
  height: 42px;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dbe4df;
  border-radius: 6px;
  color: var(--green-800);
  background: #f3f8f5;
  font-size: 7px;
}

.rectification-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rectification-actions {
  display: flex;
  gap: 6px;
  padding: 0 9px 9px;
}

.rectification-actions .button {
  min-height: 31px;
  padding: 5px 8px;
  font-size: 8px;
}

.workflow-template-panel {
  margin-bottom: 16px;
}

.workflow-template-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.workflow-template-heading h2 {
  margin-top: 3px;
}

.workflow-template-heading p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.workflow-template-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.workflow-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e8e5;
  border-radius: 10px;
  background: #fafcfb;
}

.workflow-template-card > div:first-child {
  display: grid;
  gap: 3px;
}

.workflow-template-card strong {
  font-size: 11px;
}

.workflow-template-card span {
  color: var(--muted);
  font-size: 8px;
}

.workflow-template-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workflow-template-actions .button {
  min-height: 31px;
  padding: 5px 8px;
  font-size: 8px;
}

.danger-text {
  color: var(--red) !important;
}

.workflow-template-empty {
  padding: 16px;
  border: 1px dashed #dbe4df;
  border-radius: 9px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.project-changes-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.project-changes-heading h2 {
  margin-top: 3px;
}

.project-changes-heading p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.change-record-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.change-record {
  padding: 13px;
  border: 1px solid #e2e8e5;
  border-radius: 10px;
  background: #fafcfb;
}

.change-record.is-pending {
  border-color: rgba(183, 121, 31, 0.18);
  background: #fffaf0;
}

.change-record.is-rejected {
  border-color: rgba(195, 79, 72, 0.16);
  background: #fff6f5;
}

.change-record-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.change-record-heading > span,
.change-record-heading > b {
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 8px;
  font-weight: 800;
}

.change-record.is-pending .change-record-heading > b {
  color: var(--amber);
  background: var(--amber-soft);
}

.change-record.is-rejected .change-record-heading > b {
  color: var(--red);
  background: var(--red-soft);
}

.change-record-heading strong {
  font-size: 11px;
}

.change-record > p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.change-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 8px;
}

.change-record > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
}

.change-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
}

.platform-admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.platform-admin-heading h2 {
  margin: 0;
  font-size: 20px;
}

.platform-admin-heading p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.platform-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.platform-summary > div {
  padding: 14px;
  border-radius: 11px;
  background: #f5f8f6;
}

.platform-summary span,
.platform-summary small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.platform-summary strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--green-900);
  font-size: 25px;
  line-height: 1;
}

.platform-company-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.platform-company-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid #e2e8e5;
  border-radius: 12px;
  background: #fff;
}

.platform-company-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.platform-company-main > div {
  min-width: 0;
}

.platform-company-main h3 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-company-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.company-code {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 8px;
  font-weight: 800;
}

.platform-license-state {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.platform-license-state.is-active {
  color: var(--success);
  background: var(--success-soft);
}

.platform-license-state.is-warning {
  color: var(--red);
  background: var(--red-soft);
}

.platform-company-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 9px;
}

.platform-company-metrics b {
  color: var(--ink);
}

.platform-company-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-company-actions .button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 8px;
}

.platform-audit-panel {
  margin-top: 14px;
  border-top: 1px solid #e8eeea;
}

.platform-audit-panel summary {
  padding: 13px 0 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.platform-audit-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f0f3f1;
  font-size: 9px;
}

.platform-audit-row span {
  color: var(--muted);
}

.platform-audit-row time {
  color: var(--muted);
}

.platform-audit-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.company-admin-create {
  padding: 14px;
  border: 1px dashed #d5dfda;
  border-radius: 11px;
  background: #f8faf9;
}

.company-admin-create > span {
  display: block;
  margin-bottom: 10px;
  color: var(--green-900);
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .platform-company-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .platform-admin-section {
    padding: 17px;
  }

  .platform-admin-heading {
    flex-direction: column;
  }

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

  .platform-audit-row {
    grid-template-columns: 1fr;
  }
}

.schedule-row.is-final-blocked,
.schedule-row.is-final-blocked:hover {
  border: 2px solid rgba(195, 79, 72, 0.62);
  border-left-width: 6px;
  background: linear-gradient(90deg, #fff0ef 0%, #fff8f7 55%, #fff 100%);
  box-shadow: 0 8px 22px rgba(195, 79, 72, 0.1);
}

.schedule-row.is-final-blocked .schedule-index {
  color: #fff;
  background: var(--red);
}

.final-blocked-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 9px;
  font-weight: 800;
  vertical-align: middle;
}

.completed-project-grid {
  grid-template-columns: 1fr;
}

.completed-project-card {
  gap: 20px;
  padding: 24px;
}

.completed-project-heading h3 {
  font-size: 23px;
  line-height: 1.35;
}

.completed-project-heading p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.65;
}

.completed-project-heading .badge {
  padding: 7px 12px;
  font-size: 12px;
}

.completed-project-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.completed-project-stats span {
  padding: 11px 12px;
  border-radius: 9px;
  background: #f7f3eb;
  font-size: 12px;
}

.completed-project-stats b {
  font-size: 15px;
}

.completed-project-details summary {
  padding: 10px 0;
  font-size: 14px;
}

.completed-node-list {
  max-height: none;
  gap: 8px;
}

.completed-node-row {
  padding: 10px 12px;
  font-size: 12px;
}

.completed-project-note {
  font-size: 11px;
  line-height: 1.65;
}

.completed-archive-detail {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.archive-detail-section {
  display: grid;
  gap: 11px;
  padding: 17px;
  border: 1px solid rgba(21, 59, 50, 0.12);
  border-radius: 12px;
  background: #fbfaf7;
}

.archive-detail-heading,
.archive-node-heading,
.archive-material-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.archive-detail-heading h4 {
  margin: 0;
  color: var(--green-900);
  font-size: 16px;
}

.archive-detail-heading > span,
.archive-node-heading > span,
.archive-material-heading > span {
  color: var(--green-800);
  font-size: 11px;
  font-weight: 700;
}

.archive-node-detail-list,
.archive-material-list {
  display: grid;
  gap: 11px;
}

.archive-node-card,
.archive-material-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.archive-node-heading strong,
.archive-material-heading strong {
  font-size: 13px;
}

.archive-node-heading small,
.archive-material-card > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.archive-node-heading .archive-waterproof-line {
  flex-basis: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  color: #2f5d4b;
  background: #edf4f0;
}

.archive-material-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.archive-material-specs span {
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--green-900);
  background: var(--green-100);
  font-size: 11px;
  font-weight: 700;
}

.archive-empty-line {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.completed-media-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.completed-media-grid figcaption strong {
  font-size: 11px;
}

.completed-media-grid figcaption span {
  font-size: 10px;
}

.archive-operation-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-left: 3px solid var(--green-100);
  background: #fff;
}

.archive-operation-row strong {
  font-size: 11px;
}

.archive-operation-row span,
.archive-operation-row small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.owner-portal-panel {
  overflow: hidden;
}

.owner-portal-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.owner-portal-heading > div {
  min-width: 0;
}

.owner-portal-heading h2 {
  margin-bottom: 5px;
}

.owner-portal-heading p:last-child {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.owner-portal-access {
  margin-top: 17px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7faf8;
}

.owner-access-form {
  display: grid;
  gap: 13px;
}

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

.owner-invite-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #173f33, #285945);
}

.owner-invite-line span,
.owner-invite-line strong {
  display: block;
}

.owner-invite-line span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.owner-invite-line strong {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.owner-invite-actions,
.owner-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-invite-line .button-secondary {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.owner-generated-password {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(200, 164, 93, 0.55);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(200, 164, 93, 0.14), transparent 50%),
    #fffaf0;
  box-shadow: inset 4px 0 0 var(--gold);
}

.owner-generated-password span,
.owner-generated-password strong,
.owner-generated-password small {
  display: block;
}

.owner-generated-password span {
  color: #7d6538;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.owner-generated-password strong {
  margin: 6px 0 4px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: 0.08em;
}

.owner-generated-password small {
  color: #776f60;
  font-size: 10px;
  line-height: 1.55;
}

.owner-generated-password > div:last-child {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.owner-portal-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-top: 18px;
}

.owner-portal-column {
  min-width: 0;
}

.owner-portal-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 10px;
}

.owner-portal-section-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.owner-portal-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.owner-portal-section-head span,
.owner-portal-section-head small {
  color: var(--muted);
  font-size: 10px;
}

.owner-portal-section-head small {
  text-align: right;
  line-height: 1.45;
}

.owner-admin-issue-list,
.owner-admin-document-list {
  display: grid;
  gap: 9px;
}

.owner-admin-issue {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.owner-admin-issue-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.owner-admin-issue-head strong,
.owner-admin-issue-head span {
  display: block;
}

.owner-admin-issue-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.owner-admin-issue > p {
  margin: 9px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.owner-admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.owner-admin-photo-grid button {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #e8eeea;
}

.owner-admin-photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-admin-issue-actions {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.owner-admin-issue-actions .field {
  gap: 5px;
}

.owner-admin-issue-actions textarea {
  min-height: 62px;
}

.owner-issue-reply-field span {
  font-size: 10px;
}

.owner-admin-document {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.owner-admin-document > div:first-child {
  min-width: 0;
}

.owner-admin-document strong,
.owner-admin-document span {
  display: block;
}

.owner-admin-document strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.owner-admin-document span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.owner-admin-document > div:last-child {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.owner-document-form {
  margin-top: 11px;
  padding: 13px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  background: #f7f9f8;
}

.owner-document-form .form-error {
  min-height: 16px;
  margin: 7px 0;
}

@media (max-width: 980px) {
  .owner-portal-split {
    grid-template-columns: 1fr;
  }

  .owner-admin-issue-actions {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .owner-admin-issue-actions .button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 680px) {
  .owner-portal-heading,
  .owner-invite-line,
  .owner-portal-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-access-grid,
  .owner-admin-issue-actions {
    grid-template-columns: 1fr;
  }

  .owner-generated-password {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-generated-password > div:last-child {
    justify-content: flex-start;
  }

  .owner-portal-section-head small {
    text-align: left;
  }

  .owner-admin-issue-actions .button {
    justify-self: stretch;
  }

  .owner-admin-photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.schedule-table-head,
.schedule-row {
  grid-template-columns: 48px minmax(180px, 1.2fr) minmax(195px, 1fr) 120px 110px 90px 108px;
}

.schedule-order-hint {
  margin-top: 7px !important;
  color: var(--muted);
  font-size: 10px;
}

.node-order-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 4px;
  min-width: 86px;
}

.node-order-button {
  width: 26px;
  height: 32px;
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-900);
  background: var(--surface);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.node-order-button:hover:not(:disabled) {
  color: var(--orange);
  border-color: rgba(187, 105, 67, 0.5);
  background: var(--orange-soft);
}

.node-order-button:disabled {
  color: var(--muted);
  opacity: 0.32;
  cursor: not-allowed;
}

.node-order-locked {
  min-width: 34px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-row.is-order-pinned .schedule-index {
  color: var(--muted);
  background: var(--surface-soft);
}

@media (max-width: 1120px) {
  .schedule-row {
    grid-template-columns: 42px minmax(150px, 1fr) minmax(170px, 1fr) 90px 76px 98px;
  }
}

@media (max-width: 640px) {
  .schedule-row {
    grid-template-columns: 36px minmax(0, 1fr) 94px;
  }

  .node-order-actions {
    grid-column: 3;
    grid-row: 1 / 3;
    min-width: 86px;
    align-self: start;
  }

  .node-order-button,
  .node-order-actions .edit-node {
    width: 26px;
    height: 30px;
    flex-basis: 26px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar-actions,
  .nav-count,
  .node-order-actions {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .topbar,
  .main-content {
    padding-inline: 0;
  }

  .view {
    display: none !important;
  }

  #view-schedule {
    display: block !important;
  }

  body.print-brief-mode #view-brief {
    display: block !important;
  }

  body.print-brief-mode #view-schedule {
    display: none !important;
  }

  body.print-completed-mode #view-completed {
    display: block !important;
  }

  body.print-completed-mode #view-schedule,
  body.print-completed-mode #view-brief {
    display: none !important;
  }

  body.print-completed-mode .completed-project-card:not(.is-print-target) {
    display: none !important;
  }

  body.print-completed-mode .completed-project-card.is-print-target {
    display: block !important;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body.print-completed-mode .form-actions,
  body.print-completed-mode .completed-project-details > summary {
    display: none !important;
  }

  body.print-completed-mode .completed-project-details {
    border: 0;
    padding-top: 0;
  }

  body.print-completed-mode .completed-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.print-completed-mode .archive-node-card,
  body.print-completed-mode .archive-material-card,
  body.print-completed-mode .completed-media-grid figure {
    break-inside: avoid;
  }

  .schedule-panel {
    box-shadow: none;
  }
}
