/* BlackboxEDR Job Report — theme: black + red + white, mobile-first. */
:root {
  --ink: #141414;
  --ink-2: #2a2a2a;
  --red: #d81e26;
  --red-dark: #b3171e;
  --paper: #ffffff;
  --bg: #f4f4f5;
  --line: #e4e4e7;
  --muted: #6b7280;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  font-size: 16px;
}
a { color: var(--red); }
.hidden { display: none !important; }

/* ---------- Layout shell ---------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.page { background: var(--paper); border-top: 4px solid var(--red); border-bottom: 4px solid var(--red); }

/* ---------- Header ---------- */
.masthead { padding: 18px 16px 14px; border-bottom: 3px solid var(--red); }
.masthead-inner { max-width: 1060px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; gap: 4px; }
.brand img { height: 46px; width: auto; display: block; }
.brand small { font-weight: 700; letter-spacing: .02em; color: var(--ink); font-size: 12.5px; }
.contact { text-align: right; font-size: 14px; font-weight: 700; color: var(--ink); }
.contact div { display: flex; align-items: center; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.contact .ico { color: var(--ink); }

/* top utility nav (right of header) */
.topnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topnav .who { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Page title ---------- */
.title { text-align: center; padding: 22px 0 6px; }
.title .badge {
  width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-right: 10px;
}
.title h1 { display: inline; font-size: 26px; letter-spacing: .06em; font-weight: 800; text-transform: uppercase; margin: 0; }
.title p { color: var(--muted); margin: 8px 0 0; font-size: 15px; }

/* ---------- Cards / sections ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; padding: 16px 0 8px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head { background: var(--ink); color: #fff; padding: 11px 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 14.5px; display: flex; align-items: baseline; gap: 8px; }
.card-head .num { color: var(--red); font-weight: 900; }
.card-head .hint { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; color: #c9c9c9; font-size: 12.5px; }
.card-body { padding: 16px; }

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-8 { grid-column: span 8; }
.col-3 { grid-column: span 3; }

/* ---------- Form controls ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field:last-child { margin-bottom: 0; }
.lab { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.lab .opt { color: var(--muted); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #cfcfd4; border-radius: 8px; font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(216,30,38,.15); }
textarea { resize: vertical; min-height: 92px; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.money { position: relative; }
.money::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.money input { padding-left: 26px; }

/* radio rows */
.radio-list { display: flex; flex-direction: column; gap: 2px; }
.radio-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.radio-row:hover { background: #faf5f5; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.radio-row .stars { color: var(--red); letter-spacing: 2px; width: 84px; flex: none; }
.radio-row .lbl { font-weight: 600; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-weight: 700; padding: 10px 16px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: var(--red-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #000; }
.btn-ghost { background: #fff; color: var(--ink); border-color: #cfcfd4; }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-submit { width: 100%; font-size: 18px; padding: 16px; text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 18px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #fff; text-align: center; padding: 14px; font-weight: 700; letter-spacing: .03em; font-size: 14px; }
.footer .sep { color: var(--red); margin: 0 10px; }

/* ---------- Alerts / toasts ---------- */
.alert { padding: 11px 14px; border-radius: 8px; font-weight: 600; margin-bottom: 14px; }
.alert-error { background: #fdecec; color: var(--bad); border: 1px solid #f5c2c2; }
.alert-ok { background: #eaf7ee; color: var(--good); border: 1px solid #bfe3cb; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 700; z-index: 60; max-width: 92vw; }
.toast.ok { background: var(--good); }
.toast.err { background: var(--bad); }

/* ---------- Login ---------- */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.12); border-top: 5px solid var(--red); overflow: hidden; }
.login-card .lc-head { text-align: center; padding: 26px 24px 6px; }
.login-card .lc-head img { height: 44px; }
.login-card .lc-body { padding: 8px 24px 26px; }
.login-card h2 { text-align: center; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; margin: 6px 0 16px; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 6px; }
.dash-head h1 { font-size: 22px; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 8px 0 4px; flex-wrap: wrap; }
.tab { padding: 10px 16px; font-weight: 700; cursor: pointer; border: none; background: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--ink); border-bottom-color: var(--red); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.kpi .k-val { font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi .k-val.red { color: var(--red); }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 12px 0; box-shadow: var(--shadow); }
.filters .f { display: flex; flex-direction: column; gap: 4px; }
.filters .f .lab { margin: 0; font-size: 12px; }
.filters input, .filters select { padding: 8px 10px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 14px 0; overflow: hidden; }
.panel-head { padding: 12px 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 14px 16px; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: pointer; user-select: none; }
table.data tbody tr:hover { background: #faf5f5; }
table.data td.num, table.data th.num { text-align: right; }
.profit-pos { color: var(--good); font-weight: 700; }
.profit-neg { color: var(--bad); font-weight: 700; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill.yes { background: #eaf7ee; color: var(--good); }
.pill.maybe { background: #fef6e7; color: var(--warn); }
.pill.no { background: #fdecec; color: var(--bad); }
.table-scroll { overflow-x: auto; }

/* bar chart (pure CSS) */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { background: #f0f0f1; border-radius: 6px; height: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--red); border-radius: 6px; }
.bar-fill.ink { background: var(--ink); }
.bar-val { font-weight: 700; font-variant-numeric: tabular-nums; }

/* AI box */
.ai-answer { background: #fafafa; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 12px; line-height: 1.6; }
.ai-answer table { border-collapse: collapse; margin: 8px 0; }
.ai-answer th, .ai-answer td { border: 1px solid var(--line); padding: 5px 9px; font-size: 13px; }
.ai-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: #f0f0f1; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.modal { background: #fff; border-radius: 12px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; }
.modal-head .x { margin-left: auto; cursor: pointer; background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 6px; }
code.temp { background: #111; color: #ffd; padding: 4px 8px; border-radius: 6px; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .col-6, .col-4, .col-8, .col-3 { grid-column: span 12; }
  .charts { grid-template-columns: 1fr; }
  .contact { text-align: left; }
  .contact div { justify-content: flex-start; }
  .masthead-inner { gap: 10px; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .title h1 { font-size: 21px; }
  .brand img { height: 38px; }
  .grid { gap: 12px; }
  .card-body { padding: 13px; }
  .bar-row { grid-template-columns: 96px 1fr auto; }
  .kpi .k-val { font-size: 22px; }
}
