/* ==========================================================================
   Security Dashboard — design system
   ========================================================================== */

:root {
  --bg:            #0d1117;
  --bg-elev:       #141b24;
  --panel:         #161d27;
  --panel-2:       #1c2530;
  --sidebar:       #0a0e14;
  --border:        #263041;
  --border-soft:   #1e2733;

  --text:          #e6edf3;
  --text-dim:      #9aa7b5;
  --text-faint:    #6b7885;

  --accent:        #4f8cff;
  --accent-soft:   rgba(79, 140, 255, .14);
  --ok:            #2ea043;
  --warn:          #d29922;
  --danger:        #e5534b;

  --crit:          #b62324;
  --high:          #e5534b;
  --med:           #d29922;
  --low:           #4f8cff;
  --info:          #6b7885;

  --radius:        10px;
  --radius-sm:     7px;
  --shadow:        0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.22);
  --sidebar-w:     236px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================ Layout ============================ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
}

.brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.brand .title {
  font-size: 14px; font-weight: 650; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 9px;
}
.brand .title .mark {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #7b5cff);
  display: grid; place-items: center; font-size: 12px;
}
.brand .sub { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; padding-left: 31px; }

.nav { padding: 12px 10px; flex: 1; }
.nav-group { margin-bottom: 16px; }
.nav-group > .label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); font-weight: 650; padding: 0 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 7px 9px; margin-bottom: 1px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 13px; font-family: inherit; font-weight: 500;
  text-align: left; border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #cfe0ff; font-weight: 600; }
.nav-item .ico { width: 15px; height: 15px; flex-shrink: 0; opacity: .85; }
.nav-item .count {
  margin-left: auto; font-size: 10.5px; color: var(--text-faint);
  background: var(--panel-2); padding: 1px 6px; border-radius: 9px;
}

.sidebar-foot {
  padding: 12px 14px; border-top: 1px solid var(--border-soft);
  font-size: 10.5px; color: var(--text-faint);
}
.sidebar-foot a { color: var(--text-dim); text-decoration: none; }
.sidebar-foot a:hover { color: var(--accent); }

.content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

.page-head {
  padding: 22px 30px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--bg-elev);
}
.page-head h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.page-head .desc { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.page-body { padding: 22px 30px 60px; max-width: 1180px; }

.view { display: none; }
.view.active { display: block; }

/* ============================ Cards ============================ */

.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card > h2 {
  margin: 0 0 3px; font-size: 13.5px; font-weight: 650;
  display: flex; align-items: center; gap: 8px;
}
.card > .card-desc { color: var(--text-dim); font-size: 12px; margin-bottom: 15px; }
.card > h2 + .form-grid, .card > h2 + .btn-row, .card > h2 + table { margin-top: 14px; }

.card-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* ============================ Forms ============================ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px 14px;
}
.form-grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label {
  font-size: 10.5px; font-weight: 650; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-dim);
  display: flex; align-items: baseline; gap: 6px;
}
.field > label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-faint); }

input[type=text], input[type=email], input[type=number], input[type=password], select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { min-height: 74px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; resize: vertical; }
select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa7b5' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px;
}

/* A monospaced text input (cron expressions) -- same size and colour as any
   other field, since .mono on its own dims and shrinks it like read-only text. */
input[type=text].mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: var(--text);
  letter-spacing: .02em;
}

.hint { font-size: 11px; color: var(--text-faint); }

/* The plain-English schedule summary under the frequency controls. */
#job-schedule-summary:not(:empty) {
  padding: 7px 10px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 11.5px;
}

/* checkbox grid (services, modules) */
.check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 2px 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.check-grid .all-row { grid-column: 1 / -1; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border-soft); }
.check {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text); cursor: pointer;
  padding: 3px 0; user-select: none; white-space: nowrap;
}
.check input { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; margin: 0; flex-shrink: 0; }
.check.strong { font-weight: 600; color: #cfe0ff; }

/* multi-select picker (repositories) — the check-grid idiom, but filterable */
.picker { display: flex; flex-direction: column; gap: 7px; }
.picker-head { display: flex; gap: 7px; align-items: center; }
.picker-head input[type=text] { flex: 1; min-width: 0; }
.picker-list { max-height: 232px; }
.picker-list .check { padding: 4px 7px; border-radius: 5px; white-space: nowrap; }
.picker-list .check:hover { background: var(--panel-2); }
.picker-list .check.hidden { display: none; }
.picker-list .sub { color: var(--text-faint); font-size: 11px; }

/* per-tool scheduler config blocks + the advanced JSON escape hatch */
.cfg-block {
  margin-top: 14px; padding: 14px 15px;
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.cfg-title {
  font-size: 10.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 11px;
}
.adv { margin-top: 14px; }
.adv > summary {
  cursor: pointer; font-size: 12px; color: var(--text-dim);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
  user-select: none;
}
.adv > summary::before { content: "▸"; font-size: 10px; color: var(--text-faint); }
.adv[open] > summary::before { content: "▾"; }
.adv > summary:hover { color: var(--text); }

/* ============================ Buttons ============================ */

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.btn-row.tight { margin-top: 10px; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 15px;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: filter .12s, background .12s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn.ghost:hover:not(:disabled) { background: var(--border); filter: none; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.btn .ico { width: 13px; height: 13px; }

.linkbtn {
  background: none; border: none; color: var(--accent);
  font-size: 12px; font-family: inherit; cursor: pointer; padding: 0; text-decoration: none;
}
.linkbtn:hover { text-decoration: underline; }

/* ============================ Status bits ============================ */

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  padding: 4px 11px; border-radius: 20px; font-size: 11.5px; color: var(--text-dim);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(46,160,67,.16); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(229,83,75,.16); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(210,153,34,.16); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase;
}
.badge.success  { background: rgba(46,160,67,.16);  color: #56d364; }
.badge.failed   { background: rgba(229,83,75,.16);  color: #ff7b72; }
.badge.running  { background: rgba(210,153,34,.16); color: #e3b341; }
.badge.CRITICAL { background: rgba(182,35,36,.20);  color: #ff8785; }
.badge.HIGH     { background: rgba(229,83,75,.16);  color: #ff7b72; }
.badge.MEDIUM   { background: rgba(210,153,34,.16); color: #e3b341; }
.badge.LOW      { background: rgba(79,140,255,.16); color: #79b8ff; }
.badge.INFO, .badge.UNKNOWN { background: rgba(107,120,133,.18); color: #a9b4bf; }

/* severity stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; margin: 4px 0 2px; }
.stat {
  background: var(--bg); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.stat .n { font-size: 21px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }
.stat .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); font-weight: 600; margin-top: 1px; }
.stat.CRITICAL { border-left-color: var(--crit); }
.stat.HIGH     { border-left-color: var(--high); }
.stat.MEDIUM   { border-left-color: var(--med); }
.stat.LOW      { border-left-color: var(--low); }
.stat.INFO, .stat.UNKNOWN { border-left-color: var(--info); }
.stat.accent   { border-left-color: var(--accent); }
.stat.ok       { border-left-color: var(--ok); }
.stat.bad      { border-left-color: var(--danger); }

/* progress */
.progress { height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin: 10px 0 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), #7b5cff); width: 0; transition: width .35s ease; }

/* "rows are still arriving" indicator next to a live table's heading */
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  display: none; flex-shrink: 0; animation: live-pulse 1.4s ease-in-out infinite;
}
.live-dot.on { display: inline-block; }
@keyframes live-pulse {
  0%, 100% { opacity: 1;  box-shadow: 0 0 0 0 rgba(46,160,67,.45); }
  50%      { opacity: .5; box-shadow: 0 0 0 4px rgba(46,160,67,0); }
}

/* console / log output */
.console {
  background: #06090e; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 11px 13px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px; line-height: 1.65; color: #c3ccd6;
  max-height: 340px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  margin: 0;
}
.console:empty::before { content: "No output yet."; color: var(--text-faint); }
.console .ln-err { color: #ff7b72; }
.console .ln-warn { color: #e3b341; }

/* ============================ Tables ============================ */

.table-wrap { overflow-x: auto; margin-top: 4px; }
/* live-streaming result tables: bounded height, header stays put while rows land */
.table-wrap.scroll { max-height: 440px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th {
  color: var(--text-dim); font-size: 9.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .07em;
  background: var(--bg-elev); position: sticky; top: 0;
}
tbody tr:hover td { background: rgba(255,255,255,.022); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 5px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--text-dim); }
.empty-row td { color: var(--text-faint); text-align: center; padding: 26px; font-size: 12.5px; }

/* ============================ Messages ============================ */

.msg {
  margin-top: 12px; font-size: 12.5px; padding: 9px 13px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  display: none;
}
.msg.show { display: block; }
.msg.ok   { background: rgba(46,160,67,.10);  border-color: rgba(46,160,67,.34);  color: #7ee787; }
.msg.err  { background: rgba(229,83,75,.10);  border-color: rgba(229,83,75,.34);  color: #ffa198; }
.msg.info { background: rgba(79,140,255,.10); border-color: rgba(79,140,255,.30); color: #a5c9ff; }

.banner {
  background: rgba(210,153,34,.10); border: 1px solid rgba(210,153,34,.32);
  color: #e3b341; border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 12.5px; margin-bottom: 16px;
}
.banner b { color: #f0c869; }
.banner code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

/* ============================ Modal ============================ */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2,5,10,.72);
  display: none; align-items: center; justify-content: center; z-index: 100;
  padding: 24px; backdrop-filter: blur(2px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto;
}
.modal-head {
  padding: 16px 20px 13px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.modal-head .close {
  margin-left: auto; background: none; border: none; color: var(--text-faint);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 0 2px;
}
.modal-head .close:hover { color: var(--text); }
.modal-body { padding: 18px 20px; }
.modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--border-soft);
  display: flex; gap: 9px; justify-content: flex-end;
}

.recipient-list {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); max-height: 210px; overflow-y: auto; padding: 6px;
}
.recipient-list .check { padding: 5px 7px; border-radius: 5px; white-space: normal; }
.recipient-list .check:hover { background: var(--panel-2); }
.recipient-list .rc-email { color: var(--text-faint); font-size: 11.5px; }
.recipient-list .none { color: var(--text-faint); font-size: 12px; padding: 12px; text-align: center; }

/* ============================ Misc ============================ */

.links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.links a { color: var(--accent); text-decoration: none; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.links a:hover { text-decoration: underline; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 12.5px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; }

.section-gap { margin-top: 22px; }

/* ============================ Sub-tabs (within a scanner page) ============================ */

.subtabs {
  display: flex; gap: 3px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border-soft); padding-bottom: 0;
}
.subtab {
  background: none; border: none; color: var(--text-dim);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--text); border-bottom-color: var(--accent); }
.subpanel { display: none; }
.subpanel.active { display: block; }

/* ============================ Change register cards ============================ */

.reg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; }
.reg-card {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 15px 16px;
}
.reg-card-title {
  display: flex; align-items: center; gap: 9px; justify-content: space-between;
  font-size: 12.5px; font-weight: 650; margin-bottom: 3px;
}
.reg-card-note { font-size: 10.5px; color: var(--text-faint); margin-bottom: 9px; line-height: 1.5; }
.reg-card table { font-size: 11.5px; }
.reg-card th, .reg-card td { padding: 6px 8px; }
.reg-ok { color: #56d364; }
.reg-bad { color: #ff7b72; }
.reg-warn { color: #e3b341; }
.reg-none { font-size: 11.5px; color: var(--text-faint); padding: 6px 0; }
.reg-none.good { color: #56d364; }
tr.row-bad td { background: rgba(229,83,75,.06); }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .02em;
}
.tag.green  { background: rgba(46,160,67,.16);  color: #56d364; }
.tag.teal   { background: rgba(45,212,191,.15); color: #5eead4; }
.tag.orange { background: rgba(210,153,34,.16); color: #e3b341; }
.tag.red    { background: rgba(229,83,75,.16);  color: #ff7b72; }
.tag.purple { background: rgba(139,92,246,.17); color: #c4b5fd; }
.tag.blue   { background: rgba(79,140,255,.16); color: #79b8ff; }
.tag.gray   { background: rgba(107,120,133,.18); color: #a9b4bf; }

.msgcell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* a cell whose text is allowed to wrap over a couple of lines (remediation) */
.wrapcell {
  min-width: 220px; max-width: 340px; white-space: normal;
  color: var(--text-dim); font-size: 11.5px; line-height: 1.45;
}
/* ...the same cell holding a code snippet (HoundDog's offending code):
   monospace, and long unbroken tokens wrap instead of stretching the table.
   The full, multi-line snippet is in the cell's title tooltip. */
.wrapcell.mono {
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
  word-break: break-word;
}

/* ============================ Filter bar (severity chips + quick search) ============================ */

.filterbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 4px 0 12px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  color: var(--text-dim); font-family: inherit; font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 20px; cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.chip:hover { color: var(--text); border-color: var(--border); }
.chip .c {
  font-size: 10.5px; font-weight: 650; color: var(--text-faint);
  background: rgba(255,255,255,.05); padding: 0 6px; border-radius: 9px; min-width: 18px; text-align: center;
}
.chip.active { background: var(--accent-soft); border-color: rgba(79,140,255,.45); color: #cfe0ff; }
.chip.active .c { color: #cfe0ff; }
.chip.sev-CRITICAL.active { background: rgba(182,35,36,.20); border-color: rgba(182,35,36,.55); color: #ff8785; }
.chip.sev-HIGH.active     { background: rgba(229,83,75,.16); border-color: rgba(229,83,75,.50); color: #ff7b72; }
.chip.sev-MEDIUM.active   { background: rgba(210,153,34,.16); border-color: rgba(210,153,34,.50); color: #e3b341; }
.chip.sev-LOW.active      { background: rgba(79,140,255,.16); border-color: rgba(79,140,255,.50); color: #79b8ff; }
.chip.sev-INFO.active, .chip.sev-UNKNOWN.active { background: rgba(107,120,133,.20); border-color: rgba(107,120,133,.50); color: #a9b4bf; }
.chip.sev-CRITICAL.active .c, .chip.sev-HIGH.active .c, .chip.sev-MEDIUM.active .c,
.chip.sev-LOW.active .c, .chip.sev-INFO.active .c, .chip.sev-UNKNOWN.active .c { color: inherit; }

.searchbox { position: relative; flex: 1; min-width: 190px; max-width: 340px; }
.searchbox input[type=text] { padding-right: 30px; }
.searchbox .clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-faint);
  font-size: 17px; line-height: 1; cursor: pointer; padding: 2px 6px; display: none;
}
.searchbox .clear:hover { color: var(--text); }
.searchbox.filled .clear { display: block; }
.filterbar .shown-count { margin-left: auto; white-space: nowrap; }

/* rows hidden by a filter — display:none keeps streaming cheap */
tbody tr.hidden { display: none; }

/* ============================ Data inventory sections ============================ */

.inv-head { font-size: 12.5px; font-weight: 650; margin-bottom: 3px; }
.inv-note { font-size: 10.5px; color: var(--text-faint); margin-bottom: 10px; line-height: 1.5; }
.inv-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ Report viewer ============================ */

.viewer-backdrop {
  position: fixed; inset: 0; background: rgba(2,5,10,.8);
  display: none; align-items: center; justify-content: center; z-index: 120; padding: 20px;
}
.viewer-backdrop.show { display: flex; }
.viewer {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 1180px; height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow); overflow: hidden;
}
.viewer-head {
  padding: 13px 18px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.viewer-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.viewer-head .grow { flex: 1; }
.viewer-head .close {
  background: none; border: none; color: var(--text-faint);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.viewer-head .close:hover { color: var(--text); }
.viewer iframe { flex: 1; width: 100%; border: none; background: #fff; }

@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .app { flex-direction: column; }
  .content { margin-left: 0; }
  .nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); }
  .page-body, .page-head { padding-left: 16px; padding-right: 16px; }
}
