/* Parot client portal
   Grayscale shell inherited from the marketing site; colour appears only where
   it encodes status, so a hue always means something. */

:root {
    --ink: #131313;
    --panel: #1e1e1e;
    --raised: #2a2a2a;
    --line: #383838;
    --line-soft: #2e2e2e;
    --chalk: #f2efe9;
    --muted: #8f8b85;
    --muted-dim: #6a6660;

    --live: #d4a24c;   /* in progress */
    --done: #6f9e7a;   /* delivered / approved */
    --wait: #6b7f96;   /* queued, waiting on approval */
    --late: #b5654f;   /* past due */

    --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
    --body: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --gap: 1.25rem;
    --radius: 10px;
    --shell: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

/* Author `display` beats the UA rule for [hidden], so anything given a display
   value would ignore the attribute. Restate it once, with weight. */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--chalk);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-dim);
    margin: 0 0 0.6rem;
}

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ---------- top bar ---------- */

.topbar {
    border-bottom: 1px solid var(--line-soft);
    background: rgba(19, 19, 19, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar img { height: 30px; display: block; }
.topbar-spacer { flex: 1; }

.topbar-who {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.topbar-link {
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    padding: 0.3rem 0;
    border-bottom: 1px solid transparent;
}
.topbar-link:hover { color: var(--chalk); border-bottom-color: var(--line); }

/* ---------- messages ---------- */

.flash-stack { max-width: var(--shell); margin: 1.25rem auto 0; padding: 0 1.5rem; }

.flash {
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: var(--radius);
    background: var(--panel);
    padding: 0.7rem 1rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}
.flash-success { border-left-color: var(--done); }
.flash-error { border-left-color: var(--late); }
.flash-info, .flash-warning { border-left-color: var(--wait); }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--body);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.7rem 1.15rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--raised);
    color: var(--chalk);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.btn:hover { background: #333; border-color: #4a4a4a; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--chalk); color: #16130f; border-color: var(--chalk); }
.btn-primary:hover { background: #fff; border-color: #fff; }

.btn-go { background: var(--done); border-color: var(--done); color: #0f1a12; }
.btn-go:hover { background: #7fae8a; border-color: #7fae8a; }

.btn-danger { background: transparent; border-color: #5a3730; color: #d08c78; }
.btn-danger:hover { background: #2a1a16; border-color: var(--late); color: #e8a48e; }

.btn-ghost { background: transparent; }
.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.8rem; }

/* ---------- forms ---------- */

.field { margin-bottom: 1.1rem; }

.field > label,
.form-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.45rem;
}

.form-control,
.form-select {
    width: 100%;
    background: #171717;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--chalk);
    font-family: var(--body);
    font-size: 0.95rem;
    padding: 0.65rem 0.8rem;
    transition: border-color 0.16s ease, background 0.16s ease;
}
.form-control::placeholder { color: var(--muted-dim); }
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--live);
    background: #1b1b1b;
}
.form-select { appearance: none; padding-right: 2.2rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 1rem top 55%, right 0.72rem top 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
textarea.form-control { resize: vertical; min-height: 5rem; line-height: 1.5; }

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: #171717;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}
.form-check-input {
    appearance: none;
    width: 18px; height: 18px;
    margin: 0.1rem 0 0;
    flex: none;
    border: 1px solid #4d4d4d;
    border-radius: 4px;
    background: #101010;
    cursor: pointer;
}
.form-check-input:checked {
    background: var(--done);
    border-color: var(--done);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%230f1a12' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
    background-size: 100%;
}
.form-check label { font-size: 0.9rem; cursor: pointer; margin: 0; }

.help { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.errors { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.82rem; color: #d99b86; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--gap); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.4rem; }

:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }

/* ---------- panels ---------- */

.panel {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.panel-head h2 { font-size: 1.15rem; }

.empty {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 2.25rem 1.5rem;
    text-align: center;
    color: var(--muted);
}
.empty p { margin: 0 0 1rem; }

/* ---------- status pills ---------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-active { color: var(--live); border-color: #4d3d22; background: #241d10; }
.pill-done { color: var(--done); border-color: #2c4433; background: #16211a; }
.pill-waiting { color: var(--wait); border-color: #2f3b46; background: #161c21; }
.pill-idle { color: var(--muted); }
.pill-late { color: var(--late); border-color: #4a2c23; background: #241511; }

/* ---------- hero + the build rail (signature) ---------- */

.hero-block { padding: 3rem 0 2.25rem; }
.hero-block h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.02; }
.hero-sub { color: var(--muted); margin: 0.6rem 0 0; font-size: 1rem; }

.rail-wrap { margin-top: 2.5rem; }

.rail-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}
.rail-figure {
    font-family: var(--mono);
    font-size: clamp(2.6rem, 8vw, 4.2rem);
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.04em;
}
.rail-figure span { font-size: 0.4em; color: var(--muted); margin-left: 0.1em; }
.rail-caption { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-align: right; }

.rail {
    display: flex;
    gap: 3px;
    height: 46px;
}

.rail-seg {
    flex-grow: var(--w, 1);
    flex-basis: 0;
    min-width: 8px;
    position: relative;
    background: #232323;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease;
}
.rail-seg:hover { border-color: #4f4f4f; transform: translateY(-2px); }

.rail-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--fill, 0%);
    background: var(--seg, var(--wait));
    opacity: 0.85;
    transform-origin: left center;
    animation: rail-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--delay, 0s);
}
@keyframes rail-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.rail-seg[data-tone='done'] { --seg: var(--done); }
.rail-seg[data-tone='active'] { --seg: var(--live); }
.rail-seg[data-tone='waiting'] { --seg: var(--wait); }
.rail-seg[data-tone='idle'] { --seg: #3d3d3d; }

.rail-legend {
    display: flex;
    gap: 3px;
    margin-top: 0.6rem;
}
.rail-legend div {
    flex-grow: var(--w, 1);
    flex-basis: 0;
    min-width: 8px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    overflow: hidden;
}
.rail-legend strong {
    display: block;
    color: var(--chalk);
    font-weight: 500;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* ---------- gantt ---------- */

.gantt-section { margin-top: 3.25rem; }

.gantt-frame {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 0.5rem;
    overflow-x: auto;
}

.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle button {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    color: var(--muted);
    border: 0;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
}
.view-toggle button + button { border-left: 1px solid var(--line); }
.view-toggle button:hover { color: var(--chalk); }
.view-toggle button[aria-pressed='true'] { background: var(--raised); color: var(--chalk); }

/* frappe-gantt is built for light backgrounds; re-skin it here. */
.gantt .grid-background { fill: transparent; }
.gantt .grid-row { fill: transparent; }
.gantt .grid-row:nth-child(even) { fill: #202020; }
.gantt .row-line { stroke: #2a2a2a; }
.gantt .tick { stroke: #2f2f2f; }
.gantt .tick.thick { stroke: #3c3c3c; }
.gantt .today-highlight { fill: #d4a24c; opacity: 0.10; }
.gantt text { fill: #8f8b85; font-family: var(--mono); font-size: 11px; }
.gantt .upper-text, .gantt .lower-text { fill: #8f8b85; }
.gantt .bar { fill: #2f2f2f; stroke: #414141; }
.gantt .bar-label { fill: #f2efe9; font-family: var(--body); font-size: 12px; }
.gantt .bar-label.big { fill: #8f8b85; }
.gantt .bar-wrapper:hover .bar { fill: #383838; }
.gantt .bar-progress { fill: var(--wait); }
.gantt .bar-wrapper.bar-done .bar-progress { fill: var(--done); }
.gantt .bar-wrapper.bar-active .bar-progress { fill: var(--live); }
.gantt .bar-wrapper.bar-waiting .bar-progress { fill: var(--wait); }
.gantt .bar-wrapper.bar-idle .bar-progress { fill: #4a4a4a; }
.gantt .handle { display: none; }
.gantt .bar-item .bar { fill: #262626; stroke: #363636; }
.gantt .bar-item .bar-label { fill: #a9a49d; font-size: 11px; }
.gantt .bar-item.bar-open .bar-progress { fill: #3d3d3d; }
.gantt .bar-item.bar-done .bar-progress { fill: var(--done); }

/* ---------- phase detail ---------- */

.phase-list { margin-top: 3.25rem; display: grid; gap: 1rem; }

.phase {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
    scroll-margin-top: 5rem;
}
.phase.is-target { border-color: var(--live); }

.phase-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.phase-index {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted-dim);
    padding-top: 0.3rem;
}
.phase-title { flex: 1; min-width: 12rem; }
.phase-title h3 { font-size: 1.3rem; }
.phase-dates { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.phase-dates .late { color: var(--late); }

.phase-figure { font-family: var(--mono); font-size: 1.5rem; text-align: right; }
.phase-figure small { display: block; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.08em; }

.meter { height: 5px; border-radius: 3px; background: #262626; overflow: hidden; margin: 1.1rem 0 0; }
.meter i { display: block; height: 100%; background: var(--tone, var(--wait)); }
.meter[data-tone='done'] { --tone: var(--done); }
.meter[data-tone='active'] { --tone: var(--live); }
.meter[data-tone='waiting'] { --tone: var(--wait); }
.meter[data-tone='idle'] { --tone: #3d3d3d; }

.phase-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2rem; margin-top: 1.5rem; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.checklist li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.92rem; }
.check {
    flex: none;
    width: 17px; height: 17px;
    border-radius: 4px;
    border: 1px solid #454545;
    margin-top: 0.2rem;
    display: grid;
    place-items: center;
    font-size: 11px;
    color: transparent;
}
.checklist li.done .check { background: var(--done); border-color: var(--done); color: #0f1a12; }
.checklist li.done .check::after { content: '✓'; }
.checklist li.done span { color: var(--muted); }
.checklist .when { font-family: var(--mono); font-size: 0.7rem; color: var(--muted-dim); display: block; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.feed li { border-left: 2px solid var(--line); padding-left: 0.9rem; }
.feed li.completing { border-left-color: var(--done); }
.feed .feed-meta { font-family: var(--mono); font-size: 0.7rem; color: var(--muted-dim); }
.feed h4 { font-family: var(--body); font-size: 0.95rem; font-weight: 600; margin: 0.2rem 0 0.25rem; }
.feed p { margin: 0; font-size: 0.9rem; color: var(--muted); white-space: pre-line; }
.feed .tag { display: inline-block; font-family: var(--mono); font-size: 0.68rem; color: var(--done); margin-top: 0.4rem; }

/* ---------- auth ---------- */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card {
    width: 100%;
    max-width: 27rem;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 2.25rem;
}
.auth-card img { height: 54px; margin-bottom: 1.75rem; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.auth-card > p { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.75rem; }
.auth-foot { margin-top: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.auth-foot a { color: var(--chalk); }

.code-input {
    font-family: var(--mono) !important;
    font-size: 1.9rem !important;
    letter-spacing: 0.5em;
    text-align: center;
    padding: 0.8rem 0.4rem 0.8rem 0.9rem !important;
}

/* ---------- manage ---------- */

.manage-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2.25rem; padding: 2rem 0 4rem; }

.side-nav { display: grid; gap: 0.15rem; align-content: start; position: sticky; top: 5rem; }
.side-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
    border-radius: 7px;
    border-left: 2px solid transparent;
}
.side-nav a:hover { background: var(--panel); color: var(--chalk); }
.side-nav a.active { background: var(--panel); color: var(--chalk); border-left-color: var(--live); }
.side-nav .count {
    font-family: var(--mono);
    font-size: 0.7rem;
    background: var(--live);
    color: #16130f;
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
}
.side-nav hr { border: 0; border-top: 1px solid var(--line-soft); margin: 0.75rem 0.75rem; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head h1 { font-size: 1.75rem; }
.page-head p { color: var(--muted); margin: 0.35rem 0 0; font-size: 0.92rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.85rem; margin-bottom: 1.75rem; }
.stat {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    display: block;
}
a.stat:hover { border-color: #4a4a4a; }
.stat b { display: block; font-family: var(--mono); font-size: 1.9rem; font-weight: 500; line-height: 1.1; }
.stat span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat.flag b { color: var(--live); }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
    text-align: left;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-dim);
    font-weight: 400;
    padding: 0 0.75rem 0.6rem;
    border-bottom: 1px solid var(--line-soft);
}
.table td { padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.right, .table th.right { text-align: right; }
.table .sub { display: block; font-size: 0.78rem; color: var(--muted); }

.queue-item {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--live);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    margin-bottom: 0.85rem;
}
.queue-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.queue-item h3 { font-size: 1.05rem; margin: 0.6rem 0 0.35rem; }
.queue-item .body { color: var(--muted); font-size: 0.9rem; white-space: pre-line; margin: 0; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-top: 1.1rem; }
.queue-actions form { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; }
.queue-actions .form-control { min-width: 14rem; }

.filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.filter-row a {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.32rem 0.75rem;
}
.filter-row a:hover { color: var(--chalk); border-color: #4a4a4a; }
.filter-row a.active { background: var(--raised); color: var(--chalk); border-color: #4a4a4a; }

.inline-form { display: flex; gap: 0.6rem; align-items: flex-start; flex-wrap: wrap; }
.inline-form .form-control { flex: 1; min-width: 12rem; }

.deliverable-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line-soft);
}
.deliverable-row:last-of-type { border-bottom: 0; }
.deliverable-row .grow { flex: 1; min-width: 0; }
.deliverable-row form { display: inline; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .manage-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .side-nav { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 0.5rem; }
    .side-nav hr { display: none; }
    .phase-body { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .rail { height: 34px; }
    .rail-legend strong { font-size: 0.66rem; }
    .hero-block { padding: 2rem 0 1.5rem; }
    .auth-card { padding: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- review queue: target + completion control ---------- */

.queue-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.queue-target {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 1.5rem;
    flex: 1;
    min-width: 17rem;
}
.queue-target .target-cell + .target-cell {
    border-left: 1px solid var(--line);
    padding-left: 1.5rem;
}

.target-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-dim);
    margin-bottom: 0.3rem;
}
.target-cell strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}
.target-cell.is-empty strong { color: var(--muted); font-weight: 500; }
.target-sub {
    display: block;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--muted);
    margin-top: 0.2rem;
}
.target-num {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted-dim);
    margin-right: 0.45rem;
}

.queue-stamp {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.7rem;
    color: var(--muted);
}

.completion-box {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: #171717;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-top: 1.25rem;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease;
}
.completion-box:hover { border-color: #4a4a4a; }
.completion-box:has(input:checked) { border-color: #2c4433; background: #16211a; }
.completion-box.is-disabled { cursor: default; opacity: 0.55; }
.completion-box.is-disabled:hover { border-color: var(--line); }

.completion-box .form-check-input { margin-top: 0.12rem; }

.completion-copy { font-size: 0.9rem; line-height: 1.45; }
.completion-copy strong { font-weight: 600; }
.completion-impact {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.queue-deny {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line-soft);
}
.queue-deny .form-control { flex: 1; min-width: 12rem; font-size: 0.85rem; padding: 0.45rem 0.7rem; }

/* ---------- deliverable reordering ---------- */

.move-group { display: flex; flex-direction: column; gap: 2px; flex: none; width: 1.6rem; }

.move-btn {
    display: block;
    width: 100%;
    padding: 0.1rem 0;
    font-size: 0.7rem;
    line-height: 1.2;
    color: var(--muted);
    background: #212121;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    cursor: pointer;
}
.move-btn:hover:not(:disabled) { background: var(--raised); color: var(--chalk); border-color: #4a4a4a; }
.move-btn:disabled { opacity: 0.28; cursor: default; }

.move-fixed {
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-dim);
    text-align: center;
    line-height: 1.2;
}

.locked-note { border-left: 3px solid var(--live); }
.locked-note h2 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.locked-note p { color: var(--muted); font-size: 0.92rem; margin: 0 0 0.7rem; }
.locked-note p:last-child { margin-bottom: 0; }

/* ---------- gantt interaction ---------- */

.gantt-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gantt-hint { margin: -0.4rem 0 0.9rem; }

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 1px solid var(--line);
}
.link-btn:hover { color: var(--chalk); border-bottom-color: var(--muted); }

.gantt .bar-wrapper { cursor: pointer; }

/* frappe's popup, re-skinned rather than hidden -- it carries the detail that
   makes hovering worthwhile. */
.gantt-container .popup-wrapper {
    background: #0f0f0f;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: var(--chalk);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    max-width: 22rem;
}
.gantt-container .popup-wrapper .pointer { display: none; }
.gantt-pop b { display: block; font-size: 0.88rem; margin-bottom: 0.2rem; }
.gantt-pop span { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }

/* target highlight, shared by phase cards and deliverable rows */
.checklist li.is-target {
    background: #241d10;
    border-radius: 6px;
    margin: -0.25rem -0.5rem;
    padding: 0.25rem 0.5rem;
}

/* ---------- client sign-off ---------- */

.signoff {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 3.25rem;
    padding: 1.6rem 1.75rem;
    background: linear-gradient(100deg, #241d10, #1c1a15);
    border: 1px solid #4d3d22;
    border-radius: var(--radius);
}
.signoff-copy { flex: 1; min-width: 18rem; }
.signoff-copy h2 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.signoff-copy p { color: #cbc3b4; font-size: 0.94rem; margin: 0 0 0.7rem; }
.signoff-copy .eyebrow { color: var(--live); }
.signoff-note { font-size: 0.72rem; text-align: right; max-width: 11rem; }

.jump-link {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.jump-link:hover { color: var(--chalk); border-bottom-color: var(--muted); }
.signoff-link { color: var(--live); border-bottom-color: #4d3d22; }
.signoff-link:hover { color: #e8bd72; }

.signed {
    font-size: 0.72rem;
    color: var(--done);
    margin: 0.85rem 0 0;
}

.phase.is-target { border-color: var(--live); }

/* ---------- chronological feed ---------- */

.feed-section { margin-top: 3.25rem; }

.stream { list-style: none; margin: 0; padding: 0; }
.stream li {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.15rem 0;
    border-top: 1px solid var(--line-soft);
}
.stream li:last-child { border-bottom: 1px solid var(--line-soft); }

.stream-when {
    font-size: 0.75rem;
    color: var(--chalk);
    padding-top: 0.15rem;
    text-align: right;
}
.stream-when span { display: block; font-size: 0.65rem; color: var(--muted-dim); }

.stream-body h4 {
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 600;
    margin: 0.35rem 0 0.3rem;
}
.stream-body p { margin: 0; font-size: 0.92rem; color: var(--muted); white-space: pre-line; }
.stream-tag { display: inline-block; }
.stream li.completing .stream-when { color: var(--done); }

@media (max-width: 640px) {
    .stream li { grid-template-columns: 1fr; gap: 0.35rem; }
    .stream-when { text-align: left; }
    .stream-when span { display: inline; margin-left: 0.3rem; }
    .signoff { padding: 1.25rem; }
}

/* ==========================================================================
   Client portal: paged layout
   ========================================================================== */

.head-stack { position: sticky; top: 0; z-index: 30; }
.topbar { position: static; }

/* ---------- sign-off alert: follows them across every page ---------- */

.alert-bar {
    background: linear-gradient(96deg, #d9a950, #c68f2b);
    color: #17130b;
    border-bottom: 1px solid #8f671a;
}

.alert-inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.alert-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #17130b;
    box-shadow: 0 0 0 0 rgba(23, 19, 11, 0.55);
    animation: alert-pulse 1.9s ease-out infinite;
}
@keyframes alert-pulse {
    70% { box-shadow: 0 0 0 9px rgba(23, 19, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(23, 19, 11, 0); }
}

.alert-copy { flex: 1; min-width: 0; line-height: 1.35; }
.alert-copy strong { display: block; font-size: 0.95rem; font-weight: 700; }
.alert-copy span { font-size: 0.82rem; opacity: 0.82; }

.alert-action {
    flex: none;
    background: #17130b;
    border-color: #17130b;
    color: #f5e6c8;
}
.alert-action:hover { background: #000; border-color: #000; color: #fff; }

/* ---------- client sub-nav ---------- */

.client-nav {
    background: rgba(19, 19, 19, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}
.client-nav-inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.client-nav a {
    display: block;
    padding: 0.8rem 0;
    font-size: 0.88rem;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.client-nav a:hover { color: var(--chalk); }
.client-nav a.active { color: var(--chalk); border-bottom-color: var(--live); }
.client-nav-spacer { flex: 1; }
.client-nav-project { font-size: 0.72rem; color: var(--muted-dim); }

/* ---------- phase cards ---------- */

.phase-grid-section { margin-top: 3rem; }
.phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.85rem; }

.phase-card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.16s ease, transform 0.16s ease;
}
.phase-card:hover { border-color: #4a4a4a; transform: translateY(-2px); }
.phase-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.phase-card h3 { font-size: 1.05rem; margin-bottom: 0.9rem; line-height: 1.25; }
.phase-card .meter { margin: 0; }
.phase-card-foot { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin-top: 0.55rem; }
.phase-card-note { font-size: 0.68rem; color: var(--muted-dim); margin-top: 0.35rem; }
.phase-card-note.late { color: var(--late); }

/* ---------- detail pages ---------- */

.crumbs { padding: 1.75rem 0 0; font-size: 0.72rem; color: var(--muted-dim); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--chalk); }
.crumbs span { margin: 0 0.4rem; }

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.9rem 0 1.4rem;
}
.detail-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.05; }
.detail-dates { font-size: 0.78rem; color: var(--muted); margin: 0.5rem 0 0; }
.detail-dates .late { color: var(--late); }
.detail-figure { text-align: right; display: grid; gap: 0.4rem; justify-items: end; }
.detail-figure b { font-size: 1.8rem; font-weight: 500; }
.detail-figure small { font-size: 0.7rem; color: var(--muted); }
.detail-blurb { color: var(--muted); font-size: 0.95rem; margin: 1.2rem 0 0; max-width: 46rem; }

.detail-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.5rem; margin-top: 2.5rem; }

.deliverable-links { list-style: none; margin: 0; padding: 0; }
.deliverable-links a {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.6rem;
    margin: 0 -0.6rem;
    border-radius: 7px;
    text-decoration: none;
    color: inherit;
    font-size: 0.92rem;
}
.deliverable-links a:hover { background: var(--panel); }
.deliverable-links a.done .check { background: var(--done); border-color: var(--done); color: #0f1a12; }
.deliverable-links a.done .check::after { content: '✓'; }
.deliverable-links a.done .deliverable-name { color: var(--muted); }
.deliverable-name { flex: 1; }
.deliverable-name .when { display: block; font-family: var(--mono); font-size: 0.68rem; color: var(--muted-dim); margin-top: 0.15rem; }
.deliverable-links .chev { color: var(--muted-dim); }

.delivered-note {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    flex-wrap: wrap;
    background: #16211a;
    border: 1px solid #2c4433;
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin-top: 1.5rem;
    font-size: 0.92rem;
}
.delivered-note strong { color: var(--done); font-weight: 600; }
.delivered-note span { font-size: 0.7rem; color: var(--muted); }

.detail-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 3rem 0 4rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line-soft);
    font-size: 0.88rem;
}
.detail-nav a { color: var(--muted); text-decoration: none; }
.detail-nav a:hover { color: var(--chalk); }

.portal-foot { padding: 3rem 0; color: var(--muted-dim); font-size: 0.82rem; }
.portal-foot a { color: var(--muted); }

/* ---------- gantt: finish the dark treatment ---------- */

.gantt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.gantt-key { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 0.9rem; font-size: 0.68rem; color: var(--muted); }
.gantt-key span { display: inline-flex; align-items: center; gap: 0.4rem; }
.key-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.gantt-container { background: transparent; }
/* frappe ships a light theme; every painted surface needs restating or the
   calendar strip stays white against the dark page. */
.gantt .grid-header { fill: #171717; stroke: #2f2f2f; }
.gantt .grid-background { fill: none; }
.gantt .grid-row { fill: #1b1b1b; }
.gantt .grid-row:nth-child(even) { fill: #1f1f1f; }
.gantt .row-line { stroke: #272727; }
.gantt .tick { stroke: #2d2d2d; }
.gantt .tick.thick { stroke: #3c3c3c; }
.gantt .today-highlight { fill: #d4a24c; opacity: 0.09; }
.gantt .lower-text, .gantt .upper-text { fill: #8f8b85; font-family: var(--mono); }
.gantt .arrow { stroke: #4a4a4a; }
/* Clicking opens the real page, so frappe's modal never shows. */
.gantt-container .popup-wrapper { display: none !important; }

@media (max-width: 780px) {
    .detail-split { grid-template-columns: 1fr; gap: 2rem; }
    .alert-inner { flex-wrap: wrap; }
    .alert-copy { flex-basis: 100%; order: 2; }
    .alert-action { order: 3; margin-left: auto; }
}

/* ---------- confirmation modal ---------- */

.modal-scrim {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(8, 8, 8, 0.72);
    backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.modal {
    width: 100%;
    max-width: 30rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--live);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal h2 { font-size: 1.35rem; line-height: 1.2; margin-bottom: 0.7rem; }
.modal .eyebrow { color: var(--live); }
.modal-lead { color: var(--chalk); font-size: 0.95rem; margin: 0 0 1.1rem; }

.modal-consequences {
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}
.modal-consequences li {
    position: relative;
    padding-left: 1.15rem;
    font-size: 0.9rem;
    color: var(--muted);
}
.modal-consequences li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--muted-dim);
}
.modal-consequences strong { color: var(--chalk); font-weight: 600; }

.modal-note {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted-dim);
    margin: 0 0 1.4rem;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }

.completes-phase-flag {
    font-size: 0.7rem;
    color: var(--live);
    margin: 0.9rem 0 0;
}

.reopen-warn {
    font-size: 0.82rem;
    color: var(--live);
    background: #241d10;
    border: 1px solid #4d3d22;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    margin: 1rem 0 0;
}
