/* VAPTOR Project Management: same design as vaptgpt.com and the sp / msp / cp portals. */
:root {
  --cr:#B22222; --dcr:#85072F; --dsg:#53565A; --lsg:#CDCFD1;
  --ink:#23262b; --muted:#6b7077; --hair:#e1e3e5; --alt:#f7f8fa;
  --ok:#2e7d32; --warn:#b26a00; --sidebar:236px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: "Segoe UI", "Inter", Arial, Helvetica, sans-serif; color: var(--ink); background: var(--alt); line-height: 1.55; }
a { color: var(--cr); text-decoration: none; }
a:hover { color: var(--dcr); text-decoration: underline; }
img { max-width: 100%; height: auto; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: #f1f2f4; color: var(--dcr); padding: .1em .4em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.late { color: #9f1d1d; font-weight: 800; }
.soon { color: var(--warn); font-weight: 700; }

/* ── App shell ── */
body.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar); background: #fff; border-right: 1px solid var(--hair);
  box-shadow: 1px 0 8px rgba(35,38,43,.04); display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; height: 66px; padding: 0 16px; border-bottom: 2px solid var(--hair); color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand b { display: block; font-size: 17px; font-weight: 900; letter-spacing: .15em; }
.brand b i, .auth-brand i { font-style: normal; font-size: 9px; letter-spacing: .04em; color: #fff; background: var(--cr); padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.brand small { display: block; font-size: 9.5px; font-weight: 800; color: var(--cr); letter-spacing: .12em; text-transform: uppercase; }
.proj-box { padding: 14px 18px; border-bottom: 1px solid var(--hair); background: var(--alt); }
.proj-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 800; color: var(--dcr); }
.proj-name { font-size: 13px; font-weight: 800; margin-top: 2px; }
.proj-role { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sidebar nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 7px; color: var(--dsg); font-weight: 600; font-size: 13px; }
.sidebar nav a:hover { background: rgba(178,34,34,.06); color: var(--cr); text-decoration: none; }
.sidebar nav a.active { background: linear-gradient(135deg, var(--cr), var(--dcr)); color: #fff; box-shadow: 0 2px 10px rgba(133,7,47,.22); }
.sidebar nav a.sep { margin-top: 10px; border-top: 1px solid var(--hair); border-radius: 0; padding-top: 14px; }
.ic { width: 18px; text-align: center; opacity: .85; }
.who { padding: 14px 16px; border-top: 1px solid var(--hair); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.who-name { font-weight: 800; font-size: 13px; }
.who-id { color: var(--muted); }
.who .signout { margin-top: 6px; text-align: center; padding: 7px; border: 1.5px solid var(--hair); border-radius: 6px; color: var(--dsg); font-weight: 700; }
.who .signout:hover { border-color: var(--cr); color: var(--cr); text-decoration: none; }
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 2px solid var(--hair); box-shadow: 0 1px 8px rgba(35,38,43,.05); padding: 10px 28px; min-height: 66px; display: flex; flex-direction: column; justify-content: center; }
.topbar h1 { font-size: 20px; font-weight: 900; line-height: 1.2; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.content { padding: 22px 28px; flex: 1; }
.foot { margin: 0 28px; padding: 14px 0 22px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ── Cards & layout ── */
.card { background: #fff; border: 1px solid var(--hair); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 2px 14px rgba(35,38,43,.04); overflow-x: auto; }
.card h3 { font-size: 11.5px; font-weight: 800; color: var(--cr); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h4 { font-size: 13px; font-weight: 800; margin: 16px 0 6px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h3 { margin-bottom: 0; }
.card.narrow { max-width: 520px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > * { min-width: 0; }
.task-grid { grid-template-columns: 1.3fr 1fr; align-items: start; }

/* ── Tiles ── */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid var(--hair); border-top: 3px solid var(--cr); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; color: var(--ink); box-shadow: 0 2px 14px rgba(35,38,43,.04); }
a.tile:hover { text-decoration: none; box-shadow: 0 6px 20px rgba(35,38,43,.1); color: var(--ink); }
.tile .lbl { font-size: 10.5px; font-weight: 800; color: var(--dsg); text-transform: uppercase; letter-spacing: .06em; }
.tile .num { font-size: 28px; font-weight: 900; color: var(--dcr); line-height: 1.15; margin-top: 4px; }
.tile .sub { font-size: 11.5px; color: var(--muted); }
.tile-bad { border-top-color: #85072F; background: #fdf6f7; }
.tile-good { border-top-color: var(--ok); }
.tile-good .num { color: var(--ok); }

/* ── Pills ── */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.sev-critical { background: #85072F; color: #fff; }
.sev-high { background: #B22222; color: #fff; }
.sev-medium { background: #fff4e0; color: #7a4a00; border-color: rgba(178,106,0,.25); }
.sev-low { background: #eaf2fc; color: #0d47a1; border-color: rgba(21,101,192,.25); }
.st-open { background: #f1f2f4; color: var(--dsg); border-color: var(--hair); }
.st-assigned { background: #eaf2fc; color: #0d47a1; border-color: rgba(21,101,192,.25); }
.st-in_progress { background: #fff4e0; color: #7a4a00; border-color: rgba(178,106,0,.25); }
.st-fixed { background: #f3ecfb; color: #5b2c8f; border-color: rgba(91,44,143,.25); }
.st-verified { background: #eaf5ea; color: #1b5e20; border-color: rgba(46,125,50,.25); }
.st-reopened { background: #fdecec; color: #9f1d1d; border-color: rgba(198,40,40,.3); }
.st-accepted { background: #e9eaec; color: #23262b; border-color: #cdcfd1; }
.st-false_positive { background: #fff; color: var(--muted); border-color: var(--hair); }
.st-bg-open { background: #8a8f96; } .st-bg-assigned { background: #1f6fb2; } .st-bg-in_progress { background: #c98a0e; }
.st-bg-fixed { background: #7b4fb5; } .st-bg-verified { background: #2e7d32; } .st-bg-reopened { background: #B22222; }
.st-bg-accepted { background: #53565A; } .st-bg-false_positive { background: #cdcfd1; }

/* ── Lifecycle stack, legend, phases, charts ── */
.stack { display: flex; height: 18px; border-radius: 999px; overflow: hidden; gap: 2px; background: #fff; }
.stack .seg { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 12.5px; }
.legend a { color: var(--dsg); display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.phase-row { display: grid; grid-template-columns: 190px 1fr 150px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid #f1f2f4; color: var(--ink); }
.phase-row:hover { text-decoration: none; background: #fbfbfc; }
.phase-name { font-weight: 700; font-size: 13px; }
.phase-num { font-size: 12px; color: var(--muted); text-align: right; }
.bar { height: 10px; background: #eceef0; border-radius: 999px; overflow: hidden; display: block; }
.bar-in { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #43a047); border-radius: 999px; }
.chart { width: 100%; height: auto; display: block; }
.chart .ax { font-size: 10px; fill: #8a8f96; font-family: inherit; }
.chart .val { font-size: 11px; font-weight: 800; fill: #23262b; font-family: inherit; }
.chart g:hover rect[fill="transparent"] { fill: rgba(178,34,34,.05); }

/* ── Tables, feed ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 10.5px; font-weight: 800; color: var(--dsg); text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px; background: var(--alt); border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fbfbfc; }
.muted-row td { opacity: .55; }
.feed { list-style: none; }
.feed li { padding: 8px 0; border-bottom: 1px solid #f1f2f4; font-size: 13px; }
.feed li:last-child { border-bottom: none; }
.when { display: inline-block; min-width: 92px; color: var(--muted); font-size: 12px; }
.note { margin: 6px 0 0 92px; padding: 8px 10px; background: var(--alt); border-left: 3px solid var(--lsg); border-radius: 6px; font-size: 12.5px; white-space: normal; }

/* ── Roadmap ── */
.phase { scroll-margin-top: 90px; }
details.asset { border: 1px solid var(--hair); border-radius: 10px; margin-bottom: 10px; padding: 0 12px; }
details.asset summary { cursor: pointer; padding: 10px 0; font-size: 13.5px; }
details.asset[open] summary { border-bottom: 1px solid var(--hair); margin-bottom: 6px; }
details.asset .inline-form { margin: 8px 0 12px; }

/* ── Task page ── */
.task-title { font-size: 18px !important; color: var(--ink) !important; text-transform: none !important; letter-spacing: 0 !important; line-height: 1.3; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 12.5px; color: var(--muted); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.dl dt { color: var(--muted); font-weight: 700; }
.prose { font-size: 13px; line-height: 1.65; color: var(--ink); white-space: normal; word-break: break-word; }
.prose.fix { background: #f1f8f1; border-left: 3px solid var(--ok); padding: 10px 12px; border-radius: 6px; }

/* ── Forms & buttons ── */
label { display: block; font-size: 11px; font-weight: 700; color: var(--dsg); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 5px; text-transform: none; letter-spacing: normal; font-weight: 400; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 8px 11px; border: 1.5px solid var(--hair); border-radius: 7px; font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cr); }
textarea { resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-weight: 600; margin: 0; }
.check input { width: auto; margin: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.inline-form input, .inline-form select { width: auto; min-width: 150px; }
.stack-form button { margin-top: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 180px; }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px solid var(--hair); }
.bulk select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--hair); background: #fff; color: var(--dsg); font-size: 12.5px; font-weight: 700; }
.chip:hover { border-color: var(--cr); color: var(--cr); text-decoration: none; }
.chip.on { background: linear-gradient(135deg, var(--cr), var(--dcr)); color: #fff; border-color: transparent; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: 1.5px solid transparent; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--cr), var(--dcr)); color: #fff; box-shadow: 0 2px 10px rgba(133,7,47,.22); }
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-ghost { background: #fff; border-color: var(--hair); color: var(--dsg); }
.btn-ghost:hover { border-color: var(--cr); color: var(--cr); }
.btn-danger { background: #fff; border-color: rgba(178,34,34,.35); color: var(--cr); }
.btn-danger:hover { background: var(--cr); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; font-size: 14px; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; border: 1px solid; border-left-width: 4px; }
.alert.ok { background: #f1f8f1; border-color: rgba(46,125,50,.3); border-left-color: var(--ok); color: #1b5e20; }
.alert.bad { background: #fdf3f3; border-color: rgba(198,40,40,.3); border-left-color: #c62828; color: #9f1d1d; }
.alert.cred { line-height: 1.9; }

/* ── Sign-in pages ── */
body.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--hair); border-top: 4px solid var(--cr); border-radius: 14px; padding: 34px 36px 26px; box-shadow: 0 10px 40px rgba(35,38,43,.08); }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo img { width: 60px; height: 60px; margin: 0 auto 10px; display: block; }
.auth-brand { font-size: 22px; font-weight: 900; letter-spacing: .15em; }
.auth-tag { font-size: 11px; font-weight: 800; color: var(--cr); letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; }
.auth-tag::after { content: ""; display: block; height: 3px; width: 46px; margin: 12px auto 0; background: linear-gradient(90deg, var(--cr), var(--dcr)); border-radius: 2px; }
.auth-title { font-size: 17px; font-weight: 900; margin-bottom: 8px; text-align: center; }
.auth-help { font-size: 12.5px; color: var(--muted); margin: 10px 0; text-align: center; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 11.5px; color: var(--muted); }
.qr { display: flex; justify-content: center; margin: 10px 0; }
.secret { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.code-input { text-align: center; font-size: 22px !important; letter-spacing: .35em; font-weight: 800; }

/* ── Responsive ── */
@media (max-width: 1200px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .grid-2, .task-grid { grid-template-columns: 1fr; }
  .phase-row { grid-template-columns: 1fr; gap: 4px; }
  .phase-num { text-align: left; }
}
@media (max-width: 760px) {
  body.app { flex-direction: column; }
  .sidebar { position: static; width: 100%; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .main { margin-left: 0; }
  .topbar { position: static; }
  .content { padding: 16px; }
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media print {
  .sidebar, .foot, form, .chips, .filters { display: none !important; }
  .main { margin-left: 0; }
  .topbar { position: static; box-shadow: none; }
  .card { break-inside: avoid; box-shadow: none; }
  .stack .seg, .pill, .bar-in, .tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ── Printable status report (report.php) ── */
body.report-body { background: #e8eaed; }
.report-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 10px 16px; background: #fff; border-bottom: 2px solid var(--hair); box-shadow: 0 1px 8px rgba(35,38,43,.06); }
.report-bar .inline-form { margin: 0; }
.report { max-width: 210mm; margin: 18px auto 40px; background: #fff; padding: 16mm 14mm; box-shadow: 0 4px 28px rgba(0,0,0,.14); font-size: 12.5px; }
.rep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--dcr); padding-bottom: 12px; margin-bottom: 16px; }
.rep-brand { display: flex; gap: 10px; align-items: center; }
.rep-brand img { width: 40px; height: 40px; }
.rep-brand b { display: block; font-size: 19px; font-weight: 900; letter-spacing: .15em; }
.rep-brand b i { font-style: normal; font-size: 9px; letter-spacing: .04em; color: #fff; background: var(--cr); padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.rep-brand small { display: block; font-size: 10px; font-weight: 800; color: var(--cr); letter-spacing: .12em; text-transform: uppercase; }
.rep-meta { text-align: right; font-size: 11.5px; color: var(--dsg); line-height: 1.5; }
.rep-code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; font-weight: 900; color: var(--dcr); }
.rep-sec { margin-bottom: 18px; }
.rep-sec h2 { font-size: 13px; font-weight: 900; color: var(--cr); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--hair); }
.rep-sec h3 { font-size: 12.5px; font-weight: 800; margin: 12px 0 6px; display: flex; gap: 6px; align-items: center; }
.rag { padding: 9px 12px; border-radius: 8px; border-left: 5px solid; margin-bottom: 10px; }
.rag-green { background: #f1f8f1; border-color: var(--ok); color: #1b5e20; }
.rag-amber { background: #fff8ec; border-color: var(--warn); color: #7a4a00; }
.rag-red { background: #fdf3f3; border-color: #c62828; color: #9f1d1d; }
.rep-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 10px; }
.rep-tiles div { border: 1px solid var(--hair); border-top: 3px solid var(--cr); border-radius: 8px; padding: 8px; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--dsg); }
.rep-tiles span { display: block; font-size: 20px; font-weight: 900; color: var(--dcr); line-height: 1.2; }
.rep-tiles .bad { background: #fdf6f7; }
.rep-tiles .good { border-top-color: var(--ok); }
.rep-tiles .good span { color: var(--ok); }
.rep-points { margin-left: 18px; line-height: 1.7; }
.rtbl { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 6px; }
.rtbl th { text-align: left; background: var(--alt); color: var(--dsg); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 5px 6px; border-bottom: 1px solid var(--hair); }
.rtbl td { padding: 5px 6px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.rtbl .bar { width: 90px; display: inline-block; vertical-align: middle; }
.rtbl .pill { font-size: 9.5px; padding: 1px 7px; }
.rep-foot { margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--hair); font-size: 10px; color: var(--muted); text-align: center; }
@media (max-width: 760px) { .report { padding: 16px; margin: 0; } .rep-tiles { grid-template-columns: repeat(3, 1fr); } .rep-head { flex-direction: column; } .rep-meta { text-align: left; } }
@media print {
  @page { size: A4; margin: 16mm 12mm 14mm;
    @top-left { content: "Cyber Watchdogs (Pty) Ltd"; font: 700 8.5pt "Segoe UI", Arial, sans-serif; color: #85072F; }
    @top-right { content: "Project Status Report \2014  Confidential"; font: 600 8pt "Segoe UI", Arial, sans-serif; color: #6b7077; }
    @bottom-left { content: "VAPTOR AI Project Management"; font: 600 8pt "Segoe UI", Arial, sans-serif; color: #53565A; }
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 600 8pt "Segoe UI", Arial, sans-serif; color: #53565A; }
  }
  body.report-body { background: #fff; }
  .no-print { display: none !important; }
  .report { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .rep-sec { break-inside: auto; }
  .rep-sec h2, .rep-sec h3 { break-after: avoid; }
  .rtbl tr { break-inside: avoid; }
  .rep-break { break-before: page; }
  .rag, .rep-tiles div, .pill, .bar-in, .rtbl th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
