/* SAI 360 - IBM x SAP
   Palette (4 tones): white #FFFFFF · mist #F5F7F6 · ink #23312C · teal #4BA58B
   plus soft pink #F8D7DF reserved for the "unmapped" tag. Light theme only. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  --blue: #20607C; --blue2: #2B7396; --blue-d: #17475C;
  --green: #4FA34D; --orange: #E8802F; --bg: #E8EDF1; --ink: #22333B;
}
body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: #6E7B76; }
.small { font-size: 12.5px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid #D8E0DD; background: #FFFFFF; color: #23312C;
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 14px;
}
.btn:hover { background: #F5F7F6; }
.btn.primary { background: #4BA58B; border-color: #4BA58B; color: #fff; }
.btn.primary:hover { background: #3E8E77; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin-top: 14px; }
.small-btn { padding: 5px 10px; font-size: 13px; }

/* ---------- login & setup ---------- */
.screen { min-height: 100vh; }
#screen-login, #screen-setup {
  display: flex; align-items: center; justify-content: center;
  background: #F5F7F6;
}
.login-card, .setup-card {
  background: #fff; border: 1px solid #E4EAE8; border-radius: 14px;
  padding: 40px 44px; width: 380px; box-shadow: 0 6px 30px rgba(35,49,44,.06);
}
.setup-card { width: 780px; max-width: 94vw; }
.brand { margin: 0 0 4px; font-size: 26px; letter-spacing: .5px; }
.brand-sub { color: #4BA58B; font-weight: 400; font-size: 18px; }
.fld { display: block; margin-top: 12px; }
.fld span { display: block; font-size: 12.5px; color: #6E7B76; margin-bottom: 4px; }
.fld input, .fld select {
  width: 100%; padding: 9px 11px; border: 1px solid #D8E0DD; border-radius: 8px;
  font-size: 14.5px; background: #fff; color: #23312C;
}
.fld input:focus, .fld select:focus { outline: 2px solid #4BA58B33; border-color: #4BA58B; }
.msg { min-height: 20px; font-size: 13.5px; color: #B4485E; margin: 10px 0 0; }
.msg.okc { color: #3E8E77; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; }
fieldset { border: 1px solid #E4EAE8; border-radius: 10px; padding: 14px 16px; }
legend { font-size: 13px; color: #6E7B76; padding: 0 6px; }

/* ---------- sticky header ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--blue-d); color: #fff;
  border-bottom: 3px solid var(--orange); padding: 10px 26px;
}
#topbar .btn { background: transparent; color: #fff; border-color: #ffffff55; }
#topbar .btn:hover { background: #ffffff22; }
#topbar .who, #topbar .save-state { color: #cfe0e8; }
.bar-left, .bar-right { display: flex; align-items: center; gap: 14px; }
.brand-mini { font-weight: 700; font-size: 17px; letter-spacing: .4px; color: #fff; }
.brand-mini::after { content: " · IBM x SAP"; color: var(--orange); font-weight: 600; font-size: 13px; }
#search {
  width: 260px; padding: 8px 12px; border: 1px solid #ffffff44; border-radius: 20px;
  font-size: 14px; background: #ffffff18; color: #fff;
}
#search::placeholder { color: #b8ccd6; }
#tabs { display: flex; gap: 4px; }
.tab {
  border: none; background: transparent; padding: 8px 12px; cursor: pointer;
  font-size: 14px; color: #cfe0e8; border-radius: 8px;
}
.tab:hover { background: #ffffff22; }
.tab.active { color: var(--blue-d); background: #fff; font-weight: 700; }
.who { font-size: 13px; color: #6E7B76; }
.save-state { font-size: 12.5px; color: #4BA58B; min-width: 60px; text-align: right; }

/* ---------- department picker ---------- */
.picker { position: relative; }
.picker-btn { border-radius: 20px; }
#sec-count-badge { color: #4BA58B; font-weight: 600; }
.picker-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  background: #fff; border: 1px solid #E4EAE8; border-radius: 12px;
  box-shadow: 0 10px 36px rgba(35,49,44,.10);
  width: 380px; max-height: 68vh; overflow-y: auto; padding: 10px;
}
.pm-company { font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
  color: #6E7B76; margin: 10px 6px 4px; }
.pm-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.pm-item:hover { background: #F5F7F6; }
.pm-item input { accent-color: #4BA58B; }
.pm-count { color: #6E7B76; font-size: 13px; }
.pm-actions { display: flex; gap: 8px; padding: 8px 6px 4px; border-top: 1px solid #E4EAE8; margin-top: 8px; }

/* pink unmapped tag - static, no animation */
.tag-unmapped {
  display: inline-flex; align-items: center; gap: 5px;
  background: #F8D7DF; color: #8A3B52; border-radius: 10px;
  font-size: 11px; padding: 1px 8px; margin-left: 6px;
}
.tag-unmapped::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #D8768F; }
.tag-notval {
  display: inline-block; background: #F5F7F6; color: #6E7B76; border-radius: 10px;
  font-size: 11px; padding: 1px 8px; margin-left: 6px;
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 26px; background: #fff; border-bottom: 1px solid #d5dde3;
}
.tool { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #6E7B76; }
.tool select { padding: 6px 9px; border: 1px solid #D8E0DD; border-radius: 8px; font-size: 13.5px; }
.tool.grow { flex: 1; }
.chips { gap: 6px; }
.chip {
  border: 1px solid #D8E0DD; background: #fff; border-radius: 14px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: #23312C;
}
.chip.on { outline: 2px solid #4BA58B; }
.chip.c-green { background: #C6EFCE; border-color: #C6EFCE; }
.chip.c-orange { background: #FCE4D6; border-color: #FCE4D6; }
.chip.c-purple { background: #E4DFEC; border-color: #E4DFEC; }
.chip.c-flag { background: #fff; }

/* ---------- content ---------- */
#content { max-width: 1560px; margin: 0 auto; padding: 26px 26px 90px; }
.pane-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.pane-head h2 { margin: 0; font-size: 19px; }

.sec-block { margin-bottom: 40px; }
.sec-title {
  font-size: 17px; font-weight: 600; margin: 0 0 4px;
  display: flex; align-items: center; gap: 6px;
}
.sec-sub { font-size: 12.5px; color: #6E7B76; margin-bottom: 14px; }
.sec-brackets { color: #4BA58B; font-weight: 600; }

/* finding card */
.card {
  border: 1px solid #E4EAE8; border-radius: 12px; background: #fff;
  padding: 18px 22px; margin-bottom: 16px;
}
.card.resolved { opacity: .62; }
.card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sn { font-weight: 700; font-size: 14.5px; }
.sn-rep { color: #6E7B76; font-size: 13px; }
.pill { border-radius: 10px; font-size: 11.5px; padding: 2px 9px; }
.pill.risk-High, .pill.risk-Critical { background: #23312C; color: #fff; }
.pill.risk-Medium { background: #E4EAE8; color: #23312C; }
.pill.risk-Low { background: #F5F7F6; color: #6E7B76; }
.pill.st-Implemented { background: #C6EFCE; }
.pill.st-Partially { background: #FFF2CC; }
.pill.st-Overdue { background: #F8D7DF; }
.pill.st-NotDue { background: #E4EAE8; }
.pill.col-green { background: #C6EFCE; }
.pill.col-orange { background: #FCE4D6; }
.pill.col-purple { background: #E4DFEC; }
.pill.dept { background: #F5F7F6; color: #6E7B76; }
.flagbtn { margin-left: auto; border: none; background: none; cursor: pointer; font-size: 17px; color: #C9D3CF; }
.flagbtn.on { color: #D8768F; }

.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.f-col h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .7px; color: #6E7B76; }
.f-text { white-space: pre-wrap; font-size: 14.5px; }
.ca-list { display: flex; flex-direction: column; }
.ca-item { display: flex; gap: 10px; padding: 7px 0; border-top: 1px dashed #E4EAE8; flex: 1; }
.ca-item:first-child { border-top: none; }
.ca-text { flex: 1; white-space: pre-wrap; font-size: 14px; }
.ca-pct { width: 74px; display: flex; align-items: center; gap: 3px; font-size: 13px; }
.ca-pct input { width: 52px; padding: 4px 6px; border: 1px solid #D8E0DD; border-radius: 6px; font-size: 13px; }
.overall {
  margin-top: 8px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #6E7B76;
}
.overall .bar { flex: 1; max-width: 300px; height: 7px; background: #F0F3F2; border-radius: 4px; overflow: hidden; }
.overall .fill { height: 100%; background: #4BA58B; }

.meta-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: #6E7B76; }
.meta-row select { padding: 4px 8px; border: 1px solid #D8E0DD; border-radius: 6px; font-size: 13px; }

details.acc { margin-top: 10px; border-top: 1px solid #F0F3F2; padding-top: 8px; }
details.acc summary { cursor: pointer; font-size: 13.5px; color: #4BA58B; user-select: none; }
.thread { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.t-item { border-left: 3px solid #E4EAE8; padding: 6px 12px; border-radius: 0 8px 8px 0; background: #FAFBFB; }
.t-item.p1 { border-left-color: #4BA58B; }
.t-item.p2 { border-left-color: #A8B8B2; }
.t-who { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: #6E7B76; }
.t-text { white-space: pre-wrap; font-size: 13.5px; }

.links-box { margin-top: 8px; font-size: 13.5px; }
.link-line { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.link-add { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.link-add select, .link-add input { padding: 4px 8px; border: 1px solid #D8E0DD; border-radius: 6px; font-size: 12.5px; }

.notes-box textarea {
  width: 100%; min-height: 56px; border: 1px solid #D8E0DD; border-radius: 8px;
  padding: 8px 10px; font-size: 13.5px; font-family: inherit; resize: vertical;
}
.ia-note { background: #FCE4D6; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-top: 8px; }

.expander {
  width: 100%; text-align: center; border: 1px dashed #D8E0DD; background: #FAFBFB;
  color: #6E7B76; padding: 9px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
  margin: 4px 0 10px;
}
.expander:hover { background: #F5F7F6; }

/* logs & snapshots */
.log-line { border-bottom: 1px solid #F0F3F2; padding: 8px 4px; font-size: 13.5px; display: flex; gap: 14px; }
.log-ts { color: #6E7B76; min-width: 150px; }
.log-user { color: #4BA58B; min-width: 50px; }
.snap-card { border: 1px solid #E4EAE8; border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; }
.snap-head { display: flex; gap: 14px; align-items: baseline; }
.snap-ops { white-space: pre-wrap; font-size: 13px; background: #FAFBFB; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }

.idle-note { position: fixed; bottom: 18px; right: 22px; background: #23312C; color: #fff;
  border-radius: 10px; padding: 8px 16px; font-size: 13px; }

/* dialog */
.dlg { position: fixed; inset: 0; background: rgba(35,49,44,.35); z-index: 100;
  display: flex; align-items: center; justify-content: center; }
.dlg-card { background: #fff; border-radius: 14px; padding: 26px 30px; width: 360px; }
.dlg-card h3 { margin: 0 0 4px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.empty { text-align: center; color: #6E7B76; padding: 60px 0; }
@media (max-width: 860px) {
  .f-grid { grid-template-columns: 1fr; }
  .setup-grid { grid-template-columns: 1fr; }
  #search { width: 150px; }
}

/* ---------- dashboard ---------- */
.dash-filters { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { border: 1px solid #E4EAE8; border-radius: 12px; padding: 14px 18px; background: #fff; }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-lbl { font-size: 12.5px; color: #6E7B76; }
.stat-card.accent .stat-num { color: #4BA58B; }
.stat-card.warn .stat-num { color: #B4485E; }

.dash-sec { margin-bottom: 30px; }
.dash-sec h3 { font-size: 15px; margin: 0 0 10px; }
.hbar { display: flex; height: 22px; border-radius: 8px; overflow: hidden; border: 1px solid #E4EAE8; }
.hbar div { height: 100%; }
.hbar-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: #6E7B76; }
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

.bs-Overdue { background: #E8A0B4; }
.bs-Partially { background: #F5DFA1; }
.bs-NotDue { background: #C9D3CF; }
.bs-Implemented { background: #9AD4B8; }
.br-Critical { background: #23312C; }
.br-High { background: #4E6B60; }
.br-Medium { background: #A8B8B2; }
.br-Low { background: #E4EAE8; }
.bc-green { background: #C6EFCE; }
.bc-orange { background: #FCE4D6; }
.bc-purple { background: #E4DFEC; }
.bc-none { background: #F0F3F2; }

.dash-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dash-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: #6E7B76; padding: 7px 10px; border-bottom: 1px solid #E4EAE8; font-weight: 600; }
.dash-table td { padding: 8px 10px; border-bottom: 1px solid #F0F3F2; }
.dash-table tr.clickable { cursor: pointer; }
.dash-table tr.clickable:hover { background: #F5F7F6; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-bar { width: 90px; height: 7px; background: #F0F3F2; border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; }
.mini-fill { height: 100%; background: #4BA58B; }
.dt-brackets { color: #4BA58B; font-weight: 600; white-space: nowrap; }


/* ================== horizontal finding rows (mock layout) ================== */
.sec-title { color: var(--blue-d); }
.frow-wrap { margin-bottom: 14px; }
.frow-head {
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: #5b6d78;
  padding: 0 2px 3px;
}
.frow-head .pill { font-size: 10.5px; }
.frow-head .flagbtn { margin-left: 0; font-size: 15px; }
.frow-more { cursor: pointer; color: var(--blue2); user-select: none; }
.frow {
  display: flex; align-items: stretch; gap: 5px; height: 172px;
  background: #fff; border: 1px solid #d5dde3; border-radius: 10px; padding: 8px;
}
.frow.resolved { opacity: .55; }

.vtile {
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--green); color: #fff; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
  width: 34px; flex: none; padding: 6px 2px; text-align: center;
  overflow: hidden; cursor: default;
}
.vtile small { font-weight: 400; font-size: 9.5px; opacity: .85; }
.vtile.risk-Critical { background: #7C1D2E; }
.vtile.risk-High { background: #C24141; }
.vtile.risk-Medium { background: #E0A93E; }
.vtile.risk-Low { background: #58A65C; }
.vtile.st-click { cursor: pointer; }
.vtile.st-click:hover { filter: brightness(1.08); }

.btile {
  background: var(--blue); color: #fff; border-radius: 6px;
  width: 250px; flex: none; padding: 9px 11px; font-size: 12.5px;
  overflow-y: auto; white-space: pre-wrap;
}
.btile h5 { margin: 0 0 4px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .8px; color: #bcd6e2; font-weight: 700; }
.btile::-webkit-scrollbar { width: 6px; }
.btile::-webkit-scrollbar-thumb { background: #ffffff44; border-radius: 3px; }

.ca-stack { width: 220px; flex: none; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.ca-row { display: flex; gap: 4px; flex: 1; min-height: 30px; }
.ca-tile {
  flex: 1; background: var(--blue); color: #fff; border-radius: 5px;
  font-size: 11px; padding: 4px 8px; overflow-y: auto; white-space: pre-wrap;
}
.ca-pct {
  flex: none; width: 52px; background: var(--orange); border-radius: 5px;
  display: flex; align-items: center; justify-content: center; gap: 1px;
  color: #fff; font-size: 11.5px; font-weight: 700;
}
.ca-pct input {
  width: 30px; border: none; background: transparent; color: #fff;
  font-size: 11.5px; font-weight: 700; text-align: right; padding: 0;
}
.ca-pct input:focus { outline: 1px solid #fff; }
.ca-all {
  height: 15px; border-radius: 4px; background: #d8e2e8; overflow: hidden; margin-top: 2px;
  position: relative; flex: none;
}
.ca-all .fill { height: 100%; background: var(--green); }
.ca-all span { position: absolute; inset: 0; font-size: 9.5px; text-align: center; color: var(--ink); line-height: 15px; }

.notes-tile {
  background: var(--orange); border-radius: 6px; width: 170px; flex: none;
  padding: 8px 9px; display: flex; flex-direction: column;
}
.notes-tile h5 { margin: 0 0 3px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .8px; color: #fff3e6; font-weight: 700; }
.notes-tile textarea {
  flex: 1; width: 100%; border: none; background: transparent; resize: none;
  color: #fff; font-size: 12px; font-family: inherit;
}
.notes-tile textarea::placeholder { color: #ffd9b8; }
.notes-tile textarea:focus { outline: 1px dashed #fff; }
.notes-tile .ro { flex: 1; color: #fff; font-size: 12px; overflow-y: auto; white-space: pre-wrap; }

.thread-strip {
  flex: 1; display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; padding-bottom: 2px;
}
.thread-strip::-webkit-scrollbar { height: 7px; }
.thread-strip::-webkit-scrollbar-thumb { background: #9fb4c0; border-radius: 4px; }
.tcol { width: 165px; flex: none; display: flex; flex-direction: column; gap: 4px; }
.tcol-when {
  flex: none; background: var(--blue-d); color: #fff; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; text-align: center; padding: 3px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tcol-body {
  flex: 1; border-radius: 5px; color: #fff; font-size: 11.5px;
  padding: 6px 8px; overflow-y: auto; white-space: pre-wrap;
}
.tcol.p1 .tcol-body { background: var(--blue); }
.tcol.p2 .tcol-body { background: var(--blue2); }
.tcol-body b { display: block; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .6px; color: #cfe3ec; margin-bottom: 2px; }
.tcol.empty .tcol-body { background: #eef2f5; color: #7b8b95; border: 1px dashed #c3d0d8; }

.frow-extras {
  background: #fff; border: 1px solid #d5dde3; border-top: none;
  border-radius: 0 0 10px 10px; margin: -6px 8px 0; padding: 10px 14px 8px;
  font-size: 13px;
}

/* status picker popup */
.st-menu {
  position: absolute; z-index: 90; background: #fff; border: 1px solid #c3d0d8;
  border-radius: 8px; box-shadow: 0 8px 26px rgba(23,71,92,.25); overflow: hidden;
}
.st-menu button { display: block; width: 100%; border: none; background: #fff;
  padding: 8px 16px; font-size: 13px; cursor: pointer; text-align: left; }
.st-menu button:hover { background: #E8EDF1; }

/* dashboard touch-up on new bg */
.stat-card { background: #fff; }
.dash-table { background: #fff; }
.pane .empty { color: #5b6d78; }
