/* Minimal styling for the demo UI.
Harden by avoiding inline styles so CSP can be tightened and by serving assets with caching.
Bug tip: keep layout responsive and test mobile widths early. */
/* app/static/css/app.css */
/* Minimal styling for the demo UI. Harden by avoiding inline styles so CSP can be tightened and by serving assets with caching. Bug tip: keep layout responsive and test mobile widths early. */

:root{
  --border:#e5e7eb;
  --bg:#ffffff;
  --bg2:#f7f7f7;
  --text:#111827;
  --muted:#6b7280;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  background:#fafafa;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.4;
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

.muted{ color:var(--muted); }
.mono{ font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; }

.h1{ margin:0 0 6px 0; font-size:28px; letter-spacing:-0.2px; }
.h2{ margin:0 0 10px 0; font-size:18px; letter-spacing:-0.1px; }

/* Layout */
.container{ padding:18px; max-width:1000px; margin:0 auto; }
.footer{
  padding:14px 18px;
  border-top:1px solid var(--border);
  background:var(--bg);
}

/* Topbar */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:var(--bg);
  position:sticky;
  top:0;
  z-index:10;
}
.topbar__left{ display:flex; align-items:center; gap:14px; }
.topbar__right{ display:flex; align-items:center; gap:10px; }
.brand{ font-weight:800; letter-spacing:.2px; }

.nav{ display:flex; gap:10px; }
.nav__link{
  padding:6px 10px;
  border-radius:10px;
}
.nav__link:hover{ background:#f3f4f6; }

/* Cards & grids */
.card{
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
}

.grid{
  display:grid;
  gap:12px;
  grid-template-columns:1fr;
  margin-bottom:12px;
}
.grid--2{ grid-template-columns:1fr; }
@media (min-width:860px){
  .grid{ grid-template-columns:1fr 1fr; }
  .grid--2{ grid-template-columns:1fr 1fr; }
}

.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:14px;
}
.page-head__actions{ display:flex; gap:10px; flex-wrap:wrap; }

.row{ display:flex; align-items:center; gap:10px; }
.row--space{ justify-content:space-between; }

/* Forms */
.form{ display:flex; flex-direction:column; }
.label{ margin-top:10px; font-weight:600; }
.input,.select{
  padding:10px;
  margin-top:6px;
  width:100%;
  max-width:520px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  outline:none;
}
.input:focus,.select:focus{
  border-color:#cbd5e1;
  box-shadow:0 0 0 3px rgba(59,130,246,.12);
}
.hint{ margin:8px 0 0; font-size:13px; color:var(--muted); }

.checkbox{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:12px;
  user-select:none;
}
.checkbox input{ width:auto; }

/* Buttons */
.btn{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#111827;
  color:#fff;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{ opacity:.92; }
.btn--ghost{
  background:#fff;
  color:#111827;
}
.btn--ghost:hover{ background:#f3f4f6; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* Chips (status & severity) */
.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.chip--muted{ background:#f3f4f6; color:#374151; }
.chip--good{ background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }
.chip--warn{ background:#fffbeb; border-color:#fcd34d; color:#92400e; }
.chip--bad{ background:#fef2f2; border-color:#fecaca; color:#991b1b; }

/* Flashes */
.flashes{ margin:12px 0; }
.flash{
  padding:10px;
  border:1px solid var(--border);
  border-radius:12px;
  margin:6px 0;
  background:#fff;
}
.flash--success{ border-color:#a7f3d0; }
.flash--error{ border-color:#fecaca; }

/* Dashboard table (responsive) */
.table{
  display:block;
  width:100%;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
}
.table__head,.table__row{
  display:grid;
  grid-template-columns:90px 1fr 160px 120px 180px;
  gap:10px;
  padding:12px;
  align-items:center;
}
.table__head{
  background:#f3f4f6;
  font-weight:800;
  font-size:12px;
  color:#374151;
}
.table__row{
  background:#fff;
  border-top:1px solid var(--border);
}
.table__row:hover{ background:#fafafa; }

@media (max-width:860px){
  .table__head{ display:none; }
  .table__row{
    grid-template-columns:1fr;
    gap:6px;
  }
}

/* Lists */
.bullets{ margin:0; padding-left:18px; }
.bullets li{ margin:6px 0; }
.empty{ padding:14px; }

/* Auth pages */
.auth{
  display:flex;
  justify-content:center;
  padding-top:30px;
}
.auth .card{ width:100%; max-width:520px; }

/* Timeline (New + Report) */
.timeline{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:10px;
}
.timeline--static .step{ opacity:.95; }
.step{ display:flex; gap:10px; align-items:flex-start; }
.step .dot{
  width:12px;
  height:12px;
  border-radius:999px;
  margin-top:4px;
  border:2px solid #9ca3af;
  background:#fff;
  flex:0 0 auto;
}
.step.is-done .dot{ border-color:#10b981; background:#10b981; }
.step.is-active .dot{ border-color:#f59e0b; background:#f59e0b; }
.step.is-todo .dot{ border-color:#9ca3af; background:#fff; }
.step .content .title{ font-weight:800; }
.step .content .muted{ font-size:13px; }

/* Callout box */
.callout{
  margin-top:12px;
  padding:10px;
  border-radius:12px;
  border:1px dashed #d1d5db;
  background:#fafafa;
}

/* Report summary stats */
.stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin-top:8px;
}
.stat{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  background:#fff;
}
.stat__value{ font-size:22px; font-weight:900; margin-top:4px; }

/* Findings list */
.findings{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}
.finding{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.finding__head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.finding__title{ font-weight:900; }
.finding__detail{
  margin-top:8px;
  white-space:pre-wrap;
  color:#111827;
}

/* Severity chips */
.sev{ text-transform:uppercase; letter-spacing:.4px; }
.sev--high{ background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.sev--medium{ background:#fffbeb; border-color:#fcd34d; color:#92400e; }
.sev--low{ background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
.sev--info{ background:#f3f4f6; border-color:#e5e7eb; color:#374151; }

/* Raw JSON */
.report{
  background:var(--bg2);
  padding:12px;
  border-radius:12px;
  overflow:auto;
  border:1px solid var(--border);
}
.raw{ margin-top:12px; }
.raw summary{ cursor:pointer; }

/* Print (PDF export via print dialog) */
@media print{
  .topbar, .footer, .page-head__actions, .raw summary { display:none !important; }
  body{ background:#fff; }
  .card{ box-shadow:none; }
}

/* =========================
   Report v2 (2×2 equal cards)
   Harden: avoid inline styles so CSP can be tightened.
   Bug tip: keep fixed card heights responsive; test small screens.
========================= */

.report-shell { max-width: 1100px; margin: 0 auto; padding: 18px; }

.report-head{
  display:flex;
  gap:14px;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:14px;
}

.report-head__left{ flex:1 1 auto; min-width: 320px; }
.report-head__right{ flex:0 0 360px; display:flex; flex-direction:column; gap:10px; }

.breadcrumbs{ font-size:13px; margin-bottom:10px; }
.report-title{ margin:0 0 6px 0; font-size:36px; letter-spacing:-0.6px; }

.report-meta{ display:flex; flex-direction:column; gap:8px; }
.report-meta__row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.report-actions{ margin-top:10px; display:flex; gap:10px; flex-wrap:wrap; }

.report-kpis{
  background: var(--bg);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
  align-items:start;
}

.kpi{ border-right:1px solid var(--border); padding-right:10px; }
.kpi:last-child{ border-right:none; padding-right:0; }
.kpi__label{ font-size:12px; }
.kpi__value{ font-size:28px; font-weight:900; margin-top:6px; }

.report-http{ align-self:flex-end; }

.report-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}

.report-col{
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* Desktop: 2 columns, left stacks 2 cards, right stacks 2 cards */
@media (min-width: 980px){
  .report-grid{ grid-template-columns: 1fr 1fr; }
}

/* Equal cards */
.report-card{
  background: var(--bg);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
  overflow:hidden;
  min-height: 310px;
  display:flex;
  flex-direction:column;
}

.report-card__head{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: #fbfbfb;
}

.report-card__title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
}

.icon-chip{
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  font-size:14px;
}

/* Scroll both ways (vertical + horizontal) */
.report-card__body{
  padding:12px 14px;
  flex:1 1 auto;
}

.scrollbox{
  overflow:auto;              /* both axes */
  overscroll-behavior:contain;
}

/* Safe text rendering */
.pre{
  margin:0;
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:13px;
  line-height:1.45;
}

.pre--wrap{
  white-space:pre-wrap;       /* keeps readability */
  word-break:break-word;
}

/* Raw JSON block */
.raw--report{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px 14px;
  background:#fff;
}
.raw--report summary{ cursor:pointer; }

/* Slightly larger report title on big screens */
@media (min-width: 980px){
  .report-title{ font-size:44px; }
}

