@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/noto-sans-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/noto-sans-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  color-scheme: dark;
  --bg: #080b10;
  --bg-raise: #111821;
  --bg-sunken: #0c1219;
  --line: #243140;
  --line-strong: #3d5166;
  --text: #e6eef6;
  --muted: #93a3b5;
  --cyan: #6ee7d2;
  --cyan-deep: #123f3c;
  --amber: #e2b15a;
  --amber-deep: #3a2d14;
  --red: #f08a90;
  --red-deep: #3d1c22;
  --good: #8fd6ae;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --font: "Noto Sans Arabic", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Noto Sans Arabic", ui-monospace, "Cascadia Code", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(110, 231, 210, 0.08), transparent 55%),
    linear-gradient(180deg, #0c121a 0%, var(--bg) 280px);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), transparent 70%);
}

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #d7fff6; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--cyan);
  color: #04221e;
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 8px; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand a {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-decoration: none;
  font-size: 0.92rem;
}
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: flex-end;
}
.top-actions a { font-size: 0.92rem; }
.top-actions form { margin: 0; }
.team-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--muted);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

h1, h2, h3 { line-height: 1.25; font-weight: 650; }
h1 { margin: 0; font-size: 1.8rem; }
h2 { margin: 0 0 8px; font-size: 1.25rem; }
h3 {
  margin: 22px 0 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lede { color: var(--muted); max-width: 62ch; }
.aside { color: var(--muted); font-size: 0.92rem; }
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.panel {
  background: rgba(17, 24, 33, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.narrow { width: min(520px, 100%); }
.panel + .panel, .report-read { margin-top: 16px; }

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

label, legend {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
}

input, select, textarea, button {
  font: inherit;
  color: var(--text);
}
input, select, textarea {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
}
textarea { resize: vertical; min-height: 96px; unicode-bidi: plaintext; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--cyan);
  color: #04221e;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button.ghost, .button.ghost, a.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.flash, .notice, .errors {
  border-radius: 10px;
  padding: 12px 14px;
}
.flash, .notice { margin: 0 0 16px; }
.notice-awarded, .flash { background: var(--cyan-deep); color: #d9fff6; }
.notice-failed, .notice-warn { background: var(--amber-deep); color: #ffe7bf; }
.notice-pending { background: #1a2430; color: var(--text); }
.errors {
  margin: 0 0 16px;
  background: var(--red-deep);
  color: #ffd7da;
}
.errors li + li { margin-top: 4px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: var(--bg-raise); }
th, td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
tr:last-child td { border-bottom: 0; }

.severity, .status, .type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
}
.severity-low { color: var(--muted); }
.severity-medium { color: #9ecbff; border-color: #29527a; }
.severity-high { color: var(--amber); border-color: #6d5424; }
.severity-critical { color: var(--red); border-color: #7a3038; }
.status-awarded { color: var(--good); border-color: #1f6a45; }
.status-failed { color: var(--amber); border-color: #6d5424; }
.status-pending { color: var(--muted); }
.type-ot { color: #9ecbff; border-color: #29527a; }
.type-it { color: var(--cyan); border-color: #1d5c56; }
.type-mssp { color: var(--amber); border-color: #6d5424; }

.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filters a {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--text);
}
.filters a[aria-current="page"] {
  background: var(--cyan-deep);
  border-color: #1d5c56;
  color: var(--cyan);
}

.ioc-row {
  display: grid;
  grid-template-columns: 150px 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.preserve {
  white-space: pre-wrap;
  unicode-bidi: plaintext;
  margin: 0;
}
.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 16px;
  margin: 14px 0;
}
.meta div { margin: 0; }
.meta dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.meta dd { margin: 2px 0 0; }
.report-read-head, .read-pills {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.read-pills { justify-content: flex-end; flex-wrap: wrap; }
.id-code {
  font-family: var(--mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.word-lock {
  font-family: var(--mono);
  background: var(--bg-sunken);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.field-name { display: block; }
.field-control { position: relative; display: block; }
.hint-bubble {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(380px, 70vw);
  padding: 8px 10px;
  background: #17202b;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 6;
}
.field-control:hover > .hint-bubble,
.field-control:focus-within > .hint-bubble {
  opacity: 1;
  visibility: visible;
}
.hint-above > .hint-bubble,
.tag > .hint-bubble {
  top: auto;
  bottom: calc(100% + 8px);
}

.mitre { position: relative; }
.mitre-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: grid;
  gap: 4px;
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
.mitre-results[hidden] { display: none; }
.mitre-hit, .tag {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: start;
}
.mitre-hit {
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 8px;
  padding: 8px;
  font-weight: 400;
}
.mitre-hit:hover, .mitre-hit:focus-visible { background: #1a2836; }
.tag {
  width: auto;
  background: #13242b;
  border: 1px solid #1d5c56;
  border-radius: 999px;
  padding: 4px 8px 4px 10px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-id, .tag-line {
  font-family: var(--mono);
  color: var(--cyan);
  letter-spacing: 0.04em;
}
.tag-name { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 0.92rem; }
.tag-meta, .tag-line, .mitre-empty {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
}
.tag .ghost { padding: 4px 8px; border-radius: 999px; }
.tag-line { margin-top: 4px; }

@media (max-width: 800px) {
  .topbar, .page-head, .grid-2, .ioc-row, .report-read-head { display: grid; }
  .ioc-row { grid-template-columns: 1fr; }
  .top-actions { justify-content: start; }
}
