:root {
  --bg: #e8ebe6;
  --bg-app: #f4f5f2;
  --surface: #ffffff;
  --ink: #1a221c;
  --ink-muted: #5c6b60;
  --line: #c9d0c8;
  --line-soft: rgb(0 0 0 / 0.08);
  --accent: #0f6b5c;
  --accent-soft: #d7ebe6;
  --accent-bar: #1a8f7a;
  --summary: #2c3d4f;
  --summary-bar: #3d556e;
  --danger: #9b2c2c;
  --tuesday: #c45c26;
  --deadline: #8b1e3f;
  --shadow: 0 1px 0 rgb(0 0 0 / 0.04);
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
}

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

#app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  grid-template-columns: 1fr 300px;
  grid-template-areas:
    "top top"
    "banner banner"
    "views views"
    "stats stats"
    "main detail";
}

.banner-stack {
  grid-area: banner;
  display: flex;
  flex-direction: column;
}

.share-banner {
  background: #e7f2ef;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  padding: 8px 16px;
  font-size: 13px;
}

.share-banner.hidden {
  display: none;
}

.live-banner {
  background: #e8eef8;
  color: #1e4a8c;
}

.live-banner .live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e44;
  margin-right: 6px;
  vertical-align: middle;
}

.live-banner.offline .live-dot {
  background: #c92a2a;
}

.share-banner strong {
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  max-width: min(360px, calc(100vw - 32px));
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.topbar {
  grid-area: top;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: end;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 12px;
  height: 36px;
  background: var(--accent);
  border-radius: 2px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.project-meta {
  display: flex;
  gap: 12px;
}

.project-meta label,
.detail label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.project-meta input,
.detail input,
.detail select,
.detail textarea,
.task-table input,
.task-table select {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  background: #fff;
  min-width: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 550;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn.danger {
  color: var(--danger);
  border-color: #e2b4b4;
}

.sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}

.stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.viewbar {
  grid-area: views;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.view-tabs {
  display: flex;
  gap: 4px;
}

.view-tab {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 550;
}

.view-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  user-select: none;
}

.stat .value.crit {
  color: var(--danger);
}

.stat {
  background: var(--bg-app);
  padding: 12px 16px;
}

.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
}

.stat .value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.workspace {
  grid-area: main;
  display: grid;
  grid-template-rows: minmax(280px, 1fr) minmax(260px, 1fr);
  min-height: 0;
  background: var(--bg-app);
}

.workspace.gantt-only,
.workspace.network-only,
.workspace.resources-only {
  grid-template-rows: 1fr;
}

.viewbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-icon {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  line-height: 1;
  color: var(--accent);
  font-size: 13px;
}

.btn-icon:hover {
  background: var(--accent-soft);
}

.col-info {
  width: 40px;
  text-align: center;
}

.resource-wrap {
  flex: 1;
  min-height: 0;
}

.resource-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.resource-table th,
.resource-table td {
  border-bottom: 1px solid var(--line);
  padding: 0;
  text-align: left;
  white-space: nowrap;
}

.resource-table th {
  background: #eef1f3;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  font-size: 12px;
}

.resource-table tr.selected td {
  background: #dce8e4;
}

.resource-table input,
.resource-table select {
  width: 100%;
  min-width: 72px;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
}

.resource-table input:focus,
.resource-table select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #fff;
}

.resource-table .col-rid {
  width: 44px;
  text-align: center;
  padding: 8px;
  color: var(--ink-muted);
}

.resource-table .col-name {
  min-width: 180px;
}

.ti-modal {
  width: min(560px, 100%);
}

.ti-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid #c5ccd3;
  background: #f7f8f6;
}

.ti-body {
  padding: 12px 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(60vh, 480px);
  overflow: auto;
}

.ti-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.ti-panel input,
.ti-panel textarea,
.ti-panel select {
  font: inherit;
  font-weight: 400;
  padding: 6px 8px;
  border: 1px solid #c5ccd3;
  border-radius: 2px;
}

.ti-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.ti-est {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 400 !important;
  padding-bottom: 8px;
}

.ti-assign-wrap {
  max-height: 220px;
}

.ti-assign-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ctx-menu {
  position: fixed;
  z-index: 1100;
  background: #fff;
  border: 1px solid #9aa3ab;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  min-width: 180px;
  padding: 4px 0;
}

.ctx-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ctx-menu button:hover {
  background: #d6e8f5;
}

#detailForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workspace.network-only .network-pane {
  min-height: 420px;
}

.pane {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pane-head {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--line);
}

.pane-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pane-head p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.zoom {
  display: flex;
  gap: 4px;
}

.table-wrap,
.gantt-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  user-select: none;
}

.task-table.msp-sheet th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #c6d9b5;
  border: 1px solid #a8b896;
  text-align: left;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #1f2a1a;
}

.task-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f2ee;
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.task-table td {
  border: 1px solid #d5dcd0;
  padding: 0;
  vertical-align: middle;
  background: #fff;
}

.task-table tr {
  cursor: pointer;
}

.task-table tr:hover td {
  background: #f3f7ef;
}

.task-table tr.selected td,
.task-table tr.row-selected td {
  background: #d9d9d9;
}

.task-table tr.row-selected td.col-id,
.task-table tr.selected td.col-id,
.task-table tr.row-selected td.col-wbs,
.task-table tr.selected td.col-wbs {
  background: #c0c0c0;
  color: #111;
  font-weight: 700;
}

.task-table tr.row-selected td.col-name,
.task-table tr.selected td.col-name {
  background: #d0d0d0;
}

.task-table td.cell-active {
  background: #fff !important;
  outline: 2px solid #6aa84f;
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}

.task-table tr.summary td {
  font-weight: 600;
  background: #eef3e8;
}

.task-table tr.summary.row-selected td,
.task-table tr.summary.selected td {
  background: #cfcfcf;
}

.task-table input,
.task-table select {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
  user-select: text;
}

.task-table input:focus,
.task-table select:focus {
  outline: 2px solid #6aa84f;
  outline-offset: -2px;
  background: #fff;
}

.col-id {
  width: 40px;
  text-align: center;
}

.col-id.row-head {
  cursor: cell;
  background: #ececec;
}

.col-mode {
  width: 48px;
  text-align: center;
  cursor: pointer;
}

.mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
}

.mode-icon.auto {
  color: #1a73e8;
  font-weight: 700;
  border: 1px solid #1a73e8;
  border-radius: 2px;
  background: #e8f0fe;
}

.mode-icon.manual {
  font-size: 14px;
}

.col-wbs {
  width: 72px;
}
.col-name {
  width: auto;
  min-width: 180px;
}
.col-pred {
  width: 120px;
}
.col-dur {
  width: 72px;
}
.col-start,
.col-finish {
  width: 128px;
}

.gantt-row.msp,
.gantt-rows.msp {
  --gantt-row-h: 28px;
}

.bar-label {
  display: none;
}

.gantt-links {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  overflow: visible;
}

.gantt-link {
  fill: none;
  stroke: #445566;
  stroke-width: 1.5;
  pointer-events: stroke;
  cursor: help;
}

.gantt-link.critical {
  stroke: #b22222;
  stroke-width: 2;
}

.gantt-bar {
  position: absolute;
  height: 14px;
  border-radius: 2px;
  background: #5b9bd5;
  z-index: 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  border: 1px solid #2e75b6;
}

.gantt-bar.summary {
  background: #445566;
  border-color: #2b3642;
  height: 8px;
  overflow: visible;
}

.gantt-bar.critical {
  background: #c00000;
  border-color: #8b0000;
}

.gantt-bar.milestone {
  width: 10px !important;
  height: 10px;
  background: #000;
  border: none;
  transform: rotate(45deg);
  border-radius: 1px;
  min-width: 10px;
}

.gantt-bar.milestone.critical {
  background: #c00000;
}

.gantt-progress {
  height: 100%;
  background: rgb(0 0 0 / 0.28);
}

.bar-label {
  position: absolute;
  left: 4px;
  right: 4px;
  font-size: 10px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.summary-cap {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 14px;
  background: #445566;
}

.summary-cap.left {
  left: 0;
}
.summary-cap.right {
  right: 0;
}

.gantt-bar.critical .summary-cap {
  background: #c00000;
}

#networkSvg .edge-label {
  font-size: 10px;
  fill: #334455;
  text-anchor: middle;
  font-family: var(--mono);
}

#networkSvg .edge-label.critical {
  fill: #b22222;
  font-weight: 700;
}

code {
  font-family: var(--mono);
  font-size: 11px;
  background: #eef2f0;
  padding: 1px 4px;
  border-radius: 3px;
}
.col-start,
.col-finish {
  width: 118px;
}
.col-dur,
.col-float {
  width: 58px;
}
.col-pct {
  width: 68px;
}
.col-owner {
  width: 100px;
}
.col-status {
  width: 110px;
}

.task-table tr.critical td {
  background: #fceeee;
}

.task-table tr.critical.selected td {
  background: #f6d6d6;
}

.crit-tag {
  color: var(--danger);
  font-weight: 700;
  font-size: 10px;
}

.float-cell {
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12px;
}

.float-cell.crit {
  color: var(--danger);
  font-weight: 700;
}

.wbs-code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 10px;
  color: var(--ink-muted);
}

.task-name {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: calc(10px + var(--indent, 0) * 16px);
}

.task-name .diamond {
  width: 8px;
  height: 8px;
  background: var(--tuesday);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.gantt {
  position: relative;
  width: max-content;
  min-width: 100%;
}

.gantt-header,
.gantt-row {
  display: grid;
  align-items: stretch;
}

.gantt-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f0f2ee;
  border-bottom: 1px solid var(--line);
  height: 40px;
}

.gantt-cell {
  border-right: 1px solid #e2e7e0;
  font-size: 10px;
  color: var(--ink-muted);
  padding: 4px;
  text-align: center;
}

.gantt-cell.tuesday {
  background: rgb(196 92 38 / 0.08);
  color: var(--tuesday);
  font-weight: 600;
}

.gantt-cell.week-col {
  background: transparent;
  border-right: 1px solid #d5dbd6;
}

.gantt-cell.month-start {
  border-left: 2px solid var(--line);
}

.gantt-rows {
  position: relative;
}

.gantt-row {
  height: 36px;
  border-bottom: 1px solid #e6eae3;
  position: relative;
}

.gantt-row.selected {
  background: rgb(15 107 92 / 0.06);
}

.gantt-bar {
  position: absolute;
  top: 8px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent-bar);
  min-width: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.gantt-bar.summary {
  background: var(--summary-bar);
  height: 12px;
  top: 12px;
  border-radius: 2px;
}

.gantt-bar.milestone {
  width: 12px !important;
  height: 12px;
  top: 12px;
  background: var(--tuesday);
  transform: rotate(45deg);
  border-radius: 1px;
  min-width: 12px;
}

.gantt-progress {
  height: 100%;
  background: rgb(0 0 0 / 0.22);
}

.deadline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--deadline);
  z-index: 2;
  pointer-events: none;
}

.gantt-bar.critical {
  background: #c23b3b;
}

.gantt-bar.critical.summary {
  background: #8b1e3f;
}

.gantt-bar.milestone.critical {
  background: #c23b3b;
}

.network-pane {
  background: var(--surface);
}

.network-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
  background: #fff;
}

#networkSvg {
  display: block;
}

#networkSvg .edge {
  fill: none;
  stroke: #2f6fad;
  stroke-width: 1.75;
  pointer-events: stroke;
  cursor: help;
}

#networkSvg .edge.critical {
  stroke: #c44;
  stroke-width: 2.25;
}

#networkSvg .node-bg {
  fill: #fff;
  stroke: #2f6fad;
  stroke-width: 1.75;
}

#networkSvg .node.noncritical .node-bg {
  stroke: #2f6fad;
  fill: #fff;
}

#networkSvg .node.critical .node-bg {
  stroke: #c44;
  stroke-width: 2;
  fill: #fff8f8;
}

#networkSvg .node.selected .node-bg {
  stroke: #f0a000;
  stroke-width: 3;
  fill: #fffbeb;
}

#networkSvg .node.selected.critical .node-bg {
  stroke: #e67e00;
  fill: #fff3e0;
}

#networkSvg .node.magnified {
  cursor: zoom-in;
}

#networkSvg .node.magnified .node-bg {
  stroke-width: 2.5;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

#networkSvg .node.magnified .node-name {
  font-size: 11px;
}

#networkSvg .progress-slash {
  stroke: #555;
  stroke-width: 1.25;
  pointer-events: none;
}

#networkSvg .node-rule,
#networkSvg .node-rule-v {
  stroke: #b0b8c0;
  stroke-width: 1;
}

#networkSvg .node-name {
  font-family: "Segoe UI", "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: #1a1a1a;
  text-anchor: middle;
}

#networkSvg .node-cell-label {
  font-family: "Segoe UI", sans-serif;
  font-size: 8px;
  fill: #666;
  text-anchor: start;
}

#networkSvg .node-cell {
  font-family: "Segoe UI", "IBM Plex Mono", monospace;
  font-size: 10px;
  fill: #222;
  text-anchor: start;
}

#networkSvg .crit-text {
  fill: var(--danger);
  font-weight: 700;
}

.detail-metrics {
  margin-top: 4px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.metric-grid span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.metric-grid .crit {
  border-color: #e2b4b4;
  color: var(--danger);
  font-weight: 700;
}

.pane.hidden {
  display: none !important;
}

.detail {
  grid-area: detail;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 16px;
}

.detail h2 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.muted {
  color: var(--ink-muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

/* —— Change Working Time modals (MS Project–style) —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgb(20 28 36 / 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: #f7f8f6;
  border: 1px solid #9aa3ab;
  border-radius: 2px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.28);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
}

.modal-head {
  padding: 10px 14px;
  background: linear-gradient(180deg, #f4f6f8, #e8ecf0);
  border-bottom: 1px solid #c5ccd3;
}

.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #c5ccd3;
  background: #eef1f3;
}

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

.wt-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 0;
}

.wt-cal-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.wt-cal-select select {
  min-width: 260px;
  padding: 4px 8px;
}

.wt-note {
  margin: 0 14px 8px;
  font-size: 12px;
  color: var(--muted, #5c6670);
}

.wt-schedule-opts {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 14px 10px;
  flex-wrap: wrap;
}

.wt-schedule-opts label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.wt-schedule-opts input {
  width: 88px;
  padding: 4px 8px;
  font: inherit;
  font-weight: 400;
  border: 1px solid #c5ccd3;
}

.wt-hours-hint {
  font-size: 12px;
  padding-bottom: 6px;
}

.wt-mid {
  display: grid;
  grid-template-columns: 150px 1fr 200px;
  gap: 12px;
  padding: 0 14px 12px;
  align-items: start;
}

.wt-legend {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 28px;
}

.wt-legend .leg {
  display: inline-block;
  width: 22px;
  height: 16px;
  border: 1px solid #8a939c;
  margin-right: 6px;
  vertical-align: middle;
}

.wt-legend .leg.working {
  background: #fff;
}
.wt-legend .leg.nonworking {
  background: #d8dce0;
}
.wt-legend .leg.edited {
  background: #fff;
  font-weight: 700;
  text-align: center;
  line-height: 14px;
  font-size: 10px;
}
.wt-legend .leg.edited::after {
  content: "31";
  font-weight: 700;
}
.wt-legend .leg.exception {
  background: #9fd6ef;
}
.wt-legend .leg.nondefault {
  background: #f3e6a8;
}

.wt-minical-wrap {
  border: 1px solid #b8c0c8;
  background: #fff;
  padding: 8px;
}

.wt-minical-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.wt-minical {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  font-size: 11px;
  text-align: center;
}

.wt-minical .dow {
  font-weight: 600;
  color: var(--ink-muted);
  padding: 4px 0;
}

.wt-minical .day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  background: #fff;
}

.wt-minical .day.empty {
  background: transparent;
  cursor: default;
}

.wt-minical .day.nonworking {
  background: #d8dce0;
}

.wt-minical .day.exception {
  background: #9fd6ef;
  font-weight: 700;
}

.wt-minical .day.edited {
  font-weight: 700;
}

.wt-minical .day.selected {
  outline: 2px solid #6b2b1f;
  outline-offset: -2px;
  background: #8b3a2b;
  color: #fff;
}

.wt-minical .day:hover:not(.empty) {
  border-color: #6b8a9a;
}

.wt-day-info {
  font-size: 12px;
  line-height: 1.45;
  padding: 8px;
  border: 1px solid #d0d6dc;
  background: #fff;
  min-height: 120px;
}

.wt-day-info .hours {
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.wt-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid #c5ccd3;
}

.wt-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: -1px;
}

.wt-tab.active {
  background: #fff;
  border-color: #c5ccd3;
  border-bottom-color: #fff;
  font-weight: 600;
}

.wt-tab-panels {
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #c5ccd3;
  min-height: 160px;
}

.wt-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.wt-table-wrap {
  border: 1px solid #b8c0c8;
  max-height: 160px;
  overflow: auto;
}

.wt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.wt-table th,
.wt-table td {
  border-bottom: 1px solid #e2e6ea;
  padding: 4px 6px;
  text-align: left;
}

.wt-table th {
  background: #eef1f3;
  position: sticky;
  top: 0;
}

.wt-table tr.selected td {
  background: #d6e8f5;
}

.wt-table input[type="text"],
.wt-table input[type="date"] {
  width: 100%;
  border: 1px solid #c5ccd3;
  padding: 2px 4px;
  font: inherit;
  background: #fff;
}

.wt-side-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wwd-modal {
  width: min(520px, 100%);
}

.wwd-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 0 14px 12px;
}

.wwd-days-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

#wwdDayList {
  width: 100%;
  height: 160px;
  font: inherit;
  font-size: 12px;
}

.wwd-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.wwd-radio {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.wwd-shifts {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.wwd-shifts th,
.wwd-shifts td {
  border: 1px solid #c5ccd3;
  padding: 2px 4px;
}

.wwd-shifts input {
  width: 100%;
  border: none;
  font: inherit;
  background: transparent;
}

.wwd-shifts.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.gantt-cell.nonworking,
.gantt-cell.weekend {
  background: rgb(0 0 0 / 0.06);
}

.gantt-cell.holiday {
  background: rgb(0 0 0 / 0.1);
}

#detailForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#detailForm textarea {
  resize: vertical;
  min-height: 96px;
}

@media (max-width: 1100px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "banner"
      "views"
      "stats"
      "main"
      "detail";
  }

  .detail {
    border-left: none;
    border-top: 1px solid var(--line);
  }

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

html.access-locked #app {
  display: none;
}

.access-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, #d7ebe6 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, #e2e8df 0%, transparent 50%),
    var(--bg);
}

.access-gate.hidden {
  display: none;
}

.access-gate-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.access-gate-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.access-gate-note {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.45;
}

.access-gate-card label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 500;
}

.access-gate-card input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.access-gate-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.access-gate-error.hidden {
  display: none;
}

.access-session-label {
  align-self: center;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.access-session-label.hidden {
  display: none;
}
