/* PAP360 - ROMH Consulting brand theme, PULSE-style shell
   Primary: Carbon Blue #373D51 (--navy), Soft Wood #B3AEA8 (--taupe-2)
   Secondary: Purple Nite #323140 (--navy-dark), Stone #8A807B (--taupe), Sand #D6D3CF (--sand) */
:root {
  --navy: #373d51; --navy-2: #414860; --navy-dark: #323140; --navy-soft: #ebecf0;
  --taupe: #8a807b; --taupe-2: #b3aea8; --taupe-soft: #f2f1ef; --sand: #d6d3cf;
  --bg: #f3f3f2; --surface: #ffffff; --text: #323140; --muted: #5f6270; --line: #e0dedb;
  --green: #2e7d4f; --green-soft: #e5f3ea; --amber: #a86b12; --amber-soft: #fbf0dc;
  --red: #b23a3a; --red-soft: #f9e5e5; --blue: #2b5fa6; --blue-soft: #e5eefa; --grey-soft: #eceef2;
  --radius: 8px; --shadow: 0 1px 2px rgba(50,49,64,.06), 0 2px 8px rgba(50,49,64,.05);
  --top-h: 60px; --side-w: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; color: var(--navy-dark); font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--navy-dark); font-weight: 650; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--navy-dark); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---- Top bar ---- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top-h); background: var(--navy); display: flex; align-items: center; z-index: 30; box-shadow: 0 2px 6px rgba(0,0,0,.18); border-bottom: 3px solid var(--taupe); }
.brand { display: flex; align-items: center; gap: 10px; width: var(--side-w); padding: 0 16px; color: #fff; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; background: #fff; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.brand-mark img { width: 36px; }
.brand-text { line-height: 1.05; }
.brand-text b { font-size: 20px; letter-spacing: .5px; font-weight: 800; }
.brand-text b span { color: var(--taupe-2); }
.brand-text small { display: block; font-size: 9.5px; letter-spacing: 1.6px; color: var(--sand); text-transform: uppercase; }
.topnav { display: flex; height: 100%; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topnav a { display: flex; align-items: center; gap: 7px; padding: 0 16px; color: #e6e4e1; font-weight: 550; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.topnav a svg { width: 16px; height: 16px; opacity: .85; }
.topnav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.topnav a.active { color: #fff; background: var(--navy-dark); border-bottom-color: #fff; }
.top-right { display: flex; align-items: center; gap: 6px; padding: 0 14px; color: #fff; }
.icon-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; }
.icon-btn:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.dot { position: absolute; top: 3px; right: 2px; background: #e05a4b; color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 8px; border-radius: 22px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgba(255,255,255,.1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--taupe); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.u-meta { line-height: 1.15; }
.u-meta b { display: block; font-size: 13px; }
.u-meta small { color: var(--sand); font-size: 11px; }
.dropdown { position: absolute; right: 0; top: 46px; background: #fff; color: var(--text); min-width: 240px; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 8px 0; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 8px 16px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--navy-soft); text-decoration: none; }
.dropdown .roles { padding: 6px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; padding: 0 12px; height: 100%; cursor: pointer; }
.menu-toggle svg { width: 22px; height: 22px; }

/* ---- Side bar ---- */
.sidebar { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--side-w); background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 18px 0 24px; z-index: 20; }
.side-title { padding: 0 20px 12px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--taupe); border-bottom: 1px solid var(--line); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.side-title svg { width: 15px; height: 15px; }
.side-group { padding: 14px 20px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.sidebar a { display: flex; justify-content: space-between; align-items: center; padding: 9px 20px 9px 17px; color: var(--text); border-left: 3px solid transparent; }
.sidebar a:hover { background: var(--navy-soft); text-decoration: none; }
.sidebar a.active { background: var(--navy-soft); border-left-color: var(--navy); color: var(--navy); font-weight: 650; }
.sidebar .count { background: var(--navy); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; }
.side-foot { margin-top: 24px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.side-foot b { color: var(--navy); }

/* ---- Content ---- */
.main { margin-left: var(--side-w); padding: calc(var(--top-h) + 22px) 28px 40px; min-height: 100vh; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card.flush { padding: 0; }
.card.flush > h2 { padding: 16px 20px 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--navy); }
.stat.taupe { border-top-color: var(--taupe); }
.stat .lbl { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat .val { font-size: 28px; font-weight: 700; color: var(--navy-dark); margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #f8f9fb; font-weight: 650; white-space: nowrap; }
tr:hover td { background: #fafbfd; }
td.num, th.num { text-align: right; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }

/* ---- Badges, progress ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-grey { background: var(--grey-soft); color: var(--muted); }
.badge-navy { background: var(--navy); color: #fff; }
.badge-taupe { background: var(--taupe-soft); color: var(--taupe); }
.bar { height: 8px; background: var(--grey-soft); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.bar.taupe > i { background: var(--taupe); }
.hbar { display: grid; grid-template-columns: 180px 1fr 54px; gap: 10px; align-items: center; margin: 7px 0; font-size: 13px; }
.hbar .bar { height: 14px; }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--grey-soft); }
.stack i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; background: var(--c); vertical-align: -1px; }

/* ---- Forms ---- */
label { display: block; font-weight: 600; font-size: 12.5px; margin: 0 0 4px; color: var(--navy-dark); }
.field { margin-bottom: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c9d0db; border-radius: 6px; font: inherit; background: #fff; color: var(--text); }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(55,61,81,.25); border-color: var(--navy); }
.check { display: flex; align-items: center; gap: 7px; font-weight: 500; margin: 4px 0; }
.check input { width: auto; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: var(--navy-soft); }
.btn.taupe { background: var(--taupe); border-color: var(--taupe); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.success { background: var(--green); border-color: var(--green); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---- Alerts ---- */
.alert { padding: 11px 14px; border-radius: 6px; margin-bottom: 16px; border-left: 4px solid; }
.alert-success { background: var(--green-soft); border-color: var(--green); }
.alert-error { background: var(--red-soft); border-color: var(--red); }
.alert-info { background: var(--blue-soft); border-color: var(--blue); }
.alert-warn { background: var(--amber-soft); border-color: var(--amber); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--navy); }
.tabs a:hover { text-decoration: none; color: var(--navy); }

/* ---- KPA cards & timeline ---- */
.kpa { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.kpa-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.kpa-title { font-weight: 650; color: var(--navy-dark); }
.kpa-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpa-meta b { color: var(--text); font-weight: 600; }
.pool-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; }
.pool-head h2 { margin: 0; }
.weight-pill { font-weight: 700; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.weight-ok { background: var(--green-soft); color: var(--green); }
.weight-bad { background: var(--red-soft); color: var(--red); }
.timeline { border-left: 2px solid var(--line); margin: 10px 0 0 6px; padding-left: 14px; }
.timeline .ev { position: relative; margin-bottom: 10px; font-size: 13px; }
.timeline .ev::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--taupe); }
.timeline .ev.evidence::before { background: var(--navy); }
details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: 13px; }
.rating-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.rating-opts label { font-weight: 500; border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; display: flex; gap: 6px; align-items: center; cursor: pointer; margin: 0; }
.rating-opts label.disabled { opacity: .45; cursor: not-allowed; background: var(--grey-soft); }
.rating-opts input { width: auto; margin: 0; }
.descriptor { font-size: 12px; color: var(--muted); margin-top: 4px; }
.steps { display: flex; gap: 0; margin: 4px 0 18px; flex-wrap: wrap; }
.steps div { flex: 1; min-width: 110px; text-align: center; padding: 8px 6px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 3px solid var(--line); }
.steps div.done { color: var(--green); border-color: var(--green); }
.steps div.now { color: var(--navy); border-color: var(--navy); }
.heat td { text-align: center; font-weight: 650; }
.slot { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.slot.match { border-color: var(--green); background: var(--green-soft); }
.org ul { list-style: none; padding-left: 22px; margin: 0; border-left: 1px dashed var(--taupe-2); }
.org > ul { border: 0; padding-left: 0; }
.org li { margin: 6px 0; }
.org .node { display: inline-block; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--navy); border-radius: 6px; padding: 6px 10px; }
.org .node.vacant { border-left-color: var(--taupe-2); background: var(--taupe-soft); }
.empty { text-align: center; padding: 28px 10px; color: var(--muted); }
.footer { margin-top: 30px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; border: 40px solid rgba(138,128,123,.35); border-radius: 50%; right: -180px; bottom: -200px; }
.login-art h1 { color: #fff; font-size: 34px; }
.login-art p { color: var(--sand); max-width: 440px; font-size: 15px; }
.pillars { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; }
.pillars div { text-align: center; font-size: 11px; letter-spacing: 1.5px; font-weight: 700; }
.pillars i { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 6px; border-radius: 50%; background: rgba(255,255,255,.12); font-style: normal; font-size: 18px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-box { width: 100%; max-width: 380px; }
.login-box img { width: 190px; display: block; margin: 0 auto 10px; }
.demo-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; }
.demo-list button { display: flex; justify-content: space-between; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; text-align: left; }
.demo-list button:hover { background: var(--navy-soft); }

/* ---- Print (appraisal record) ---- */
.print-doc { background: #fff; max-width: 900px; margin: 0 auto; padding: 30px; font-size: 12.5px; }
.print-doc table td, .print-doc table th { border: 1px solid #999; padding: 5px 7px; }
.print-doc h2 { background: var(--navy); color: #fff; padding: 5px 8px; font-size: 13px; margin-top: 18px; }
.print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--navy); padding-bottom: 10px; }
@media print {
  .topbar, .sidebar, .no-print, .footer { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; }
  .print-doc { padding: 0; }
}

.sidebar .mobile-top { display: none; border-bottom: 1px solid var(--line); margin-bottom: 8px; padding-bottom: 8px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } .u-meta { display: none; } }
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .brand { width: auto; padding-left: 0; }
  .brand-text small { display: none; }
  .topnav { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 16px rgba(0,0,0,.15); }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; padding: calc(var(--top-h) + 16px) 16px 30px; }
  .g2, .g3, .g4, .g-2-1 { grid-template-columns: 1fr; }
  .sidebar .mobile-top { display: block; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .hbar { grid-template-columns: 110px 1fr 44px; }
}
