/* PMS — internal tool styling. Clean, dense, server-rendered. */
*{box-sizing:border-box}
body{font:14px/1.55 system-ui,Segoe UI,Roboto,sans-serif;margin:0;background:#f3f4f6;color:#1f2329}
a{color:#4f46e5;text-decoration:none}a:hover{text-decoration:underline}
h1,h2,h3{margin:0 0 10px;line-height:1.25}
.muted{color:#667085;font-size:13px}
code{background:#eef2f7;padding:1px 5px;border-radius:4px;font-size:12.5px;font-family:ui-monospace,Menlo,Consolas,monospace}

/* Top bar + nav */
.topbar{background:#1f2329;color:#fff;padding:0 20px;height:52px;display:flex;align-items:center;gap:20px}
.topbar .brand{font-size:15px;font-weight:700}
.topbar .logo{height:26px;width:auto;border-radius:4px}
.nav{display:flex;gap:16px}
.nav a{color:#cbd5e1;font-size:13.5px}
.nav a:hover,.nav a.active{color:#fff;text-decoration:none}
.nav a.active{font-weight:600}
.spacer{flex:1}
.who{color:#9aa4b2;font-size:12.5px}
.signout{color:#cbd5e1;font-size:13px}.signout:hover{color:#fff}

/* Content */
.wrap{max-width:1100px;margin:22px auto;padding:0 16px}
.page-title{font-size:22px}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:18px 20px;margin-bottom:16px;box-shadow:0 1px 2px rgba(16,24,40,.04)}

/* Buttons */
.btn{display:inline-block;padding:8px 15px;border-radius:7px;border:1px solid #cbd5e1;background:#fff;cursor:pointer;font-size:13.5px;color:#1f2329}
.btn:hover{text-decoration:none;background:#f8fafc}
.btn.pri{background:#4f46e5;color:#fff;border-color:#4f46e5}
.btn.danger{color:#b91c1c;border-color:#fecaca}

/* Forms */
label{display:block;font-size:12px;font-weight:600;color:#475569;margin:12px 0 4px}
input,select,textarea{font:inherit;padding:8px 10px;border:1px solid #cbd5e1;border-radius:7px;width:100%;max-width:460px;box-sizing:border-box;background:#fff}
input:focus,select:focus,textarea:focus{outline:2px solid #c7d2fe;border-color:#a5b4fc}

/* Tables */
table{width:100%;border-collapse:collapse}
th,td{padding:8px 10px;border-bottom:1px solid #eee;text-align:left;font-size:13px;vertical-align:top}
th{background:#f8fafc;font-weight:600;color:#475569}

/* Page header row (title + action) */
.page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.page-head .page-title{margin:0}
.form-actions{margin-top:18px}

/* Status badges */
.badge{font-size:11px;padding:2px 9px;border-radius:11px;font-weight:600;white-space:nowrap}
.badge.on{background:#dcfce7;color:#166534}
.badge.off{background:#f3f4f6;color:#6b7280}
.badge.mid{background:#fef9c3;color:#854d0e}

/* Form grids */
.grid2,.grid3{display:grid;gap:0 18px}
.grid2{grid-template-columns:1fr 1fr}
.grid3{grid-template-columns:1fr 1fr 1fr}
.grid2 input,.grid2 select,.grid3 input,.grid3 select,textarea{max-width:none}
@media(max-width:640px){.grid2,.grid3{grid-template-columns:1fr}}

/* Checkbox list (team assignment) */
.checklist{display:flex;flex-wrap:wrap;gap:6px 20px;margin-top:4px}
.chk{display:flex;align-items:center;gap:7px;font-size:13.5px;font-weight:400;color:#1f2329;margin:0}
.chk input{width:auto;max-width:none}

/* Key/value detail table */
table.kv th{width:150px;color:#475569;background:#fff;font-weight:600;border-bottom:1px solid #f1f5f9}
table.kv td{border-bottom:1px solid #f1f5f9}

/* Flash */
.flash{padding:10px 14px;border-radius:8px;margin-bottom:16px;font-size:13.5px}
.flash.success{background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46}
.flash.error{background:#fee2e2;border:1px solid #fecaca;color:#991b1b}
.flash.info{background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a}
#pms-toasts{position:fixed;top:16px;right:16px;z-index:9999;display:flex;flex-direction:column;gap:8px;max-width:360px}
#pms-toasts .flash{margin:0;box-shadow:0 6px 18px rgba(0,0,0,.14);opacity:1;transition:opacity .35s ease}
#pms-toasts .flash.out{opacity:0}
.editable-sec .edit-mode{display:none}
.editable-sec.editing .view-mode{display:none}
.editable-sec.editing .edit-mode{display:block}
.sec-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.editable-sec.editing .sec-head [data-edit-toggle]{display:none}

/* Stat row + roadmap (dashboard) */
.stat-row{display:flex;gap:14px;flex-wrap:wrap;margin:16px 0}
.stat{flex:1;min-width:150px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px 18px}
.stat-n{font-size:26px;font-weight:700}
.stat-l{color:#667085;font-size:12.5px;text-transform:uppercase;letter-spacing:.03em}
.roadmap{margin:8px 0 0 18px;color:#334155}.roadmap li{margin:3px 0;font-size:13.5px}
.stat.variance.over .stat-n{color:#b91c1c}
.stat.variance.under .stat-n{color:#166534}

/* Inline add-forms (time/cost) */
.inline-form{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;margin-top:6px}
.inline-form>div{display:flex;flex-direction:column}
.inline-form label{margin:0 0 4px}
.inline-form input,.inline-form select{max-width:220px;width:auto}
.inline-form .grow{flex:1 1 220px}.inline-form .grow input{max-width:none;width:100%}

/* Row action links / link-styled buttons */
.row-actions{white-space:nowrap}
.linkbtn{background:none;border:0;padding:0;font:inherit;color:#4f46e5;cursor:pointer;text-decoration:underline}
.linkbtn.danger{color:#b91c1c}

/* Pager + audit diff */
.pager{display:flex;align-items:center;gap:14px;margin-top:14px}
.diff{font-size:12.5px;line-height:1.6}

/* Report tabs + numeric cells + totals */
.tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
.tab{padding:7px 13px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;font-size:13px;color:#475569}
.tab:hover{text-decoration:none;background:#f8fafc}
.tab.active{background:#4f46e5;color:#fff;border-color:#4f46e5}
td.num,th.num{text-align:right;white-space:nowrap}
.totals-row td{border-top:2px solid #cbd5e1}
details summary{cursor:pointer}

/* Comments / discussion thread */
.thread{display:flex;flex-direction:column;gap:10px;margin:6px 0}
.comment{border:1px solid #eef2f7;border-radius:8px;padding:10px 12px;background:#fbfcfe}
.comment-head{font-size:12.5px;margin-bottom:4px}
.comment-actions{float:right}
.comment-body{font-size:14px;white-space:normal}
.note-body{white-space:pre-wrap;font-size:14px}

/* Documentation page — TOC tree + content */
.docs-wrap{display:flex;gap:24px;align-items:flex-start}
.docs-toc{position:sticky;top:16px;flex:0 0 232px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:14px 16px;max-height:calc(100vh - 90px);overflow:auto}
.docs-toc-group{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#94a3b8;font-weight:700;margin:12px 0 4px}
.docs-toc-group:first-child{margin-top:0}
.docs-toc ul{list-style:none;margin:0 0 4px;padding:0}
.docs-toc li{margin:2px 0}
.docs-toc a{font-size:13px;color:#475569}
.docs-toc a:hover{color:#4f46e5}
.docs-body{flex:1;min-width:0}
.doc-section{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:18px 22px;margin-bottom:16px;scroll-margin-top:16px}
.doc-section h2{font-size:18px;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #eef2f7}
.doc-section p,.doc-section li{font-size:14px;line-height:1.65}
.doc-section ul,.doc-section ol{margin:8px 0 8px 20px}
.doc-section table{margin:10px 0}
@media(max-width:760px){.docs-wrap{flex-direction:column}.docs-toc{position:static;width:100%;flex-basis:auto}}

/* Login */
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center}
.login-box{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:28px;width:340px;box-shadow:0 4px 16px rgba(16,24,40,.08)}
.login-box h1{font-size:18px;display:flex;align-items:center;gap:10px;margin-bottom:16px}
.login-box img{height:26px}
.login-box input{max-width:none}
.login-box button{margin-top:18px;width:100%;padding:10px;border:0;border-radius:8px;background:#4f46e5;color:#fff;font-size:14px;font-weight:600;cursor:pointer}
.login-box .hint{color:#667085;font-size:12px;margin-top:16px}
