/* NVLX Delivery Hub — internal tooling stylesheet.
   Deliberately NOT the nevalux design system (same exception as nvlx_main /plan):
   IBM Plex Sans stack, own tokens. One file, no build step. */

:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --ink: #16181d;
    --muted: #6b7280;
    --line: #e5e7eb;
    --yellow: #FFDD00;
    --green: #16a34a;
    --red: #dc2626;
    --chip: #eef0f3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .06);
    font-size: 15px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
    padding-bottom: 60px;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* top bar */
header.top { background: #16181d; color: #fff; padding: 10px 0; }
header.top .wrap { display: flex; align-items: center; gap: 14px; }
.logo { font-weight: 700; letter-spacing: .5px; color: #fff; text-decoration: none; }
.logo .dot { color: var(--yellow); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .78rem; color: #c9cdd4; }
.role { background: #2a2d34; border-radius: 999px; padding: 3px 12px; font-weight: 600; }
.role b { color: var(--yellow); }
.linkbtn { background: none; border: 0; color: #c9cdd4; font: inherit; font-weight: 600; cursor: pointer; }
.linkbtn:hover { color: #fff; }

main { padding-top: 26px; }
h1 { font-size: 1.45rem; font-weight: 700; margin-bottom: 4px; }
.sub { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }

/* portfolio */
.projgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .projgrid { grid-template-columns: 1fr; } }
.proj { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.proj .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.proj .name { font-weight: 700; font-size: 1.02rem; }
.proj .stack { color: var(--muted); font-size: .78rem; margin-left: auto; }
.proj .meta { display: flex; gap: 8px; flex-wrap: wrap; }

.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 600; color: #374151; }
.chip.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

.dot-status { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #9ca3af; }
.dot-status.active { background: var(--green); }
.dot-status.live { background: #2563eb; }
.dot-status.backlog { background: #9ca3af; }

/* login */
.login-card { max-width: 380px; margin: 8vh auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.login-card label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 14px 0 4px; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; }
.login-card input:focus { outline: 2px solid var(--yellow); border-color: transparent; }
.btn { margin-top: 20px; width: 100%; background: #16181d; color: var(--yellow); border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { background: #000; }
.err { color: var(--red); font-size: .8rem; margin-top: 10px; }

/* ===== v2: H1 dashboard ===== */
.topnav { display: flex; gap: 4px; margin-left: 18px; }
.topnav a { color: #c9cdd4; font-weight: 600; font-size: .85rem; padding: 5px 12px; border-radius: 8px; text-decoration: none; }
.topnav a:hover { color: #fff; background: #2a2d34; }
.flash { background: #dcfce7; color: #166534; border: 1px solid #86efac; border-radius: 10px; padding: 10px 16px; margin-bottom: 18px; font-weight: 600; font-size: .88rem; word-break: break-all; }
.subtle-link { color: var(--muted); font-size: .82rem; }
.proj { text-decoration: none; color: inherit; display: block; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.phase { background: #f3e8ff; color: #6b21a8; }
.chip.ref { background: #e8edff; color: #1e3a8a; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.chip.effort { background: #ecfdf5; color: #065f46; }
.phasebar { display: flex; gap: 3px; margin-bottom: 12px; }
.phasebar span { height: 8px; flex: 1; border-radius: 4px; background: #e5e7eb; }
.phasebar span.done { background: var(--green); }
.phasebar span.doing { background: var(--yellow); outline: 1px solid #d4b900; }

.proj-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.proj-head h1 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow); }
.kpi .n { font-size: 1.6rem; font-weight: 700; }
.kpi .n .of { font-size: .9rem; color: var(--muted); }
.kpi .l { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi.warn .n { color: #ea580c; }
.kpi.bad .n { color: var(--red); }

.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel h2 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: .78rem; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* gantt */
.gantt { position: relative; padding-top: 6px; }
.g-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; min-height: 32px; }
.g-row .lbl { font-size: .8rem; font-weight: 700; }
.g-row .lbl small { color: var(--muted); font-weight: 400; display: block; font-size: .7rem; }
.g-track { position: relative; height: 18px; }
.bar { position: absolute; top: 1px; height: 16px; border-radius: 8px; background: #d7dbe2; }
.bar.done { background: var(--green); }
.bar.doing { background: var(--yellow); outline: 1px solid #d4b900; }
.todayline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 5; }
.todayline span { position: absolute; top: -4px; left: -14px; font-size: .62rem; color: var(--red); font-weight: 700; }
.ms-track { height: 24px; }
.ms { position: absolute; font-size: .7rem; font-weight: 600; color: #374151; white-space: nowrap; }
.ms.done { color: var(--green); }

/* tasks */
ul.tasks { list-style: none; }
ul.tasks li { display: flex; align-items: center; gap: 8px; padding: 9px 4px; border-top: 1px solid var(--line); font-size: .87rem; background: var(--panel); }
ul.tasks li:first-child { border-top: 0; }
ul.tasks li.hint { color: var(--muted); }
ul.tasks .t { flex: 1; min-width: 0; }
ul.tasks .t small { display: block; color: var(--muted); font-size: .74rem; }
.handle { cursor: grab; color: #c9cdd4; user-select: none; }
li.dragging { opacity: .4; outline: 2px dashed var(--yellow); border-radius: 8px; }
.state { font-size: .68rem; font-weight: 700; border-radius: 6px; padding: 2px 7px; }
.state.todo { background: var(--chip); color: #374151; }
.state.doing { background: var(--yellow); color: #16181d; }
.state.blocked { background: #fee2e2; color: #991b1b; }
.state.done { background: #dcfce7; color: #166534; }

/* decisions */
.decision { border-top: 1px solid var(--line); padding: 10px 2px; font-size: .85rem; }
.decision:first-of-type { border-top: 0; }
.decision .q { font-weight: 600; margin-bottom: 5px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.opt { border: 1px solid var(--line); border-radius: 999px; padding: 2px 11px; font-size: .74rem; font-weight: 600; }
.applypending { background: #fef3c7; color: #92400e; font-size: .68rem; font-weight: 700; border-radius: 6px; padding: 2px 7px; }

/* editors & forms */
.editor { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.editor-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.editor-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.editor-row input, .editor-row select, .stack-form input, .stack-form select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .84rem; }
.editor-row input { width: 90px; }
.editor-row input.grow { flex: 1; min-width: 140px; }
.editor-row .inline { font-size: .78rem; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.btn-small { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.btn-small:hover { border-color: var(--yellow); background: var(--yellow-soft); }
.btn-small.primary { background: #16181d; color: var(--yellow); border-color: #16181d; }
.btn-small.danger { color: var(--red); }
.stack-form label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.stack-form input, .stack-form select { width: 100%; }
.stack-form .btn { margin-top: 14px; width: auto; padding: 9px 22px; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th { text-align: left; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 4px 8px; }
.table td { padding: 8px; border-top: 1px solid var(--line); }

/* ===== v3: H2 plan + feedback ===== */
.subtabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 18px; width: max-content; max-width: 100%; }
.subtabs a { font-weight: 700; font-size: .86rem; padding: 8px 20px; border-radius: 9px; color: var(--muted); text-decoration: none; display: flex; gap: 7px; align-items: center; }
.subtabs a:hover { color: var(--ink); }
.subtabs a.on { background: #16181d; color: #fff; }
.badge { background: #fee2e2; color: #991b1b; font-weight: 700; border-radius: 999px; padding: 1px 8px; font-size: .72rem; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filters .opt { cursor: pointer; background: #fff; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: .76rem; font-weight: 600; }
.filters .opt.on { background: #16181d; color: #fff; border-color: #16181d; }
.plan-row.decision { background: #fdfbef; }
.decision-text { display: block; color: #6b21a8; font-size: .76rem; margin-top: 3px; }
.plan-phase h2 { display: flex; gap: 10px; align-items: baseline; }

/* feedback cards */
.fqgrid { display: grid; gap: 12px; }
.fitem { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); }
.fitem.muted { opacity: .6; }
.frow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.fitem .msg { font-size: .92rem; margin-bottom: 8px; white-space: pre-wrap; }
.fmeta { display: flex; gap: 14px; font-size: .75rem; color: var(--muted); flex-wrap: wrap; }
.fmeta .mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.fnote { background: #fef9c3; border-radius: 8px; padding: 6px 10px; font-size: .8rem; margin-top: 8px; }
.chip.type-bug { background: #fee2e2; color: #991b1b; }
.chip.type-product_data { background: #ffedd5; color: #9a3412; }
.chip.type-improvement { background: #dbeafe; color: #1e40af; }
.chip.type-wireframe { background: #ede9fe; color: #5b21b6; }
.chip.gh { background: #16181d; color: #fff; font-family: "IBM Plex Mono", ui-monospace, monospace; text-decoration: none; }
.state.hold { background: #fef3c7; color: #92400e; }
.factions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.note-input { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: .8rem; }
.btn-act { border: 0; font: inherit; font-weight: 700; font-size: .78rem; border-radius: 8px; padding: 6px 14px; cursor: pointer; background: var(--chip); }
.btn-act.accept { background: var(--green); color: #fff; }
.btn-act.hold { background: #fef3c7; color: #92400e; }
.btn-act.reject { background: #fee2e2; color: #991b1b; }
code { background: var(--chip); border-radius: 6px; padding: 1px 6px; font-size: .82em; }

/* ===== v4: H3 draft loop ===== */
.draft-box { margin-top: 12px; background: #f8f9fb; border: 1px dashed #c8cdd6; border-radius: 12px; padding: 12px 14px; }
.draft-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: .86rem; flex-wrap: wrap; }
.claude-mark { width: 22px; height: 22px; border-radius: 6px; background: #D97757; color: #fff; display: grid; place-items: center; font-size: .62rem; font-weight: 800; }
.ref-input { margin-left: auto; width: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .8rem; }
.draft-file { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .76rem; line-height: 1.5; resize: vertical; box-sizing: border-box; background: #fff; }
.btn-act.confirm { background: #16181d; color: var(--yellow); }

/* ===== v5: H4 wireframes ===== */
.wf-layout { display: grid; grid-template-columns: 200px 1fr 280px; gap: 14px; }
@media (max-width: 1000px) { .wf-layout { grid-template-columns: 1fr; } }
.wf-list { list-style: none; }
.wf-list li a { display: block; padding: 8px 12px; border-radius: 9px; font-size: .86rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.wf-list li a:hover { background: var(--chip); }
.wf-list li.on a { background: #16181d; color: #fff; }
.wf-stage-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: auto; max-height: 78vh; }
.wf-stage { position: relative; min-height: 200px; }
.wf-stage img { display: block; width: 100%; }
.wf-stage iframe { display: block; width: 100%; height: 2400px; border: 0; pointer-events: none; }
.wf-overlay { position: absolute; inset: 0; cursor: crosshair; }
.wf-pin { position: absolute; transform: translate(-50%, -100%); width: 24px; height: 24px; border-radius: 50% 50% 50% 4px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); pointer-events: none; }
.wf-pin.in_queue { background: #d97706; }
.wf-pin.resolved { background: var(--green); }
.pin-form { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.pin-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .86rem; box-sizing: border-box; }
.wf-comments .c { border-top: 1px solid var(--line); padding: 10px 2px; font-size: .84rem; }
.wf-comments .c:first-of-type { border-top: 0; }
.wf-comments .c .h { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.pin-num { width: 19px; height: 19px; border-radius: 50%; background: var(--red); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; flex: none; }
.pin-num.in_queue { background: #d97706; }
.pin-num.resolved { background: var(--green); }
