:root {
  --bg: #101014;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f6f2eb;
  --muted: #b8b0a7;
  --muted-2: #8b8580;
  --teal: #29dbc8;
  --mint: #9af3b5;
  --coral: #ff6f61;
  --amber: #ffc85c;
  --violet: #b78cff;
  --rose: #ff7aa7;
  --lime: #c7f36a;
  --ink: #171619;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --timeline-header-height: 48px;
  --timeline-module-row-height: 42px;
  --timeline-task-row-height: 48px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 1180px;
  background:
    linear-gradient(130deg, rgba(41, 219, 200, 0.12) 0%, rgba(255, 111, 97, 0.08) 36%, rgba(183, 140, 255, 0.1) 68%, rgba(255, 200, 92, 0.07) 100%),
    radial-gradient(circle at 18% 14%, rgba(154, 243, 181, 0.08), transparent 28%),
    #101014;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 72px);
  overflow-x: auto;
}

html.sync-protected:not(.sync-content-unlocked) body {
  min-width: 0;
  overflow: hidden;
}

html.sync-protected:not(.sync-content-unlocked) .app-shell {
  visibility: hidden;
  pointer-events: none;
}

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

button {
  cursor: pointer;
}

[contenteditable="true"] {
  outline: none;
  border-radius: 4px;
}

[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px rgba(41, 219, 200, 0.32);
}

.app-shell {
  display: grid;
  grid-template-columns: 104px minmax(1100px, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: rgba(18, 17, 20, 0.86);
  backdrop-filter: blur(20px);
  z-index: 20;
}

.side-rail-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 0;
  width: 100%;
}

.rail-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-align: center;
}

.rail-footer time {
  color: var(--muted);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.rail-history-zone {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 100px;
  min-height: 118px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2;
}

.rail-history-actions {
  width: 100%;
  display: grid;
  gap: 7px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.rail-history-zone:hover .rail-history-actions,
.rail-history-zone:focus-within .rail-history-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.rail-history-button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(41, 219, 200, 0.22);
  border-radius: 999px;
  color: #c9fff6;
  background:
    linear-gradient(135deg, rgba(41, 219, 200, 0.18), rgba(154, 243, 181, 0.08)),
    rgba(15, 20, 22, 0.82);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

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

.rail-history-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: transparent;
  color: #111318;
  background: linear-gradient(135deg, var(--teal), var(--mint) 58%, var(--amber));
}

.rail-history-button:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

.sync-footer-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
  min-height: 24px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  max-width: none;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.sync-status[data-status="online"] {
  color: #c8ffd7;
  border-color: rgba(154, 243, 181, 0.34);
  background: rgba(154, 243, 181, 0.12);
}

.sync-status[data-status="pending"],
.sync-status[data-status="syncing"],
.sync-status[data-status="auth"] {
  color: #ffe0a0;
  border-color: rgba(255, 200, 92, 0.34);
  background: rgba(255, 200, 92, 0.12);
}

.sync-status[data-status="readonly"] {
  color: #d8c7ff;
  border-color: rgba(183, 140, 255, 0.34);
  background: rgba(183, 140, 255, 0.12);
}

.sync-status[data-status="error"] {
  color: #ffb8b1;
  border-color: rgba(255, 111, 97, 0.36);
  background: rgba(255, 111, 97, 0.12);
}

.sync-signout-button {
  height: 24px;
  min-width: 34px;
  padding: 0 7px;
  border: 1px solid rgba(41, 219, 200, 0.28);
  border-radius: 999px;
  color: #9af7ee;
  background: rgba(41, 219, 200, 0.1);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.sync-signout-button:hover {
  color: #101014;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), var(--mint));
}

.brand-mark {
  position: relative;
  width: 82px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(18, 46, 77, 0.28);
}

.brand-mark img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-pulse {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(147, 211, 244, 0.44);
  border-radius: 10px;
  animation: brandPulse 2.8s ease-in-out infinite;
}

@keyframes brandPulse {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(1);
  }
  50% {
    opacity: 0.82;
    transform: scale(1.05);
  }
}

.rail-button,
.icon-button {
  width: 82px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease;
}

.rail-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(41, 219, 200, 0.36);
  background: rgba(41, 219, 200, 0.1);
}

.rail-button.active {
  color: #111;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), var(--mint));
}

.rail-button span {
  font-size: 18px;
  line-height: 1;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 14px 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(16, 16, 20, 0.66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.topbar > .title-zone {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.topbar > .toolbar {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  margin-top: 104px;
}

.topbar > .project-meta-grid {
  grid-column: 1 / -1;
  grid-row: 2;
}

.title-zone {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.title-zone-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  padding-right: 12px;
}

.project-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  width: min(var(--project-switcher-width, 760px), 100%);
  box-sizing: border-box;
  padding: 6px 10px 6px 12px;
  border: 1px solid rgba(41, 219, 200, 0.34);
  border-radius: 8px;
  background: rgba(41, 219, 200, 0.08);
  box-shadow: 0 10px 28px rgba(41, 219, 200, 0.1);
}

.project-switcher label {
  color: var(--mint);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.project-switcher input,
.project-switcher select {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  outline: none;
  font-weight: 750;
}

.project-switcher input {
  flex: 1.05 1 0;
  min-width: 170px;
  width: auto;
}

.project-switcher select {
  flex: 1.2 1 0;
  min-width: 190px;
  width: auto;
  max-width: none;
  text-overflow: ellipsis;
}

.project-switcher input:focus,
.project-switcher select:focus {
  border-color: rgba(41, 219, 200, 0.5);
  box-shadow: 0 0 0 2px rgba(41, 219, 200, 0.16);
}

.project-switcher option {
  color: #171619;
  background: #fff;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 12px;
}

.meta-field {
  display: grid;
  gap: 6px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.meta-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.meta-field input,
.meta-field select {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.meta-field input[type="date"] {
  color-scheme: dark;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.meta-field input:focus,
.meta-field select:focus {
  border-color: rgba(41, 219, 200, 0.45);
  box-shadow: 0 0 0 2px rgba(41, 219, 200, 0.12);
}

.meta-field option {
  color: #171619;
  background: #fff;
}

.title-zone h1 {
  margin: 8px 0 6px;
  max-width: none;
  font-size: clamp(28px, 2.6vw, 44px);
  line-height: 1.02;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-zone p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 20px var(--mint);
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.toolbar-row {
  max-width: none;
}

.toolbar-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.button-svg-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.primary-button,
.ghost-button,
.danger-button,
.chip-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.primary-button {
  color: #121114;
  font-weight: 850;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), var(--mint) 55%, var(--amber));
  box-shadow: 0 16px 36px rgba(41, 219, 200, 0.22);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  transform: none;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
}

#addProjectButton {
  flex: 0 0 150px;
  min-width: 150px;
  padding: 0 18px;
  white-space: nowrap;
}

#addPaymentButton {
  min-width: 96px;
  white-space: nowrap;
}

#addPaymentButton span {
  white-space: nowrap;
}

.ghost-button:hover,
.primary-button:hover,
.chip-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 219, 200, 0.32);
  background-color: rgba(41, 219, 200, 0.08);
}

.primary-button:hover {
  background: linear-gradient(135deg, #62f1e1, #b8ffc9 55%, #ffdd7a);
}

.primary-button:disabled:hover,
.ghost-button:disabled:hover,
.danger-button:disabled:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transform: none;
}

.danger-button {
  color: #ffe8e8;
  border-color: rgba(255, 111, 97, 0.45);
  background: rgba(255, 111, 97, 0.12);
}

.button-icon {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
}

.import-label {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.import-label.toolbar-button:hover {
  background: linear-gradient(135deg, #62f1e1, #b8ffc9 55%, #ffdd7a);
}

.import-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.insight-band {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.metric-card {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    rgba(16, 16, 20, 0.72);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  margin-top: 12px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card small {
  margin-top: auto;
  color: var(--muted-2);
  line-height: 1.35;
}

.metric-spark {
  position: relative;
  height: 8px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.11);
}

.metric-spark span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--mint), var(--amber));
}

.control-deck {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.052);
  backdrop-filter: blur(18px);
}

.app-shell[data-active-view="risk"] .control-deck,
.app-shell[data-active-view="samples"] .control-deck {
  display: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, minmax(134px, 1fr));
  gap: 10px;
}

.filter-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.filter-grid label > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
}

.filter-grid option,
.task-dialog option {
  color: #171619;
  background: #fff;
}

.search-box {
  grid-column: span 1;
}

.quick-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip-button {
  min-height: 34px;
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
}

.chip-button.active {
  color: #111;
  border-color: transparent;
  background: linear-gradient(135deg, var(--amber), var(--rose));
}

.view-stack {
  margin-top: 16px;
}

.view-panel {
  display: none;
}

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

.view-panel[data-panel="risk"].active {
  display: grid;
  gap: 16px;
}

.view-panel[data-panel="samples"].active {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.timeline-layout {
  display: grid;
  grid-template-columns: 456px minmax(700px, 1fr);
  height: max(620px, calc(100vh - 338px));
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.048);
  box-shadow: var(--shadow);
}

.timeline-left {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(18, 17, 20, 0.88);
  z-index: 5;
}

.timeline-left-header {
  display: grid;
  grid-template-columns: 1fr 74px 72px;
  align-items: center;
  flex: 0 0 var(--timeline-header-height);
  height: var(--timeline-header-height);
  min-height: var(--timeline-header-height);
  max-height: var(--timeline-header-height);
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  box-sizing: border-box;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(22, 21, 25, 0.98);
}

.timeline-right {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 220px),
    rgba(13, 13, 16, 0.72);
}

.task-list {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.module-row,
.gantt-module-row {
  flex-shrink: 0;
  box-sizing: border-box;
  height: var(--timeline-module-row-height);
  min-height: var(--timeline-module-row-height);
  max-height: var(--timeline-module-row-height);
  overflow: hidden;
}

.module-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background:
    linear-gradient(90deg, var(--module-color), transparent 4px),
    rgba(255, 255, 255, 0.045);
  font-weight: 860;
  line-height: 1.2;
}

.module-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-row small {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.task-row,
.gantt-task-row {
  flex-shrink: 0;
  box-sizing: border-box;
  height: var(--timeline-task-row-height);
  min-height: var(--timeline-task-row-height);
  max-height: var(--timeline-task-row-height);
  overflow: hidden;
}

.task-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 72px;
  gap: 8px;
  align-items: center;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.022);
  transition:
    background 0.16s ease,
    transform 0.16s ease;
  cursor: pointer;
}

.task-row:hover,
.task-row.selected {
  background: rgba(41, 219, 200, 0.082);
}

.task-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 0 99px 99px 0;
  background: var(--module-color);
}

.task-title {
  min-width: 0;
  overflow: hidden;
}

.task-title strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  justify-self: start;
  min-width: 62px;
  padding: 4px 7px;
  border: 1px solid var(--status-line);
  border-radius: 99px;
  color: var(--status-text);
  background: var(--status-bg);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.mini-progress {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.mini-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--module-color), var(--mint));
}

.timeline-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.timeline-header-viewport {
  flex: 0 0 var(--timeline-header-height);
  height: var(--timeline-header-height);
  min-height: var(--timeline-header-height);
  max-height: var(--timeline-header-height);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 21, 25, 0.98);
  box-sizing: border-box;
}

.timeline-header {
  display: grid;
  height: var(--timeline-header-height);
  min-height: var(--timeline-header-height);
  max-height: var(--timeline-header-height);
  min-width: var(--timeline-width);
  background: transparent;
  box-sizing: border-box;
}

.time-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--cell-width);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.time-cell.current {
  color: var(--mint);
  background: rgba(154, 243, 181, 0.08);
}

.gantt-canvas {
  position: relative;
  min-width: var(--timeline-width);
}

.gantt-module-row,
.gantt-task-row {
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.gantt-module-row {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--module-color) 18%, transparent), transparent 65%),
    rgba(255, 255, 255, 0.032);
}

.gantt-module-label {
  position: absolute;
  inset: 0 14px 0 14px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: color-mix(in srgb, var(--module-color) 70%, white);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-task-row {
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(var(--cell-width) - 1px),
      rgba(255, 255, 255, 0.055) calc(var(--cell-width) - 1px) var(--cell-width)
    );
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--mint);
  box-shadow: 0 0 20px rgba(154, 243, 181, 0.55);
  pointer-events: none;
  z-index: 3;
}

.gantt-bar {
  position: absolute;
  top: 10px;
  left: var(--bar-left);
  width: max(var(--bar-width), 22px);
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #111;
  background:
    linear-gradient(90deg, var(--module-color), color-mix(in srgb, var(--module-color) 58%, white)),
    var(--module-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
  cursor: grab;
  user-select: none;
  z-index: 4;
}

.gantt-bar:active {
  cursor: grabbing;
}

.gantt-bar.critical {
  box-shadow:
    0 0 0 1px rgba(255, 200, 92, 0.85),
    0 13px 32px rgba(255, 200, 92, 0.24);
}

.gantt-bar.late {
  box-shadow:
    0 0 0 1px rgba(255, 111, 97, 0.9),
    0 13px 32px rgba(255, 111, 97, 0.24);
}

.bar-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  background: rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.bar-label {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 0 28px 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.12);
}

.bar-handle.left {
  left: 0;
  cursor: ew-resize;
}

.bar-handle.right {
  right: 0;
  cursor: ew-resize;
}

.dependency-line {
  position: absolute;
  height: 2px;
  background: rgba(255, 255, 255, 0.26);
  transform-origin: left center;
  pointer-events: none;
  z-index: 2;
}

.dependency-line::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  border-right: 2px solid rgba(255, 255, 255, 0.3);
  transform: rotate(45deg);
}

.dependency-layer {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.dependency-path {
  fill: none;
  stroke: color-mix(in srgb, var(--dependency-color) 54%, white);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.36;
  filter: drop-shadow(0 0 5px rgba(41, 219, 200, 0.18));
}

.dependency-arrow {
  fill: rgba(255, 255, 255, 0.48);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: var(--muted);
  text-align: center;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.052);
}

.section-head.compact {
  margin-bottom: 12px;
  padding: 14px 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.data-table-wrap {
  max-height: calc(100vh - 390px);
  min-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 14, 17, 0.74);
}

.data-table {
  width: 100%;
  min-width: 1680px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #18171b;
}

.data-table td {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.data-table tr:hover td {
  background: rgba(41, 219, 200, 0.055);
}

.table-action {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.table-action.danger {
  color: #ffd2cc;
  border-color: rgba(255, 111, 97, 0.28);
  background: rgba(255, 111, 97, 0.1);
}

.sample-mode-switch {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.052);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.sample-mode-switch button {
  min-width: 112px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.sample-mode-switch button.active {
  color: var(--ink);
  background: linear-gradient(135deg, var(--teal), var(--mint));
  box-shadow: 0 10px 26px rgba(41, 219, 200, 0.18);
}

.sample-detail-view {
  display: grid;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.sample-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.sample-kpi {
  --kpi-accent: var(--teal);
  --kpi-rgb: 41, 219, 200;
  position: relative;
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 16px 16px 15px;
  border: 1px solid rgba(var(--kpi-rgb), 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--kpi-rgb), 0.18), rgba(255, 255, 255, 0.045) 58%),
    rgba(255, 255, 255, 0.052);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 32px rgba(0, 0, 0, 0.16);
}

.sample-kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--kpi-accent), rgba(var(--kpi-rgb), 0.16));
}

.sample-kpi span,
.sample-kpi strong,
.sample-kpi small {
  position: relative;
  z-index: 1;
}

.sample-kpi span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(246, 242, 235, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.sample-kpi span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--kpi-accent);
  box-shadow: 0 0 0 3px rgba(var(--kpi-rgb), 0.14);
}

.sample-kpi strong {
  color: var(--kpi-accent);
  font-family: var(--mono);
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 8px 26px rgba(var(--kpi-rgb), 0.22);
}

.sample-kpi small {
  color: rgba(246, 242, 235, 0.62);
  line-height: 1.35;
}

.sample-kpi-expected {
  --kpi-accent: var(--violet);
  --kpi-rgb: 183, 140, 255;
}

.sample-kpi-pending {
  --kpi-accent: var(--rose);
  --kpi-rgb: 255, 122, 167;
}

.sample-kpi-issue {
  --kpi-accent: #ff927f;
  --kpi-rgb: 255, 146, 127;
}

.sample-project-overview {
  display: grid;
  gap: 12px;
}

.sample-project-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sample-overview-kpi {
  --overview-accent: var(--teal);
  --overview-rgb: 41, 219, 200;
  position: relative;
  min-height: 108px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  overflow: hidden;
  padding: 15px;
  border: 1px solid rgba(var(--overview-rgb), 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--overview-rgb), 0.15), rgba(255, 255, 255, 0.04) 62%),
    rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 32px rgba(0, 0, 0, 0.15);
}

.sample-overview-kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--overview-accent), rgba(var(--overview-rgb), 0.14));
}

.sample-overview-kpi span {
  position: relative;
  z-index: 1;
  color: rgba(246, 242, 235, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.sample-overview-kpi strong {
  position: relative;
  z-index: 1;
  color: var(--overview-accent);
  font-family: var(--mono);
  font-size: 30px;
  line-height: 1;
}

.sample-overview-kpi small {
  position: relative;
  z-index: 1;
  overflow: hidden;
  color: rgba(246, 242, 235, 0.62);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-overview-pending {
  --overview-accent: var(--rose);
  --overview-rgb: 255, 122, 167;
}

.sample-overview-issue {
  --overview-accent: #ff927f;
  --overview-rgb: 255, 146, 127;
}

.sample-overview-kpi.rate-critical {
  --overview-accent: var(--coral);
  --overview-rgb: 255, 111, 97;
}

.sample-overview-kpi.rate-watch {
  --overview-accent: var(--amber);
  --overview-rgb: 255, 200, 92;
}

.sample-overview-kpi.rate-steady {
  --overview-accent: var(--teal);
  --overview-rgb: 41, 219, 200;
}

.sample-overview-kpi.rate-complete {
  --overview-accent: var(--mint);
  --overview-rgb: 154, 243, 181;
}

.rate-critical {
  --rate-color: var(--coral);
  --rate-rgb: 255, 111, 97;
  --kpi-accent: var(--coral);
  --kpi-rgb: 255, 111, 97;
}

.rate-watch {
  --rate-color: var(--amber);
  --rate-rgb: 255, 200, 92;
  --kpi-accent: var(--amber);
  --kpi-rgb: 255, 200, 92;
}

.rate-steady {
  --rate-color: var(--teal);
  --rate-rgb: 41, 219, 200;
  --kpi-accent: var(--teal);
  --kpi-rgb: 41, 219, 200;
}

.rate-complete {
  --rate-color: var(--mint);
  --rate-rgb: 154, 243, 181;
  --kpi-accent: var(--mint);
  --kpi-rgb: 154, 243, 181;
}

.sample-table-wrap {
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 360px);
  min-height: 520px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(41, 219, 200, 0.08), rgba(183, 140, 255, 0.045) 42%, rgba(255, 200, 92, 0.045)),
    rgba(14, 14, 17, 0.82);
  box-shadow: var(--shadow);
  scrollbar-color: rgba(41, 219, 200, 0.42) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable;
}

.sample-overview-table-wrap {
  max-height: calc(100vh - 420px);
  min-height: 420px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(41, 219, 200, 0.07), rgba(183, 140, 255, 0.04) 46%, rgba(255, 200, 92, 0.035)),
    rgba(14, 14, 17, 0.82);
  box-shadow: var(--shadow);
  scrollbar-color: rgba(41, 219, 200, 0.42) rgba(255, 255, 255, 0.08);
}

.sample-overview-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

.sample-overview-table th,
.sample-overview-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  vertical-align: middle;
}

.sample-overview-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: rgba(246, 242, 235, 0.72);
  background:
    linear-gradient(180deg, rgba(36, 34, 40, 0.98), rgba(22, 21, 25, 0.98));
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sample-overview-table th:first-child,
.sample-overview-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 180px;
  text-align: left;
  background: rgba(24, 23, 27, 0.99);
  box-shadow: 12px 0 22px rgba(0, 0, 0, 0.18);
}

.sample-overview-table th:first-child {
  z-index: 4;
}

.sample-overview-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.sample-overview-table tbody tr:nth-child(even) td:first-child {
  background: rgba(28, 27, 32, 0.99);
}

.sample-overview-table tr:hover td {
  background: rgba(41, 219, 200, 0.07);
}

.sample-overview-table tr:hover td:first-child {
  background: rgba(29, 43, 43, 0.99);
}

.sample-project-link {
  max-width: 220px;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-project-link:hover {
  color: var(--teal);
}

.sample-risk-badge {
  display: inline-grid;
  min-width: 86px;
  height: 30px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 900;
}

.sample-risk-badge.success {
  color: var(--mint);
  border-color: rgba(154, 243, 181, 0.42);
  background: rgba(154, 243, 181, 0.12);
}

.sample-risk-badge.warning {
  color: var(--amber);
  border-color: rgba(255, 200, 92, 0.42);
  background: rgba(255, 200, 92, 0.12);
}

.sample-risk-badge.danger {
  color: #ffb0a7;
  border-color: rgba(255, 111, 97, 0.42);
  background: rgba(255, 111, 97, 0.12);
}

.sample-risk-badge.info {
  color: var(--teal);
  border-color: rgba(41, 219, 200, 0.42);
  background: rgba(41, 219, 200, 0.12);
}

.sample-risk-badge.neutral {
  color: var(--muted);
}

.sample-table {
  --sample-col-phase: 180px;
  --sample-col-lab: 190px;
  --sample-col-analyte: 180px;
  --sample-col-matrix: 150px;
  width: 100%;
  min-width: 2170px;
  border-collapse: separate;
  border-spacing: 0;
}

.sample-table th,
.sample-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: middle;
}

.sample-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: rgba(246, 242, 235, 0.72);
  background:
    linear-gradient(180deg, rgba(36, 34, 40, 0.98), rgba(22, 21, 25, 0.98));
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.sample-header-control {
  position: relative;
  display: inline-grid;
  min-width: 0;
  place-items: center;
  cursor: pointer;
}

.sample-header-control span {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  overflow: hidden;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(246, 242, 235, 0.78);
  font-size: 12px;
  font-weight: 900;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.sample-header-control:hover span,
.sample-header-control:focus-within span {
  color: var(--text);
  border-color: rgba(41, 219, 200, 0.34);
  background: rgba(41, 219, 200, 0.12);
}

.sample-table .sample-header-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.sample-table .sample-phase-head {
  padding-top: 7px;
  padding-bottom: 7px;
}

.sample-table th:nth-child(-n + 4),
.sample-table td:nth-child(-n + 4) {
  position: sticky;
  z-index: 2;
  background: rgba(24, 23, 27, 0.99);
}

.sample-table th:nth-child(-n + 4) {
  z-index: 5;
  background:
    linear-gradient(180deg, rgba(36, 34, 40, 0.99), rgba(22, 21, 25, 0.99));
}

.sample-table th:nth-child(1),
.sample-table td:nth-child(1) {
  left: 0;
}

.sample-table th:nth-child(2),
.sample-table td:nth-child(2) {
  left: var(--sample-col-phase);
}

.sample-table th:nth-child(3),
.sample-table td:nth-child(3) {
  left: calc(var(--sample-col-phase) + var(--sample-col-lab));
}

.sample-table th:nth-child(4),
.sample-table td:nth-child(4) {
  left: calc(var(--sample-col-phase) + var(--sample-col-lab) + var(--sample-col-analyte));
  box-shadow: 12px 0 22px rgba(0, 0, 0, 0.2);
}

.sample-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.sample-table tr:hover td {
  background: rgba(41, 219, 200, 0.07);
}

.sample-table tr.danger td {
  background: rgba(255, 111, 97, 0.06);
}

.sample-table tr.warning td {
  background: rgba(255, 200, 92, 0.052);
}

.sample-table tr.success td {
  background: rgba(154, 243, 181, 0.04);
}

.sample-table tr.info td {
  background: rgba(41, 219, 200, 0.04);
}

.sample-table tbody td:nth-child(-n + 4) {
  background: rgba(24, 23, 27, 0.99);
}

.sample-table tbody tr:nth-child(even) td:nth-child(-n + 4) {
  background: rgba(28, 27, 32, 0.99);
}

.sample-table tr:hover td:nth-child(-n + 4) {
  background: rgba(29, 43, 43, 0.99);
}

.sample-table input,
.sample-table select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font: inherit;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.sample-table input:hover,
.sample-table select:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(0, 0, 0, 0.18);
}

.sample-table input:focus,
.sample-table select:focus {
  border-color: rgba(41, 219, 200, 0.48);
  box-shadow: 0 0 0 3px rgba(41, 219, 200, 0.12);
}

.sample-table option {
  color: #171619;
  background: #fff;
}

.sample-table input[type="number"] {
  width: 78px;
  padding: 0 6px;
  font-family: var(--mono);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 34px;
  text-align: center;
  appearance: textfield;
}

.sample-table input[type="number"]::-webkit-outer-spin-button,
.sample-table input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.sample-table input[type="date"] {
  width: 126px;
  color-scheme: dark;
}

.sample-table th:nth-child(1),
.sample-table td:nth-child(1) {
  width: var(--sample-col-phase);
  min-width: var(--sample-col-phase);
  max-width: var(--sample-col-phase);
}

.sample-table th:nth-child(2),
.sample-table td:nth-child(2) {
  width: var(--sample-col-lab);
  min-width: var(--sample-col-lab);
  max-width: var(--sample-col-lab);
}

.sample-table th:nth-child(3),
.sample-table td:nth-child(3) {
  width: var(--sample-col-analyte);
  min-width: var(--sample-col-analyte);
  max-width: var(--sample-col-analyte);
}

.sample-table th:nth-child(4),
.sample-table td:nth-child(4) {
  width: var(--sample-col-matrix);
  min-width: var(--sample-col-matrix);
  max-width: var(--sample-col-matrix);
}

.sample-table th:nth-child(5),
.sample-table td:nth-child(5),
.sample-table th:nth-child(6),
.sample-table td:nth-child(6),
.sample-table th:nth-child(7),
.sample-table td:nth-child(7),
.sample-table th:nth-child(8),
.sample-table td:nth-child(8),
.sample-table th:nth-child(9),
.sample-table td:nth-child(9),
.sample-table th:nth-child(10),
.sample-table td:nth-child(10),
.sample-table th:nth-child(11),
.sample-table td:nth-child(11),
.sample-table th:nth-child(14),
.sample-table td:nth-child(14) {
  width: 92px;
  text-align: center;
}

.sample-table th:nth-child(13),
.sample-table td:nth-child(13) {
  min-width: 112px;
}

.sample-table th:nth-child(15),
.sample-table td:nth-child(15) {
  min-width: 280px;
}

.sample-table .sample-action-head,
.sample-table .sample-action-cell {
  width: 72px;
  min-width: 72px;
  text-align: center;
}

.sample-date-range {
  min-width: 276px;
  white-space: nowrap;
}

.sample-date-range span {
  display: inline-block;
  margin: 0 5px;
  color: var(--muted-2);
  font-size: 12px;
}

.sample-pill,
.sample-rate {
  display: inline-grid;
  min-width: 64px;
  height: 34px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62);
}

.sample-rate {
  color: var(--rate-color);
  border-color: rgba(var(--rate-rgb), 0.48);
  background:
    linear-gradient(180deg, rgba(var(--rate-rgb), 0.3), rgba(var(--rate-rgb), 0.12)),
    rgba(8, 8, 10, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(0, 0, 0, 0.18),
    0 8px 20px rgba(var(--rate-rgb), 0.14);
}

.sample-pill.pending-receipt {
  color: #d8c3ff;
  border-color: rgba(183, 140, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(183, 140, 255, 0.32), rgba(183, 140, 255, 0.13)),
    rgba(8, 8, 10, 0.72);
}

.sample-pill.pending-analysis {
  color: #ffc1dc;
  border-color: rgba(255, 122, 167, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 122, 167, 0.32), rgba(255, 122, 167, 0.13)),
    rgba(8, 8, 10, 0.72);
}

.risk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.risk-panel,
.story-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.052);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.2);
}

.risk-panel {
  padding: 14px;
}

.report-next-card,
.key-register-panel,
.report-secondary-grid > .risk-panel:last-child {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.report-secondary-grid > .risk-panel {
  height: clamp(1040px, 144vh, 1520px);
  max-height: clamp(1040px, 144vh, 1520px);
}

.report-next-card .story-kicker,
.key-register-panel .section-head,
.report-secondary-grid > .risk-panel:last-child .section-head,
.report-secondary-grid > .risk-panel:last-child .payment-summary {
  flex: 0 0 auto;
}

.risk-heatmap {
  display: grid;
  gap: 12px;
}

.module-readiness-block {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.module-readiness-block .story-kicker {
  display: block;
}

.risk-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.risk-kpi {
  min-height: 104px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.risk-kpi:hover,
.method-risk-cell:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 219, 200, 0.32);
  background-color: rgba(41, 219, 200, 0.06);
}

.risk-kpi span,
.risk-kpi small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.risk-kpi strong {
  display: block;
  margin: 6px 0;
  font-size: 32px;
  line-height: 1;
}

.risk-kpi.danger {
  border-color: rgba(255, 111, 97, 0.42);
  background: linear-gradient(145deg, rgba(255, 111, 97, 0.2), rgba(255, 255, 255, 0.04));
}

.risk-kpi.warning {
  border-color: rgba(255, 200, 92, 0.4);
  background: linear-gradient(145deg, rgba(255, 200, 92, 0.16), rgba(255, 255, 255, 0.04));
}

.risk-kpi.info {
  border-color: rgba(183, 140, 255, 0.42);
  background: linear-gradient(145deg, rgba(183, 140, 255, 0.16), rgba(255, 255, 255, 0.04));
}

.risk-kpi.success {
  border-color: rgba(154, 243, 181, 0.34);
  background: linear-gradient(145deg, rgba(154, 243, 181, 0.12), rgba(255, 255, 255, 0.04));
}

.risk-chart-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.risk-donut-card,
.risk-method-matrix {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.risk-donut-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.risk-donut {
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 50%;
  background: var(--risk-gradient);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 18px 46px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.risk-donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #151419;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.risk-donut span,
.risk-donut small {
  position: relative;
  z-index: 1;
}

.risk-donut span {
  font-size: 32px;
  font-weight: 950;
}

.risk-donut small {
  color: var(--muted);
  font-size: 11px;
}

.risk-legend {
  display: grid;
  gap: 8px;
}

.risk-legend-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  margin: -2px -4px;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.risk-legend-row:hover {
  color: var(--text);
  background: rgba(41, 219, 200, 0.08);
}

.risk-legend-row strong {
  color: var(--text);
  font-family: var(--mono);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.legend-swatch.low {
  background: var(--mint);
}

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

.legend-swatch.high {
  background: var(--rose);
}

.legend-swatch.severe {
  background: var(--coral);
}

.risk-method-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.method-risk-cell {
  min-height: 82px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.method-risk-cell span,
.method-risk-cell small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.method-risk-cell strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 25px;
  line-height: 1;
}

.method-risk-cell.high {
  border-color: rgba(255, 111, 97, 0.42);
  background: linear-gradient(145deg, rgba(255, 111, 97, 0.18), rgba(255, 255, 255, 0.04));
}

.method-risk-cell.medium {
  border-color: rgba(255, 200, 92, 0.4);
  background: linear-gradient(145deg, rgba(255, 200, 92, 0.14), rgba(255, 255, 255, 0.04));
}

.method-risk-cell.low {
  border-color: rgba(154, 243, 181, 0.25);
}

.payment-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.payment-total-card,
.payment-mini-stats {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.payment-total-card {
  padding: 14px;
}

.payment-total-card span,
.payment-total-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.payment-total-card strong {
  display: block;
  margin: 5px 0 8px;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.7vw, 30px);
  line-height: 1;
}

.payment-total-meter {
  position: relative;
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.payment-total-meter i,
.payment-total-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.payment-total-meter i {
  width: var(--committed);
  background: rgba(255, 200, 92, 0.42);
}

.payment-total-meter span {
  z-index: 1;
  width: var(--paid);
  background: linear-gradient(90deg, var(--teal), var(--mint));
}

.payment-mini-stats {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 14px;
}

.payment-mini-stats span {
  color: var(--muted);
  font-size: 12px;
}

.payment-mini-stats b {
  display: block;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 20px;
}

.payment-board {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 8px;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: rgba(41, 219, 200, 0.42) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.report-secondary-grid > .risk-panel:last-child .payment-board {
  flex: 1 1 auto;
}

.payment-milestone {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(118px, 0.26fr);
  gap: 9px;
  align-items: start;
  padding: 9px 40px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--module-color), transparent 4px),
    rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.payment-milestone:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 219, 200, 0.28);
  background:
    linear-gradient(90deg, var(--module-color), transparent 4px),
    rgba(41, 219, 200, 0.07);
}

.payment-step {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-weight: 900;
}

.payment-content {
  min-width: 0;
}

.payment-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.payment-title-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-content p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.payment-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
}

.payment-status.success {
  color: #bfffd4;
  background: rgba(154, 243, 181, 0.16);
}

.payment-status.warning {
  color: #ffe4a8;
  background: rgba(255, 200, 92, 0.18);
}

.payment-status.danger {
  color: #ffd0ca;
  background: rgba(255, 111, 97, 0.18);
}

.payment-status.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.payment-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.payment-meta-row span {
  max-width: 220px;
  overflow: hidden;
  padding: 3px 7px;
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-amount {
  min-width: 0;
  text-align: right;
}

.payment-amount strong,
.payment-amount span {
  display: block;
}

.payment-amount strong {
  color: var(--mint);
  font-family: var(--mono);
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.15;
}

.payment-amount span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.payment-edit-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 900;
}

.risk-detail-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  z-index: 90;
}

.risk-detail-overlay[hidden] {
  display: none;
}

.risk-detail-modal {
  width: min(880px, calc(100vw - 42px));
  max-height: min(720px, calc(100vh - 42px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    #151419;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.56);
}

.risk-detail-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.risk-detail-modal header span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.risk-detail-modal h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.risk-detail-list {
  display: grid;
  gap: 10px;
  max-height: 590px;
  overflow: auto;
  padding: 14px;
}

.risk-detail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.45fr);
  gap: 14px;
  padding: 14px 14px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--module-color), transparent 4px),
    rgba(0, 0, 0, 0.16);
}

.risk-detail-item strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.risk-detail-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.risk-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.risk-detail-tags span {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 11px;
  font-weight: 850;
}

.risk-detail-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.risk-register {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 115px;
  align-content: start;
  align-items: start;
  gap: 12px;
}

.key-register-panel .risk-register {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: rgba(41, 219, 200, 0.42) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.risk-item {
  height: 115px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--module-color), transparent 4px),
    rgba(255, 255, 255, 0.048);
}

.risk-item h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.risk-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.risk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: start;
  max-height: 48px;
  margin-top: auto;
  overflow: hidden;
}

.meta-tag {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 16px;
}

.story-card {
  min-height: 240px;
  padding: 24px;
}

.story-card.wide {
  grid-column: span 2;
}

.story-kicker {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-card h2 {
  margin: 14px 0;
  max-width: 1100px;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

.story-card p,
.leadership-notes {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.module-readiness {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.readiness-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 12px;
  align-items: center;
}

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

.readiness-meter {
  position: relative;
  height: 9px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.readiness-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--module-color), var(--mint));
}

.next-actions {
  display: grid;
  align-content: start;
  gap: 12px;
  margin-top: 16px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: rgba(41, 219, 200, 0.42) rgba(255, 255, 255, 0.08);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.report-next-card .next-actions {
  flex: 1 1 auto;
  height: 100%;
}

.next-actions::-webkit-scrollbar,
.key-register-panel .risk-register::-webkit-scrollbar,
.report-secondary-grid > .risk-panel:last-child .payment-board::-webkit-scrollbar {
  width: 8px;
}

.next-actions::-webkit-scrollbar-track,
.key-register-panel .risk-register::-webkit-scrollbar-track,
.report-secondary-grid > .risk-panel:last-child .payment-board::-webkit-scrollbar-track {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.next-actions::-webkit-scrollbar-thumb,
.key-register-panel .risk-register::-webkit-scrollbar-thumb,
.report-secondary-grid > .risk-panel:last-child .payment-board::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(41, 219, 200, 0.42);
}

.next-action {
  --urgency-color: var(--mint);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 94px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--module-color) 34%, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--module-color) 16%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.next-action.urgent {
  --urgency-color: var(--coral);
}

.next-action.soon {
  --urgency-color: var(--amber);
}

.next-action.steady {
  --urgency-color: var(--mint);
}

.next-action-date {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-height: 70px;
  border: 1px solid color-mix(in srgb, var(--urgency-color) 42%, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--urgency-color) 22%, rgba(0, 0, 0, 0.18)), rgba(0, 0, 0, 0.22));
}

.next-action-date strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.next-action-date span {
  color: color-mix(in srgb, var(--urgency-color) 78%, white);
  font-size: 11px;
  font-weight: 900;
}

.next-action-main {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.next-action-main h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.3;
}

.next-action-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.next-action-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 9px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  font-weight: 800;
}

.next-action-tags .module-tag {
  color: color-mix(in srgb, var(--module-color) 76%, white);
  border-color: color-mix(in srgb, var(--module-color) 38%, rgba(255, 255, 255, 0.1));
  background: color-mix(in srgb, var(--module-color) 14%, rgba(0, 0, 0, 0.12));
}

.next-action-tags .risk-low {
  color: #c8ffd7;
}

.next-action-tags .risk-medium {
  color: #ffe0a0;
}

.next-action-tags .risk-high {
  color: #ffc3da;
}

.next-action-tags .risk-severe {
  color: #ffb8b1;
}

.next-action-progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.next-action-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--module-color), var(--urgency-color));
}

.next-action.empty {
  --module-color: var(--muted-2);
  --progress: 0%;
}

.leadership-note-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.leadership-note-date {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.leadership-note-date span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.leadership-note-date input {
  min-height: 32px;
  border: 0;
  color: var(--text);
  background: transparent;
  outline: none;
  color-scheme: dark;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.leadership-note-input {
  width: 100%;
  min-height: 96px;
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.15);
  outline: none;
  resize: vertical;
  line-height: 1.6;
}

.leadership-note-input:focus {
  border-color: rgba(255, 200, 92, 0.42);
  box-shadow: 0 0 0 2px rgba(255, 200, 92, 0.12);
}

.leadership-note-input::placeholder {
  color: var(--muted-2);
}

.leadership-notes {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.leadership-notes:empty::before {
  content: attr(data-placeholder);
  min-height: 74px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.leadership-note-entry {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 200, 92, 0.72), transparent 4px),
    rgba(0, 0, 0, 0.16);
}

.leadership-note-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.leadership-note-entry-date {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.leadership-note-entry-date span {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.leadership-note-entry-date input {
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  border: 1px solid rgba(255, 200, 92, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  outline: none;
  color-scheme: dark;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.leadership-note-entry-date input:focus,
.leadership-note-entry-body:focus {
  border-color: rgba(255, 200, 92, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 200, 92, 0.12);
}

.leadership-note-delete {
  min-height: 32px;
  padding: 0 12px;
  color: #ffb8b1;
  border: 1px solid rgba(255, 111, 97, 0.28);
  border-radius: 8px;
  background: rgba(255, 111, 97, 0.08);
}

.leadership-note-delete:hover {
  border-color: rgba(255, 111, 97, 0.44);
  background: rgba(255, 111, 97, 0.14);
}

.leadership-note-entry-body {
  width: 100%;
  min-height: 82px;
  padding: 12px 14px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
  outline: none;
  resize: vertical;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.leadership-note-entry-body::placeholder {
  color: var(--muted-2);
}

.task-dialog {
  width: min(920px, calc(100vw - 40px));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    #151418;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.56);
}

.task-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.task-dialog form {
  margin: 0;
}

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

.dialog-head h2 {
  margin: 3px 0 0;
}

.dialog-kicker {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 20px 22px;
}

.dialog-grid label {
  display: grid;
  gap: 7px;
}

.dialog-grid .span-2 {
  grid-column: span 2;
}

.dialog-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dialog-grid input,
.dialog-grid select,
.dialog-grid textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  outline: none;
  padding: 9px 11px;
}

.dialog-grid textarea {
  resize: vertical;
}

.dialog-grid input:focus,
.dialog-grid select:focus,
.dialog-grid textarea:focus {
  border-color: rgba(41, 219, 200, 0.5);
  box-shadow: 0 0 0 2px rgba(41, 219, 200, 0.16);
}

.dialog-grid input[type="range"] {
  padding: 0;
  accent-color: var(--teal);
}

#progressOutput {
  color: var(--mint);
  font-family: var(--mono);
  font-weight: 900;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
}

.dialog-action-group {
  display: flex;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  padding: 13px 16px;
  border: 1px solid rgba(41, 219, 200, 0.32);
  border-radius: 8px;
  color: var(--text);
  background: rgba(18, 17, 20, 0.92);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 80;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.sync-auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 84px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 84px),
    linear-gradient(135deg, rgba(11, 26, 30, 0.98), rgba(19, 18, 23, 0.98) 54%, rgba(22, 24, 28, 0.98)),
    #101014;
  backdrop-filter: blur(16px);
  z-index: 120;
}

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

.sync-auth-card {
  width: min(460px, calc(100vw - 48px));
  min-height: auto;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    rgba(18, 17, 20, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  overflow: hidden;
}

.sync-auth-panel {
  display: grid;
  align-content: center;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(41, 219, 200, 0.045), transparent 42%),
    rgba(18, 17, 20, 0.9);
}

.sync-auth-head {
  display: grid;
  gap: 8px;
  padding: 32px 34px 18px;
}

.sync-auth-kicker {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sync-auth-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.18;
}

.sync-auth-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sync-auth-form {
  display: grid;
  gap: 14px;
  padding: 18px 34px 34px;
}

.sync-auth-form label {
  display: grid;
  gap: 6px;
}

.sync-auth-form label > span {
  color: var(--muted);
  font-size: 12px;
}

.sync-auth-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  padding: 0 13px;
}

.sync-auth-form input:focus {
  outline: none;
  border-color: rgba(41, 219, 200, 0.54);
  box-shadow: 0 0 0 3px rgba(41, 219, 200, 0.16);
}

.sync-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}

@media (max-width: 880px) {
  .sync-auth-card {
    width: min(460px, calc(100vw - 36px));
  }
}

.presentation .side-rail,
.presentation .control-deck,
.presentation .project-switcher,
.presentation .project-meta-grid,
.presentation #addProjectButton,
.presentation .toolbar .toolbar-button:not(#presentationToggle),
.presentation #addTaskButton {
  display: none;
}

.presentation.app-shell {
  grid-template-columns: 1fr;
  overflow-x: hidden;
  overflow-y: auto;
}

.presentation.app-shell:fullscreen,
.presentation.app-shell:-webkit-full-screen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.presentation .workspace {
  padding: 26px;
}

.presentation .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.presentation .timeline-layout {
  height: calc(100vh - 278px);
  min-height: 620px;
}

@media (max-width: 1380px) {
  .topbar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .topbar > .title-zone,
  .topbar > .toolbar,
  .topbar > .project-meta-grid {
    grid-column: 1;
  }

  .topbar > .toolbar {
    grid-row: 2;
    width: 100%;
    margin-top: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar > .project-meta-grid {
    grid-row: 3;
  }

  .title-zone h1 {
    white-space: normal;
  }

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

  .insight-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .sample-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .timeline-layout {
    height: max(620px, calc(100vh - 380px));
    grid-template-columns: 410px minmax(620px, 1fr);
  }

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

@media (max-width: 1100px) {
  html {
    min-width: 0;
  }

  body {
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    height: 64px;
    flex-direction: row;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    z-index: 60;
  }

  .brand-mark,
  .rail-history-zone,
  .rail-footer {
    display: none;
  }

  .workspace {
    padding: 14px 14px 92px;
  }

  .topbar {
    padding: 18px;
  }

  .title-zone h1 {
    font-size: 34px;
  }

  .toolbar,
  .split-actions {
    width: 100%;
  }

  .toolbar > *,
  .split-actions > * {
    flex: 1 1 auto;
  }

  .insight-band {
    grid-template-columns: 1fr;
  }

  .sample-summary {
    grid-template-columns: 1fr;
  }

  .sample-mode-switch {
    width: 100%;
  }

  .sample-mode-switch button {
    flex: 1 1 0;
    min-width: 0;
  }

  .sample-project-summary {
    grid-template-columns: 1fr;
  }

  .sample-table-wrap {
    min-height: 460px;
    max-height: calc(100vh - 330px);
  }

  .sample-overview-table-wrap {
    min-height: 420px;
    max-height: calc(100vh - 330px);
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .timeline-layout,
  .risk-grid,
  .story-layout {
    grid-template-columns: 1fr;
  }

  .timeline-left {
    display: none;
  }

  .timeline-layout {
    height: calc(100vh - 320px);
    min-height: 520px;
  }

  .story-card.wide {
    grid-column: span 1;
  }

  .story-card h2 {
    font-size: 30px;
  }

  .risk-register {
    grid-template-columns: 1fr;
  }

  .risk-kpi-grid,
  .risk-chart-grid,
  .payment-summary {
    grid-template-columns: 1fr;
  }

  .risk-donut-card {
    grid-template-columns: 132px minmax(0, 1fr);
  }

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

  .payment-milestone {
    grid-template-columns: 30px minmax(0, 1fr);
    padding-right: 40px;
  }

  .payment-summary,
  .payment-board {
    width: 100%;
  }

  .payment-amount {
    grid-column: 2;
    text-align: left;
  }

  .risk-detail-item {
    grid-template-columns: 1fr;
  }

  .dialog-grid,
  .dialog-grid .span-2 {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }
}
