/* ConstructPro theme aligned with the IPPFP MIS palette. */

:root {
    --sky: #1DCED8;
    --sky-deep: #0E7C86;
    --sky-wash: #E3FBFC;
    --amber: #FF9D50;
    --amber-wash: #FFF0DF;
    --green: #55E07E;
    --green-wash: #E4FBEC;
    --cream: #FFF9D8;
    --red: #E1584F;
    --red-wash: #FCE4E2;

    --ink: #123138;
    --ink-2: #5C7A80;
    --ink-3: #5C7A80;
    --line: #E7E2C4;
    --surface: #FFFFFF;
    --canvas: #FFF9D8;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(14, 40, 48, .06), 0 8px 24px -16px rgba(14, 40, 48, .28);
    --sidebar-w: 248px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI", Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--sky-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip {
    position: absolute; top: .5rem; left: .5rem; z-index: 60;
    background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: var(--radius-sm);
}

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: linear-gradient(190deg, var(--sky-deep), #0A5960 85%);
    color: #D8F5F6;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex; align-items: center; gap: .65rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--amber);
    color: #4A2600; font-size: 1.05rem;
}
.brand-text { color: #fff; font-size: 1.08rem; letter-spacing: -.02em; font-weight: 400; }
.brand-text strong { font-weight: 700; }

.nav-list { padding: .75rem .65rem 1.5rem; flex: 1; }
.nav-group {
    margin: 1.1rem .6rem .35rem;
    font-size: .72rem;
    color: #BFEFF1;
    letter-spacing: .04em;
}
.nav-group:first-child { margin-top: .25rem; }

.nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .52rem .65rem;
    border-radius: var(--radius-sm);
    color: #D8F5F6;
    font-size: .92rem;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link i { font-size: 1rem; width: 1.15rem; text-align: center; color: #BFEFF1; }
.nav-link.is-active { background: var(--sky); color: #06373B; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.nav-link.is-active i { color: #06373B; }

.sidebar-foot { padding: .9rem 1rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.btn-signout {
    width: 100%; background: transparent; border: 1px solid rgba(255, 255, 255, .16);
    color: #D8F5F6; padding: .45rem .7rem; border-radius: var(--radius-sm); font-size: .88rem;
}
.btn-signout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.sidebar-scrim {
    position: fixed; inset: 0; background: rgba(10, 89, 96, .5); z-index: 39;
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.search { position: relative; flex: 1; max-width: 420px; }
.search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .9rem; }
.search input {
    width: 100%; padding: .45rem .7rem .45rem 2rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--canvas);
    font-size: .9rem; color: var(--ink);
}
.search input:focus { background: #fff; border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px var(--sky-wash); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn {
    position: relative; width: 36px; height: 36px; border-radius: 9px;
    display: grid; place-items: center; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-2);
}
.icon-btn:hover { background: var(--sky-wash); border-color: var(--sky); color: var(--ink); }
.icon-btn .dot {
    position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
    background: var(--amber); border-radius: 50%; border: 1.5px solid #fff;
}
.notification-count {
    position: absolute; top: -6px; right: -7px; min-width: 18px; height: 18px;
    display: grid; place-items: center; padding: 0 4px; border-radius: 999px;
    background: var(--red); color: #fff; border: 2px solid #fff;
    font-size: .62rem; font-weight: 700; line-height: 1;
}
.notification-menu {
    width: min(370px, calc(100vw - 1.5rem)); max-height: min(75vh, 520px);
    overflow-y: auto; padding: .35rem; border-color: var(--line); box-shadow: var(--shadow);
}
.notification-menu-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: .65rem .75rem; border-bottom: 1px solid var(--line); font-size: .88rem;
}
.notification-menu-head span, .notification-menu-item time { color: var(--ink-3); font-size: .72rem; }
.notification-menu-item {
    display: flex; align-items: flex-start; gap: .65rem; padding: .7rem .75rem;
    white-space: normal; border-bottom: 1px solid var(--line); color: var(--ink);
}
.notification-menu-item:hover { background: var(--sky-wash); text-decoration: none; color: var(--ink); }
.notification-menu-mark { width: 9px; height: 9px; flex: 0 0 9px; margin-top: .35rem; border-radius: 50%; background: var(--sky); }
.notification-menu-mark.warning { background: var(--amber); }
.notification-menu-mark.critical { background: var(--red); }
.notification-menu-copy { min-width: 0; display: grid; gap: .15rem; }
.notification-menu-copy strong { font-size: .82rem; }
.notification-menu-copy small { display: -webkit-box; overflow: hidden; color: var(--ink-2); font-size: .74rem; line-clamp: 2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-menu-copy time { margin-top: .1rem; }
.notification-menu-empty { display: flex; align-items: center; gap: .5rem; padding: 1.1rem .75rem; color: var(--ink-2); font-size: .82rem; }
.notification-menu-empty i { color: var(--sky-deep); }
.notification-menu-all { display: block; padding: .65rem .75rem; text-align: center; color: var(--sky-deep); font-size: .8rem; font-weight: 650; }
.who { display: flex; align-items: center; gap: .55rem; padding-left: .4rem; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sky-wash); color: var(--sky-deep);
    font-weight: 650; font-size: .8rem;
}
.who-text { display: flex; flex-direction: column; line-height: 1.15; }
.who-text strong { font-size: .86rem; font-weight: 600; }
.who-text small { font-size: .74rem; color: var(--ink-3); }

/* ---------- Page ---------- */
.page { padding: 1.4rem 1.25rem 2.5rem; flex: 1; max-width: 1400px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { color: var(--ink-3); margin: .15rem 0 0; font-size: .9rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.project-page-head {
    display: grid; grid-template-columns: minmax(0, 1fr);
    align-items: start; gap: .85rem;
}
.project-heading { min-width: 0; }
.project-heading > p:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.project-toolbar {
    min-width: 0; max-width: 100%; display: flex; flex-wrap: nowrap; align-items: center;
    justify-content: flex-start; gap: .45rem; overflow-x: auto; padding-bottom: .15rem;
}
.project-header-actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: .45rem; }
.project-header-actions .btn-x { white-space: nowrap; }
.project-status-form {
    flex: 0 0 auto; display: flex; align-items: center; gap: .4rem;
    padding: .45rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.project-status-form .form-select { width: 150px; min-width: 150px; }
.project-status-form .btn-x { white-space: nowrap; border-color: var(--line); }
.page-foot {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.25rem; border-top: 1px solid var(--line);
    color: var(--ink-3); font-size: .8rem; background: var(--surface);
}

/* ---------- Cards ---------- */
.card-x {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-x > header {
    display: flex; align-items: center; gap: .6rem;
    padding: .85rem 1.1rem; border-bottom: 1px solid var(--line);
}
.card-x > header h2 { margin: 0; font-size: .98rem; }
.card-x > header .hint { margin-left: auto; font-size: .78rem; color: var(--ink-3); }
.card-body { padding: 1.1rem; }

/* Metric tiles. The accent stripe encodes the measure, not decoration. */
.tiles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .95rem 1.05rem;
    border-top: 3px solid var(--sky);
}
.tile.is-amber { border-top-color: var(--amber); }
.tile.is-green { border-top-color: var(--green); }
.tile.is-red   { border-top-color: var(--red); }
.tile .label { font-size: .8rem; color: var(--ink-3); display: flex; align-items: center; gap: .4rem; }
.tile .value { font-size: 1.5rem; font-weight: 680; letter-spacing: -.02em; margin-top: .2rem; }
.tile .sub { font-size: .78rem; color: var(--ink-3); margin-top: .15rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.grid th {
    text-align: left; font-weight: 600; color: var(--ink-3);
    padding: .6rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap;
    font-size: .8rem;
}
table.grid td { padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: var(--sky-wash); }
table.grid tfoot td { padding: .7rem 1.1rem; font-weight: 650; background: var(--cream); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Bits ---------- */
.pill {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .18rem .55rem; border-radius: 999px;
    font-size: .76rem; font-weight: 600; border: 1px solid transparent;
}
.pill-sky   { background: var(--sky-wash);   color: var(--sky-deep); border-color: var(--sky); }
.pill-amber { background: var(--amber-wash); color: #B5601A; border-color: var(--amber); }
.pill-green { background: var(--green-wash); color: #1B7A44; border-color: var(--green); }
.pill-red   { background: var(--red-wash);   color: #B23127; border-color: var(--red); }
.pill-grey  { background: var(--surface);    color: var(--ink-2); border-color: var(--line); }

.meter { height: 6px; background: var(--sky-wash); border-radius: 999px; overflow: hidden; min-width: 90px; }
.meter span { display: block; height: 100%; background: var(--sky); border-radius: 999px; }
.meter.is-amber span { background: var(--amber); }
.meter.is-red span { background: var(--red); }
.meter.is-green span { background: var(--green); }
.meter-row { display: flex; align-items: center; gap: .55rem; }
.meter-row small { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.btn-x {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .45rem .85rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    font-size: .88rem; font-weight: 550; cursor: pointer;
}
.btn-x:hover { background: var(--canvas); text-decoration: none; }
.btn-primary-x { background: var(--sky); border-color: var(--sky); color: #06373B; font-weight: 700; }
.btn-primary-x:hover { background: #17B9C2; border-color: #17B9C2; color: #06373B; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }

.filters {
    display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: 1rem 1.1rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.1rem;
}
.filters label { font-size: .76rem; color: var(--ink-3); display: block; margin-bottom: .2rem; }
.filters select, .filters input {
    width: 100%; padding: .4rem .55rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font-size: .88rem; background: #fff; color: var(--ink);
}
.filters .filter-actions { display: flex; align-items: flex-end; gap: .45rem; }

.empty { padding: 2.25rem 1.25rem; text-align: center; color: var(--ink-3); }
.empty i { font-size: 1.6rem; color: var(--sky); display: block; margin-bottom: .5rem; }
.empty p { margin: .25rem 0 .9rem; }

/* Bars drawn from real figures; no canvas library, no decorative charts. */
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 150px; padding-top: .5rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: .3rem; }
.bars .bar .stack { display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; justify-content: flex-start; }
.bars .bar .fill { background: var(--sky); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .bar .fill.alt { background: var(--amber); }
.bars .bar .tick { text-align: center; font-size: .7rem; color: var(--ink-3); }
.legend { display: flex; gap: 1rem; font-size: .78rem; color: var(--ink-3); }
.legend i { font-size: .6rem; vertical-align: middle; }
.legend .sky { color: var(--sky); }
.legend .amber { color: var(--amber); }

.alert-row { display: flex; gap: .75rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row .mark { font-size: 1rem; line-height: 1.4; }
.alert-row .mark.at_risk { color: var(--red); }
.alert-row .mark.attention { color: var(--amber); }
.alert-row.is-forecast { box-shadow: inset 3px 0 0 var(--sky); }
.flag-kicker { font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .15rem; }
.alert-row .do { font-size: .82rem; margin-top: .35rem; color: var(--ink-2); }
.alert-row .do .do-label { display: inline-block; font-weight: 600; margin-right: .35rem; color: var(--ink); }
.alert-row .do a { margin-left: .35rem; font-weight: 600; white-space: nowrap; }
.why { font-size: .78rem; color: var(--ink-3); }
.alert-row .why { font-size: .78rem; color: var(--ink-3); }

/* ---------- Project workspace ---------- */
.workspace-tabs {
    display: flex; flex-wrap: wrap; gap: .25rem;
    margin: 0 0 1.15rem; padding: .3rem;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius);
    position: sticky; top: 3.4rem; z-index: 15;
}
.workspace-tabs a {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .48rem .9rem; border-radius: var(--radius-sm);
    color: var(--ink-2); font-weight: 600; font-size: .9rem;
}
.workspace-tabs a:hover { text-decoration: none; background: var(--sky-wash); color: var(--ink); }
.workspace-tabs a.is-active { background: var(--sky); color: #06373B; }
.workspace-tabs a.is-active:hover { background: #17B9C2; color: #06373B; }
.workspace-tabs .count {
    min-width: 1.15rem; height: 1.15rem; padding: 0 .35rem;
    border-radius: 999px; display: inline-grid; place-items: center;
    background: var(--amber); color: #4A2600; font-size: .7rem; font-weight: 700;
}
.workspace-tabs a.is-active .count { background: #fff; }

.next-steps {
    display: grid; gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.next-step {
    display: flex; flex-direction: column; gap: .2rem;
    padding: .95rem 1rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--ink); box-shadow: var(--shadow);
}
a.next-step:hover {
    text-decoration: none; border-color: var(--sky); background: var(--sky-wash);
}
.next-step i { color: var(--sky-deep); font-size: 1.15rem; }
.next-step strong { font-size: .95rem; }
.next-step span { font-size: .8rem; color: var(--ink-3); }

.do-chooser { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.do-chooser a {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .8rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--canvas);
    color: var(--ink-2); font-size: .86rem; font-weight: 600;
}
.do-chooser a:hover { text-decoration: none; border-color: var(--sky); color: var(--ink); }
.do-chooser a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.progress-method-note {
    display: flex; align-items: flex-start; gap: .6rem; padding: .75rem .9rem;
    border-left: 3px solid var(--sky-deep); background: var(--sky-wash);
    color: var(--ink-2); font-size: .84rem;
}
.progress-method-note i { color: var(--sky-deep); }
.milestone-progress-item { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.milestone-progress-item:last-child { border-bottom: 0; }
.milestone-progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.milestone-progress-head h3 { font-size: .98rem; margin: 0 0 .2rem; }
.milestone-current-progress { max-width: 460px; margin: .85rem 0 1rem; }
.milestone-current-progress .meter { flex: 1; }
.milestone-update-form { padding: .9rem; background: var(--canvas); border-radius: var(--radius-sm); }
.milestone-update-grid {
    display: grid; grid-template-columns: minmax(230px, 2fr) minmax(145px, 1fr) minmax(145px, 1fr);
    gap: .65rem .9rem; align-items: end;
}
.milestone-progress-inputs { display: grid; grid-template-columns: minmax(90px, 1fr) 82px; align-items: center; gap: .75rem; }
.milestone-progress-inputs .form-range { margin: 0; }
.milestone-update-evidence { grid-column: 1 / 3; }
.milestone-update-action { display: flex; justify-content: flex-end; }

/* ---------- Project progress capture ---------- */
.progress-overview-card {
    padding: 1.25rem 1.35rem 0;
    overflow: hidden;
    border: 1px solid #BDECEF;
    border-radius: var(--radius);
    background: linear-gradient(120deg, #F1FEFE 0%, #FFFFFF 72%);
    box-shadow: var(--shadow);
}
.progress-overview-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.progress-eyebrow { color: var(--sky-deep); font-size: .7rem; font-weight: 750; letter-spacing: .12em; }
.progress-overview-top h2 { margin: .15rem 0 .2rem; font-size: 1.2rem; }
.progress-overview-top p { margin: 0; color: var(--ink-2); font-size: .85rem; }
.progress-overview-value { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.progress-overview-value strong { color: var(--sky-deep); font-size: 2.55rem; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.progress-overview-value strong span { font-size: 1.3rem; }
.progress-overview-value small { margin-top: .3rem; color: var(--ink-2); font-size: .77rem; }
.progress-overview-meter { height: 10px; margin: 1rem 0 .9rem; overflow: hidden; border-radius: 999px; background: #D9F3F4; }
.progress-overview-meter span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sky-deep), var(--sky)); transition: width .25s ease; }
.progress-overview-stats { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(90px, .6fr) minmax(180px, 1.6fr); gap: 1rem; margin: 0 -1.35rem; padding: .8rem 1.35rem; border-top: 1px solid #D8F0F1; background: rgba(255,255,255,.72); }
.progress-overview-stats > div { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.progress-overview-stats span { color: var(--ink-2); font-size: .75rem; }
.progress-overview-stats strong { overflow: hidden; color: var(--ink); font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.progress-overview-stats strong small { color: var(--ink-2); font-size: .78rem; font-weight: 500; }
.progress-overview-stats .has-overdue { color: #B23127; }
.progress-overview-stats .progress-next-milestone small { color: var(--ink-2); font-size: .74rem; }
.milestone-plan-card > header .hint { margin-left: auto; }
.progress-section-intro { padding: .8rem 1.1rem .15rem; }
.progress-section-intro p { margin: 0; color: var(--ink-2); font-size: .84rem; }
.milestone-add { margin: .75rem 1rem 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FFFEF8; }
.milestone-add summary { display: flex; align-items: center; gap: .55rem; padding: .72rem .85rem; color: var(--sky-deep); cursor: pointer; font-size: .88rem; font-weight: 650; list-style: none; }
.milestone-add summary::-webkit-details-marker { display: none; }
.milestone-add summary::after { content: '+'; margin-left: auto; color: var(--ink-2); font-size: 1.1rem; }
.milestone-add[open] summary::after { content: '−'; }
.milestone-add summary small { color: var(--ink-2); font-size: .76rem; font-weight: 400; }
.milestone-add-body { padding: .8rem .85rem .65rem; border-top: 1px solid var(--line); }
.milestone-add-grid { display: grid; grid-template-columns: minmax(200px, 1.7fr) minmax(125px, .8fr) minmax(150px, 1fr) auto; gap: .65rem; align-items: end; }
.milestone-add-name { min-width: 0; }
.milestone-add-action { padding-bottom: 1.45rem; }
.milestone-add-action .btn-x { white-space: nowrap; }
.milestone-weight-help { grid-column: 1 / -1; margin: -.25rem 0 0; color: var(--ink-2); font-size: .75rem; }
.milestone-list { margin-top: .75rem; }
.milestone-card { padding: 1rem 1.1rem; border-top: 1px solid var(--line); }
.milestone-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .85rem; }
.milestone-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; min-width: 0; }
.milestone-card-title h3 { margin: 0; font-size: .98rem; overflow-wrap: anywhere; }
.milestone-card-title .pill { padding: .18rem .5rem; font-size: .7rem; }
.milestone-weight { flex: 0 0 auto; padding: .25rem .5rem; border-radius: 999px; background: var(--sky-wash); color: var(--sky-deep); font-size: .72rem; }
.milestone-weight strong { font-variant-numeric: tabular-nums; }
.milestone-card-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .45rem; color: var(--ink-2); font-size: .76rem; }
.milestone-card-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.milestone-card-meta i { color: var(--sky-deep); }
.milestone-card-meta .milestone-due-overdue, .milestone-card-meta .milestone-due-overdue i { color: #B23127; font-weight: 650; }
.milestone-current-progress { display: grid; grid-template-columns: 1fr; gap: .35rem; margin: .8rem 0; }
.milestone-current-progress-label { display: flex; justify-content: space-between; color: var(--ink-2); font-size: .75rem; }
.milestone-current-progress-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.milestone-card .meter { height: 7px; }
.milestone-update-form { padding: .85rem; border: 1px solid #E9E8D8; border-radius: var(--radius-sm); background: #FAFAF4; }
.milestone-update-grid { display: grid; grid-template-columns: minmax(220px, 1.25fr) minmax(160px, .85fr) minmax(125px, auto); gap: .55rem .8rem; align-items: end; }
.milestone-update-grid .form-label { margin-bottom: .3rem; font-size: .76rem; font-weight: 650; }
.milestone-progress-inputs { display: grid; grid-template-columns: minmax(65px, 1fr) 96px; align-items: center; gap: .6rem; }
.milestone-progress-inputs .input-group { flex-wrap: nowrap; }
.milestone-update-evidence { grid-column: 1 / 3; }
.milestone-update-evidence textarea { min-height: 58px; resize: vertical; }
.milestone-update-action { display: flex; justify-content: flex-end; }
.milestone-update-action .btn-x { white-space: nowrap; }
.progress-empty { display: grid; justify-items: center; padding: 2rem 1.5rem 2.2rem; text-align: center; }
.progress-empty-icon { display: grid; width: 44px; height: 44px; margin-bottom: .65rem; place-items: center; border-radius: 50%; background: var(--sky-wash); color: var(--sky-deep); font-size: 1.15rem; }
.progress-empty h3 { margin: 0 0 .35rem; font-size: .98rem; }
.progress-empty p { max-width: 440px; margin: 0; color: var(--ink-2); font-size: .83rem; }
.progress-empty-compact { padding: 1.5rem 1rem; }
.site-update-help { margin: 0 0 1rem; font-size: .82rem; }
.site-update-submit-row { display: grid; grid-template-columns: minmax(145px, 1fr) auto; align-items: end; gap: .75rem; }
.site-update-submit-row .btn-x { min-height: 42px; white-space: nowrap; }
.site-history-card > header .hint { margin-left: auto; }
.progress-timeline { padding: .15rem 1rem .25rem 1.2rem; }
.progress-timeline-item { position: relative; margin-left: .35rem; padding: .85rem .2rem .85rem 1rem; border-left: 1px solid #CFEAEC; }
.progress-timeline-item:last-child { border-left-color: transparent; }
.progress-timeline-dot { position: absolute; top: 1.08rem; left: -5px; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--sky-deep); box-shadow: 0 0 0 1px #CFEAEC; }
.progress-timeline-meta { display: flex; justify-content: space-between; gap: .6rem; color: var(--ink-2); font-size: .73rem; }
.progress-timeline-meta strong { color: var(--ink); font-size: .77rem; }
.progress-timeline-item p { margin: .35rem 0; font-size: .84rem; overflow-wrap: anywhere; }
.progress-timeline-meta time { flex: 0 0 auto; }
.progress-timeline-context { display: flex; flex-wrap: wrap; gap: .35rem; }
.progress-timeline-milestone { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .45rem; border-radius: 999px; background: #FFF0DF; color: #8B4A15; font-size: .7rem; }
.progress-timeline-progress { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .45rem; border-radius: 999px; background: var(--sky-wash); color: var(--sky-deep); font-size: .7rem; }

.card-x > header a.hint { margin-left: auto; font-size: .78rem; color: var(--sky-deep); font-weight: 600; }

.pager { display: flex; gap: .35rem; align-items: center; justify-content: center; padding: .9rem; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 34px; text-align: center; padding: .3rem .55rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .85rem; color: var(--ink-2);
}
.pager .current { background: var(--sky); border-color: var(--sky); color: #06373B; font-weight: 650; }

/* ---------- Flash ---------- */
.flash-stack { position: fixed; top: 1rem; right: 1rem; z-index: 70; display: grid; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.flash {
    display: flex; align-items: flex-start; gap: .55rem;
    padding: .7rem .8rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    font-size: .88rem;
}
.flash i { margin-top: .12rem; }
.flash-success { border-left: 3px solid var(--green); }
.flash-success > i { color: #1B7A44; }
.flash-error { border-left: 3px solid var(--red); }
.flash-error > i { color: var(--red); }
.flash-warning { border-left: 3px solid var(--amber); }
.flash-warning > i { color: #B5601A; }
.flash-info { border-left: 3px solid var(--sky); }
.flash-info > i { color: var(--sky-deep); }
.flash-close { margin-left: auto; border: 0; background: none; color: var(--ink-3); padding: 0 .1rem; }

/* ---------- Sign-in ---------- */
body.plain { background: var(--canvas); display: grid; place-items: center; padding: 1.5rem; min-height: 100vh; }
.auth-card {
    width: min(420px, 100%);
    background: var(--surface); border-radius: 14px; padding: 1.9rem 1.75rem;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .65);
}
.auth-card .brand { border: 0; padding: 0 0 1.2rem; }
.auth-card .brand-text { color: var(--ink); }
.auth-card h1 { font-size: 1.28rem; margin-bottom: .2rem; }
.auth-card .lede { color: var(--ink-3); font-size: .9rem; margin-bottom: 1.3rem; }
.field { margin-bottom: .95rem; }
.field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: .3rem; }
.field input {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font-size: .95rem; background: #fff; color: var(--ink);
}
.password-field { position: relative; }
.field .password-field input { padding-right: 2.75rem; }
.password-toggle {
    position: absolute; top: 50%; right: .45rem; transform: translateY(-50%);
    width: 2rem; height: 2rem; display: grid; place-items: center;
    border: 0; border-radius: 4px; background: transparent; color: var(--ink-2);
}
.password-toggle:hover { background: var(--sky-wash); color: var(--ink); }
.password-toggle:focus-visible { outline: 2px solid var(--sky-deep); outline-offset: 1px; }
.field input:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px var(--sky-wash); }
.field .err { color: #B23127; font-size: .8rem; margin-top: .25rem; display: block; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.btn-block { width: 100%; justify-content: center; padding: .62rem 1rem; font-size: .95rem; }
.auth-foot { margin-top: 1.1rem; display: flex; justify-content: space-between; font-size: .84rem; }
.auth-note { color: var(--ink-3); font-size: .8rem; text-align: center; margin-top: 1.1rem; }

/* ---------- Error page ---------- */
.error-card { width: min(520px, 100%); background: var(--surface); border-radius: 14px; padding: 2rem; text-align: center; }
.error-card .code { font-size: 3rem; font-weight: 700; color: var(--sky); line-height: 1; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .page-foot, .filters, .actions, .flash-stack { display: none !important; }
    body { background: #fff; }
    .card-x { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    .page { padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 40;
        transform: translateX(-100%); transition: transform .18s ease-out;
    }
    .sidebar.is-open { transform: translateX(0); }
    .who-text { display: none; }
    .page { padding: 1.1rem .9rem 2rem; }
    .project-page-head { grid-template-columns: minmax(0, 1fr); }
    .project-toolbar { justify-items: start; width: 100%; }
    .project-header-actions { justify-content: flex-start; }
    .project-status-form { justify-self: start; }
}

@media (max-width: 767.98px) {
    .progress-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .progress-next-milestone { grid-column: 1 / -1; }
    .milestone-add-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .milestone-add-name, .milestone-add-action, .milestone-weight-help { grid-column: 1 / -1; }
    .milestone-add-action { padding-bottom: 0; }
    .milestone-add-action .btn-x { width: 100%; justify-content: center; }
    .milestone-update-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .milestone-update-evidence { grid-column: 1 / -1; }
    .milestone-update-action { grid-column: 1 / -1; }
    .milestone-update-action .btn-x { width: 100%; justify-content: center; }
}

@media (max-width: 575.98px) {
    body { font-size: 14px; }
    .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
    .tile .value { font-size: 1.25rem; }
    .search { max-width: none; }
    .project-header-actions { display: flex; width: max-content; }
    .project-header-actions .btn-x { justify-content: flex-start; white-space: nowrap; min-height: 42px; }
    .project-toolbar { overflow-x: auto; }
    .project-status-form { width: auto; }
    .project-status-form .btn-x { justify-content: center; }
    table.grid th, table.grid td { padding: .55rem .7rem; }
    .progress-overview-card { padding: 1rem 1rem 0; }
    .progress-overview-top { align-items: flex-start; }
    .progress-overview-top p { max-width: 34ch; }
    .progress-overview-value strong { font-size: 2rem; }
    .progress-overview-stats { margin-right: -1rem; margin-left: -1rem; padding-right: 1rem; padding-left: 1rem; }
    .milestone-add-grid { grid-template-columns: 1fr; }
    .milestone-add-name, .milestone-add-action, .milestone-weight-help { grid-column: auto; }
    .milestone-card { padding: .85rem .75rem; }
    .milestone-update-grid { grid-template-columns: 1fr; }
    .milestone-update-evidence, .milestone-update-action { grid-column: auto; }
    .site-update-submit-row { grid-template-columns: 1fr; }
    .milestone-update-action .btn-x { width: 100%; justify-content: center; }
    .flash-stack { left: 1rem; right: 1rem; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Menu items belonging to a phase that has not shipped yet. Shown, but never
   clickable, so the navigation contains no dead links. */
.nav-link.is-soon { color: #BFEFF1; cursor: default; }
.nav-link.is-soon:hover { background: transparent; color: #BFEFF1; }
.nav-link.is-soon i { color: #BFEFF1; }
.nav-soon {
    margin-left: auto; font-size: .65rem; letter-spacing: .03em;
    color: #BFEFF1; border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px; padding: 0 .4rem;
}

/* Footer credit link, matched to the theme rather than default blue. */
.page-foot a { color: var(--sky-deep); font-weight: 600; }
.page-foot a:hover { color: var(--sky); }

/* ---------- Project setup wizard ---------- */
.setup-body { background: var(--canvas); min-height: 100vh; display: flex; flex-direction: column; }
.setup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem; background: var(--ink); color: #fff;
}
.setup-header .brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.setup-header .brand:hover { text-decoration: none; }
.setup-header .btn-ghost { color: #C9DCE1; border-color: rgba(255,255,255,.18); }
.setup-header .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.setup-progress { background: var(--surface); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem .25rem; }
.setup-progress-inner { max-width: 880px; margin: 0 auto; }
.setup-project-name { font-size: .82rem; color: var(--ink-3); margin: 0 0 .7rem; text-align: center; }

.stepper { list-style: none; display: flex; margin: 0 0 .9rem; padding: 0; gap: .25rem; }
.stepper li { flex: 1; text-align: center; position: relative; }
.stepper li:not(:last-child)::after {
    content: ""; position: absolute; top: 17px; left: 50%; width: 100%; height: 2px;
    background: var(--line); z-index: 0;
}
.stepper li.is-done:not(:last-child)::after { background: var(--sky); }
.stepper a { display: flex; flex-direction: column; align-items: center; gap: .3rem; position: relative; z-index: 1; }
.stepper a:hover { text-decoration: none; }
.stepper-dot {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 2px solid var(--line); color: var(--ink-3); font-size: .95rem;
}
.stepper li.is-done .stepper-dot { background: var(--sky); border-color: var(--sky); color: #06232A; }
.stepper li.is-current .stepper-dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepper-label { font-size: .74rem; color: var(--ink-3); }
.stepper li.is-current .stepper-label { color: var(--ink); font-weight: 650; }
.stepper li.is-done .stepper-label { color: var(--ink-2); }

.setup-main { flex: 1; max-width: 760px; width: 100%; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; }
.setup-foot {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.25rem; border-top: 1px solid var(--line);
    color: var(--ink-3); font-size: .8rem; background: var(--surface);
}
.setup-foot a { color: var(--sky-deep); font-weight: 600; }

.step-head { text-align: center; margin-bottom: 1.4rem; }
.step-head h1 { font-size: 1.3rem; margin-bottom: .3rem; }
.step-head p { color: var(--ink-3); font-size: .92rem; margin: 0; }

.step-actions {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
}

.added-list { list-style: none; padding: 0; margin: 0 0 1.1rem; }
.added-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); margin-bottom: .45rem; font-size: .9rem;
}
.added-list .why { font-size: .78rem; color: var(--ink-3); }

@media (max-width: 575.98px) {
    .stepper-label { display: none; }
    .setup-main { padding: 1.1rem .9rem 2rem; }
}
