* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #17283e;
  background: #f4f7fb;
  font-size: 14px;
  --navy: #102845;
  --blue: #1757b6;
  --line: #d9e3f0;
  --muted: #526681;
  --week-width: 112px;
  --details-width: 426px;
}
body { margin: 0; }
button, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, select:focus-visible, summary:focus-visible, .grid-scroll:focus-visible, .totals:focus-visible { outline: 2px solid #2a6bce; outline-offset: 2px; }
.top { min-height: 66px; padding: 0 30px; background: var(--navy); color: white; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .top-right { display: flex; align-items: center; gap: 12px; }
.brand { font-size: 20px; font-weight: 700; letter-spacing: -.35px; line-height: 1.04; }
.brand-mark { border-radius: 8px; display: grid; place-items: center; width: 36px; height: 36px; background: #2867c5; font-size: 25px; }
.brand-sub { display: block; margin-top: 4px; color: #b5c9e9; font-size: 9px; letter-spacing: .15em; }
.prototype, .demo-user { color: #dae7fa; font-size: 12px; }
.prototype { border: 1px solid #6480a5; border-radius: 20px; padding: 5px 10px; }
main { max-width: 1880px; margin: auto; padding: 22px 28px; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 17px; }
.eyebrow { font-size: 10px; letter-spacing: .13em; color: #285a99; font-weight: 750; }
h1 { font-size: clamp(26px, 4vw, 34px); margin: 3px 0 4px; letter-spacing: -.035em; line-height: 1.15; }
.heading-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.heading p { color: var(--muted); margin: 0; }
.totals {
  --annual-card-width: 155px;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-color: #9db2ce #edf2f8;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 15px;
}
.annual-metrics { display: grid; grid-template-columns: repeat(3, minmax(var(--annual-card-width), max-content)); flex: none; }
.annual-metrics > div { display: grid; grid-template-columns: minmax(0, 1fr); padding: 10px 18px; border-right: 1px solid var(--line); gap: 2px; }
.totals strong { font-size: 20px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.selection-metrics strong { overflow: hidden; text-overflow: ellipsis; }
.metric-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.forecast { color: #154ca0; background: #eef5ff; }
.schedule { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.toolbar { min-height: 48px; padding: 7px 12px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; border-bottom: 1px solid var(--line); }
.project-filter { position: relative; margin-right: 7px; }
.project-filter summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 174px;
  min-height: 31px;
  padding: 4px 9px;
  border: 1px solid #b6c9e3;
  border-radius: 6px;
  background: #f0f6ff;
  color: #16457e;
  cursor: pointer;
  font-size: 12px;
}
.month-filter summary { width: auto; min-width: 125px; }
.month-filter .filter-panel { width: min(560px, calc(100vw - 75px)); }
.month-options { display: flex; gap: 12px; margin-top: 4px; overflow-x: auto; }
.month-option-year { flex: 1 0 105px; min-width: 0; border: 1px solid var(--line); padding: 5px 7px; border-radius: 5px; }
.month-option-year legend { font-size: 12px; font-weight: 750; color: #244567; }
.month-option-year label { display: flex; gap: 5px; align-items: center; margin: 0; padding: 3px 0; cursor: pointer; }
.month-option-year input { margin: 0; accent-color: var(--blue); }
.project-filter summary::-webkit-details-marker { display: none; }
.project-filter summary::after { content: '▾'; margin-left: auto; }
.filter-label { color: #526681; }
#project-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-panel {
  position: absolute;
  z-index: 6;
  top: calc(100% + 5px);
  left: 0;
  width: min(285px, calc(100vw - 60px));
  padding: 9px;
  border: 1px solid #b6c9e3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px #1028452b;
}
.filter-panel label { display: block; margin: 0 0 4px; color: var(--muted); font-size: 11px; }
#project-search { width: 100%; padding: 7px 8px; font: inherit; border: 1px solid #b6c9e3; border-radius: 5px; }
#project-search:focus-visible { outline: 2px solid #2a6bce; outline-offset: 1px; }
.project-options { max-height: 245px; margin-top: 5px; overflow: auto; }
.project-option { width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; text-align: left; color: #15385f; background: white; border: 0; border-radius: 4px; }
.project-option.checked { font-weight: 750; background: #e4efff; }
.project-option { align-items: center; cursor: pointer; }
.project-option input { margin: 0; accent-color: var(--blue, #1555a5); }
.project-option span { flex: 1; }
#grid .overdue-item .detail-grid > * { color: #a52127; font-weight: 750; }
.project-option:hover { background: #eef5ff; }
.project-option small, .filter-empty { color: var(--muted); }
.filter-empty { margin: 6px 8px; font-size: 12px; }
.year-tools, .legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
#year { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
button.icon, button.secondary, button.primary, button.quiet, select { min-height: 31px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 650; white-space: nowrap; }
button.icon, button.secondary, select { background: white; border: 1px solid #cbd8e9; color: #244567; }
button.icon { min-width: 30px; font-size: 19px; line-height: 18px; padding: 3px 6px; }
button.secondary:hover:enabled, button.icon:hover:enabled, select:hover { background: #edf4ff; }
button.primary { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
button.primary:hover:enabled { background: #114994; }
button.primary:disabled { color: #f8fbff; background: #627eaa; border-color: #627eaa; }
button.quiet { background: transparent; border: 1px solid transparent; color: #24569a; }
button.quiet:hover:enabled { background: #e5eeff; }
button.secondary:disabled, button.quiet:disabled { color: #66778c; }
.legend { gap: 12px; color: var(--muted); font-size: 11px; }
.legend label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.legend label:has(input:checked) { font-weight: 750; color: #243d58; }
.legend input { margin: 0; accent-color: #1757b6; cursor: pointer; }
.legend i { width: 11px; height: 11px; border-width: 1px; border-style: solid; border-radius: 3px; }
.legend .chosen { background: #154fa3; border-color: #154fa3; }
.summary-selection {
  display: flex;
  flex: 1 0 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 7px 12px;
}
.selection-metrics { display: grid; grid-template-columns: 62px 51px 128px; gap: 8px; }
.selection-metrics > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.selection-metrics strong { font-size: 16px; }
.selection-actions { display: flex; align-items: center; gap: 6px; }
.selection-actions #preview:disabled { color: #66778c; background: #edf2f8; border-color: #d3dfee; }
.grid-scroll { overflow: auto; max-height: max(300px, calc(100vh - 330px)); position: relative; scrollbar-color: #9db2ce #edf2f8; }
#grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%; }
.details-col { width: var(--details-width); }
.week-col { width: var(--week-width); }
#grid th, #grid td { border-bottom: 1px solid #e1e9f4; border-right: 1px solid #e1e9f4; }
#grid thead { position: sticky; top: 0; z-index: 3; }
#grid .details { position: sticky; left: 0; z-index: 2; padding: 0 9px; text-align: left; background: #fff; box-shadow: 3px 0 5px #1a3e6d16; width: var(--details-width); }
#grid thead .details { background: #f6f8fb; z-index: 4; }
.intro { height: 66px; }
.intro small, .week small, .project-name small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; }
.intro small { margin-top: 4px; }
.detail-grid { display: grid; grid-template-columns: 22px minmax(0, 1fr) 42px 85px; gap: 6px; align-items: center; font-size: 11px; min-height: 33px; }
.detail-grid > :nth-child(3), .detail-grid > :nth-child(4) { text-align: right; white-space: nowrap; }
.contract-amount small { display: block; color: var(--muted); font-weight: 550; font-size: .85em; }
.milestone-button { background: transparent; border: 1px solid transparent; border-radius: 4px; color: #315b86; height: 25px; padding: 0; font-size: 17px; line-height: 1; }
.milestone-button:hover, .milestone-button[aria-expanded="true"] { border-color: #cbd8e9; background: #edf4ff; }
.labels .detail-grid { color: #284f79; font-weight: 750; }
.project-name { color: #183b64; font-weight: 750; }
.item-number { color: #526681; font-variant-numeric: tabular-nums; }
button.item-number { padding: 2px 0; border: 0; border-radius: 3px; background: transparent; text-align: left; }
button.item-number:hover { text-decoration: underline; }
.description { overflow-wrap: anywhere; padding-block: 5px; font-weight: 550; }
#grid .project-start > * { border-top: 1px solid #b7cae3; background: #edf4ff; }
#grid .project-start .project-name { padding-block: 5px; overflow-wrap: anywhere; }
.project-name small { display: inline; margin-left: 8px; }
.month-head { text-align: left; padding: 6px 9px; height: 66px; background: #fff; }
.month-name { font-size: 15px; font-weight: 750; line-height: 1.15; color: #183d67; margin-bottom: 4px; }
.month-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.month-metric { min-width: 0; padding: 0 6px; border-left: 1px solid #e1e9f4; color: #526681; font-size: 10px; font-weight: 600; }
.month-metric:first-child { border-left: 0; padding-left: 0; }
.month-metric strong { display: block; margin-top: 1px; font-size: 14px; line-height: 1.2; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.month-metric.recorded strong { color: #286044; }
.month-metric.outstanding strong { color: #76512a; }
.month-metric.projected strong { color: #204f8b; }
.week { width: var(--week-width); height: 34px; background: #fff; text-align: center; padding: 2px 4px; }
th.week { background: #f6f8fb; color: #1c416b; font-size: 12px; }
#grid .month-start { border-left: 1px solid #b8c7d9; }
#grid .current-week { box-shadow: inset 1px 0 #83a5d2, inset -1px 0 #83a5d2; }
th.current-week strong { color: #0c52af; }
.payment { width: 100%; min-height: 26px; display: flex; align-items: center; justify-content: center; position: relative; padding: 1px 12px; border: 1px solid; border-radius: 5px; white-space: nowrap; font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.payment + .payment { margin-top: 2px; }
.payment[draggable="true"] { cursor: grab; }
.planned { background: #ffedac; border-color: #d8ad39; color: #594200; }
.actual { background: #d7f1dd; border-color: #83c693; color: #1b5730; }
.late { background: #ffdbd9; border-color: #dc938e; color: #872e2b; }
#grid td:has(.payment[aria-pressed="true"]) { background: #154fa3; }
.payment[aria-pressed="true"] { color: #fff; background: #154fa3; border-color: transparent; padding-right: 17px; }
.payment[aria-pressed="true"]:focus-visible { outline-color: #ffdb78; outline-offset: 0; }
.check { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); color: #fff; font-size: 13px; font-weight: 800; }
#grid .drop-target { background: #d4e5ff; box-shadow: inset 0 0 0 2px #2265c3; }
.schedule-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; font-size: 11px; color: var(--muted); }
.notice { margin: 8px 0 0; min-height: 18px; color: #244f84; font-size: 12px; }
.notice.error { color: #902d28; font-weight: 650; }
dialog { width: min(780px, calc(100% - 30px)); max-height: 88vh; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: #17283e; box-shadow: 0 12px 50px #10284544; }
dialog::backdrop { background: #10284588; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; padding: 15px 18px; background: #f1f6ff; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 4px 0 0; font-size: 22px; }
#dialog-body { padding: 12px 18px 18px; overflow: auto; }
.dialog-note { margin: 0 0 12px; color: var(--muted); }
.act-register-list { overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.act-register-table { min-width: 560px; }
.act-register-table tbody tr { cursor: pointer; }
.act-register-table tbody tr:hover, .act-register-table tbody tr:focus-within { background: #edf4ff; }
.act-register-table :is(th, td):last-child { text-align: right; white-space: nowrap; }
.act-register-table a, .act-register-back { color: #154ca0; font-weight: 700; }
.act-register-back { display: inline-block; margin: 9px 0 12px; }
.act-card { border: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; overflow: hidden; }
.act-card summary { cursor: pointer; padding: 8px 12px; font-weight: 700; background: #f4f8ff; }
.act-paper { padding: 10px 12px; }
.act-paper h3 { margin: 3px 0; }
.act-paper p { margin: 6px 0; }
.act-total { text-align: right; font-weight: 750; }
.data-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.data-table th, .data-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.data-table th { background: #eef4fc; }
.data-table td { overflow-wrap: anywhere; }
.milestone-menu {
  position: fixed;
  inset: 0 auto auto 0;
  margin: 0;
  padding: 4px;
  border: 1px solid #cbd8e9;
  border-radius: 7px;
  color: #17283e;
  background: #fff;
  box-shadow: 0 8px 24px #1028452b;
}
.milestone-menu button { display: block; width: 100%; padding: 7px 9px; border: 0; border-radius: 4px; background: transparent; text-align: left; color: inherit; }
.milestone-menu button:hover:enabled { background: #eef5ff; }
.milestone-menu button:disabled { color: var(--muted); }
.milestone-form { display: grid; gap: 9px; }
.milestone-form label { display: grid; gap: 4px; font-weight: 650; }
.milestone-form input, .milestone-form textarea { width: 100%; border: 1px solid #cbd8e9; border-radius: 5px; padding: 7px; font: inherit; }
.milestone-form textarea { resize: vertical; }
.milestone-form button { justify-self: start; }
.form-message { color: #902d28; margin: 0; }
.form-message:empty { display: none; }
.dialog-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.dialog-actions > label { display: grid; gap: 3px; font-size: 12px; font-weight: 650; }
.dialog-actions input[type=date] { font: inherit; padding: 5px 6px; border: 1px solid #cbd8e9; border-radius: 5px; }
.act-reason { margin: 4px 12px 10px; font-size: 12px; overflow-wrap: anywhere; }
.move-form { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.move-form .dialog-note { flex-basis: 100%; margin: 0; }
@media (max-width: 900px) {
  .totals { --annual-card-width: 125px; }
  .annual-metrics > div { padding-inline: 10px; }
  :root { --details-width: 342px; --week-width: 106px; }
  main { padding: 16px 12px; }
  .top { padding: 0 15px; }
  .detail-grid { grid-template-columns: 20px minmax(0, 1fr) 35px 76px; gap: 4px; }
}
@media (max-width: 540px) {
  :root { --details-width: 228px; --week-width: 100px; }
  .heading { align-items: start; flex-direction: column; gap: 8px; }
  .demo-user { display: none; }
  .totals { --annual-card-width: 101px; }
  .annual-metrics > div { padding: 7px 8px; }
  .totals strong { font-size: 15px; }
  .detail-grid { grid-template-columns: 18px minmax(0, 1fr) 32px 60px; font-size: 9px; }
  #grid .details { padding: 0 5px; }
}

.pending { background: #ece5fa; border-color: #b9a4dc; color: #503580; }
.act-response { padding: 6px 12px 12px; border-top: 1px solid var(--line); }
.act-response > button, .act-response > details { margin-top: 8px; }
.response-totals { margin: 0; font-weight: 700; }
.milestone-form input[type="checkbox"] { width: auto; }

.schedule-editor { display: grid; gap: 10px; }
.schedule-editor .dialog-note { margin: 0; }
.schedule-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.schedule-fields label { display: grid; gap: 4px; font-size: 12px; font-weight: 650; min-width: 0; }
.schedule-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.schedule-editor input:not([type="checkbox"]), .schedule-editor textarea, .schedule-editor select {
  width: 100%; min-width: 0; border: 1px solid #cbd8e9; border-radius: 5px; padding: 5px 6px; font: inherit;
}
.schedule-editor textarea { resize: vertical; }
.schedule-editor :read-only:is(input, textarea) { background: #eef2f7; color: #455d76; }
.schedule-edit-scroll { overflow: auto; max-height: 42vh; border: 1px solid var(--line); border-radius: 5px; }
.schedule-edit-table { min-width: 650px; }
.schedule-edit-table th { position: sticky; top: 0; }
.schedule-edit-table td { padding: 3px 4px; }
.schedule-edit-table td:nth-child(1), .schedule-edit-table td:nth-child(4) { width: 56px; }
.schedule-edit-table td:nth-child(3) { width: 88px; }
.schedule-edit-table td:nth-child(5) { width: 113px; }
.schedule-edit-table td:nth-child(6) { width: 92px; }
.schedule-row-actions { white-space: nowrap; }
.schedule-row-actions .icon { min-width: 22px; min-height: 24px; padding: 1px 3px; font-size: 14px; }
.schedule-check { display: flex; align-items: center; gap: 6px; margin-block: 6px; }
.schedule-export-list { margin-bottom: 10px; }
.schedule-import-result:empty { display: none; }
.schedule-import-result > button { margin-top: 8px; }
.import-errors { color: #902d28; }

.milestone-menu button[hidden] { display: none; }
.generator-link { display: inline-flex; align-items: center; padding: 4px 10px; min-height: 31px; border: 1px solid #cbd8e9; border-radius: 6px; font-size: 12px; font-weight: 650; white-space: nowrap; color: #244567; background: #fff; text-decoration: none; }
.generator-link:hover { background: #edf4ff; }
