/* Intelligent Audit — design tokens
   Page: gradient #0f5b73 → #1581a3 · Cards & buttons: #093442 · Text: white
   Amber is reserved for scores, so the eye goes to the numbers that matter. */
:root {
  --bg-from: #0f5b73; --bg-to: #1581a3; --card: #093442; --card-2: #0c4255;
  --text: #ffffff; --muted: rgba(255,255,255,.72); --faint: rgba(255,255,255,.16); --line: rgba(255,255,255,.12);
  --score: #f2b134; --good: #3fb68b; --warn: #f2b134; --bad: #e5484d; --link: #a9e4f2;
  --radius-lg: 14px; --radius-sm: 8px;
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background: linear-gradient(160deg, var(--bg-from) 0%, var(--bg-to) 100%) fixed; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--score); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 30px; letter-spacing: -.01em; } h2 { font-size: 21px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; max-width: 78ch; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 28px; padding: 14px 32px; background: rgba(9,52,66,.55);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.brand { font-weight: 600; font-size: 17px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: var(--radius-sm); }
.nav a:hover, .nav a.active { color: var(--text); background: var(--faint); text-decoration: none; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

main { max-width: 1240px; margin: 0 auto; padding: 32px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 0; }

/* surfaces */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,.06); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 20px; }
.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)); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } main { padding: 20px; } .topbar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; } }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--card); color: var(--text);
  border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius-sm); padding: 9px 16px; font: inherit;
  font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--text); text-decoration: none; }
.btn.strong { border-color: var(--score); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(229,72,77,.7); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=number],
select, textarea { width: 100%; background: rgba(255,255,255,.06); color: var(--text); border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; }
select option { color: #093442; }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(255,255,255,.45); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--faint); color: var(--text); white-space: nowrap; }
.badge.good { background: rgba(63,182,139,.22); color: #8fe3c2; }
.badge.warn { background: rgba(242,177,52,.2); color: #f7cd78; }
.badge.bad { background: rgba(229,72,77,.22); color: #ff9da0; }
.badge.level { border: 1px solid rgba(255,255,255,.35); background: transparent; }
.tier { font-weight: 600; font-variant-numeric: tabular-nums; }

/* flash */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; background: var(--card);
  border-left: 4px solid var(--good); }
.flash.error { border-left-color: var(--bad); }

/* signature: the 360 score ring */
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { display: block; }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.ring .val b { display: block; font-size: 30px; font-weight: 600; color: var(--score); font-variant-numeric: tabular-nums; }
.ring .val span { font-size: 11.5px; color: var(--muted); }
.ring.sm .val b { font-size: 17px; }
.score { color: var(--score); font-weight: 600; font-variant-numeric: tabular-nums; }

/* audit header */
.audit-head { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
@media (max-width: 900px) { .audit-head { grid-template-columns: 1fr; } }
.audit-head .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 260px; }
.progress { height: 8px; background: var(--faint); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.progress > div { height: 100%; background: var(--score); transition: width .6s ease; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 8px 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--score); text-decoration: none; }
.tab { display: none; } .tab.active { display: block; }

/* dimension cards */
.dim { background: var(--card-2); border-radius: var(--radius-sm); padding: 16px 18px; }
.dim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dim-head .score { font-size: 24px; }
.meter { height: 5px; border-radius: 999px; background: var(--faint); margin: 8px 0 10px; }
.meter > div { height: 100%; border-radius: 999px; background: var(--score); }
.findings { margin: 8px 0 0; padding-left: 18px; } .findings li { margin-bottom: 6px; }
details summary { cursor: pointer; color: var(--link); font-size: 13.5px; }
.stage-list { columns: 2; column-gap: 32px; font-size: 13.5px; list-style: none; padding: 0; margin: 0; }
.stage-list li { break-inside: avoid; padding: 3px 0; display: flex; justify-content: space-between; gap: 8px; }
@media (max-width: 900px) { .stage-list { columns: 1; } }

.chart svg { width: 100%; height: auto; max-width: 520px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.login-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; }
.login { width: 100%; max-width: 400px; }
pre.source-text { white-space: pre-wrap; font-family: var(--font); font-size: 14px; max-height: 70vh; overflow: auto;
  background: rgba(0,0,0,.18); padding: 16px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
