/* SAB / Goblin pilot portal — black, white and Goblin red, condensed uppercase headings. */
:root {
  --red: #e3001b;
  --red-dark: #b40015;
  --black: #0d0d0d;
  --ink: #1b1b1b;
  --grey-9: #2a2a2a;
  --grey-7: #555;
  --grey-5: #8a8a8a;
  --grey-3: #d6d6d6;
  --grey-2: #e9e9e9;
  --grey-1: #f4f4f4;
  --white: #fff;
  --green: #1f9d55;
  --amber: #d98a00;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--grey-1); }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--head); text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; margin: 0 0 .5em; color: var(--black); }
h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--grey-5); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.pre { white-space: pre-line; }

/* ---------- Header ---------- */
.topbar { background: var(--black); color: #bbb; font-size: .8rem; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; gap: 12px; }
.topbar a, .topbar button { color: #ddd; }
.topbar form { display: inline; }
.topbar .who { display: flex; gap: 16px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--red); }
.linkbtn:hover { text-decoration: underline; }

.header { background: var(--white); border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: baseline; gap: 10px; color: var(--black); text-decoration: none !important; flex-shrink: 0; }
.logo .word { font-family: var(--head); font-style: italic; font-weight: 800; font-size: 2rem; letter-spacing: .04em; line-height: 1; }
.logo .word span { color: var(--red); }
.logo .tag { font-family: var(--head); font-size: .78rem; text-transform: uppercase; letter-spacing: .18em; color: var(--grey-5); border-left: 1px solid var(--grey-3); padding-left: 10px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 1.02rem; letter-spacing: .05em; color: var(--ink); padding: 23px 12px 20px; border-bottom: 3px solid transparent; margin-bottom: -3px; white-space: nowrap; text-decoration: none; }
.nav a:hover { color: var(--red); }
.nav a.on { color: var(--red); border-bottom-color: var(--red); }
.nav .sep { width: 1px; background: var(--grey-2); margin: 18px 8px; }
.nav-toggle { display: none; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- Page heading band ---------- */
.band { background: linear-gradient(100deg, #111 0%, #1d1d1d 60%, #2a0005 100%); color: var(--white); padding: 34px 0 30px; position: relative; overflow: hidden; }
.band::after { content: ''; position: absolute; right: -60px; top: -40px; width: 340px; height: 260px; background: var(--red); transform: skewX(-24deg); opacity: .9; }
.band .wrap { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.band h1 { color: var(--white); margin: 0; font-size: 2.5rem; }
.band .kicker { font-family: var(--head); text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; color: #ff5a6c; margin-bottom: 6px; }
.band p { margin: 6px 0 0; color: #cfcfcf; }

main { padding: 28px 0 60px; }

/* ---------- Building blocks ---------- */
.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)); }
.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 20px; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; border-top: 3px solid transparent; }
.card.accent { border-top-color: var(--red); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.section-title::before { content: ''; width: 5px; height: 1.1em; background: var(--red); transform: skewX(-15deg); }

.stat { padding: 18px 20px; }
.stat .label { font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--grey-5); }
.stat .value { font-family: var(--head); font-weight: 700; font-size: 2.2rem; line-height: 1.1; color: var(--black); }
.stat .value.red { color: var(--red); }
.stat .sub { font-size: .85rem; color: var(--grey-7); }

.deal { background: var(--black); color: var(--white); position: relative; overflow: hidden; }
.deal::after { content: ''; position: absolute; right: -50px; top: 0; width: 110px; height: 70px; background: var(--red); transform: skewX(-24deg); opacity: .85; }
.deal > * { position: relative; z-index: 1; }
.deal h2, .deal h3 { color: var(--white); }
.deal .big { font-family: var(--head); font-weight: 800; font-size: 4rem; line-height: 1; color: var(--white); }
.deal .big small { font-size: 1.4rem; font-weight: 600; color: #ff5a6c; margin-left: 4px; }
.deal .muted { color: #aaa; }

.meter { height: 12px; background: var(--grey-2); border-radius: 0; overflow: hidden; margin: 10px 0 6px; }
.meter > span { display: block; height: 100%; background: var(--red); transition: width .6s; }
.meter.ok > span { background: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: .98rem; padding: 10px 20px; border: 2px solid var(--red); background: var(--red); color: var(--white); border-radius: var(--radius); cursor: pointer; text-decoration: none !important; transition: background .15s, color .15s; line-height: 1.2; }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.dark { background: var(--black); border-color: var(--black); }
.btn.dark:hover { background: var(--grey-9); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--grey-3); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { padding: 5px 12px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: var(--white); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-block; font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 2px; background: var(--grey-2); color: var(--grey-7); vertical-align: middle; }
.badge.red, .badge.critical { background: var(--red); color: var(--white); }
.badge.high { background: #ffd9dd; color: var(--red-dark); }
.badge.medium { background: #fff1d6; color: #8a5a00; }
.badge.low { background: var(--grey-2); }
.badge.green, .badge.resolved, .badge.active { background: #dff3e7; color: #146c3b; }
.badge.acknowledged { background: #e3ecff; color: #2849a5; }
.badge.open { background: #fff1d6; color: #8a5a00; }
.badge.dark, .badge.admin { background: var(--black); color: var(--white); }
.badge.closed, .badge.cancelled { background: var(--grey-2); color: var(--grey-5); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--grey-5); text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--grey-2); vertical-align: middle; }
tr.is-cancelled td { color: var(--grey-5); text-decoration: line-through; }
tr.is-cancelled td.actions { text-decoration: none; }
td.amount { font-family: var(--head); font-size: 1.1rem; font-weight: 600; white-space: nowrap; text-align: right; }
.amount.plus { color: var(--green); }
.amount.minus { color: var(--red); }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #fafafa; }

/* ---------- Forms ---------- */
label { display: block; font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; font-weight: 600; color: var(--grey-7); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=file], select, textarea {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--grey-3); border-radius: var(--radius); background: var(--white); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(227,0,27,.25); border-color: var(--red); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 16px; }
.fields { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.hint { font-size: .82rem; color: var(--grey-5); margin-top: 4px; }

.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 4px; border: 1px solid var(--grey-2); }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--grey-2); border-radius: var(--radius); cursor: pointer; background: var(--white); text-transform: none; letter-spacing: 0; font-family: var(--body); font-size: .95rem; color: var(--ink); font-weight: 500; margin: 0; }
.pick:has(input:checked) { border-color: var(--red); background: #fff4f5; }
.pick input { accent-color: var(--red); width: 17px; height: 17px; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-left: 4px solid var(--ink); background: var(--white); box-shadow: var(--shadow); margin-bottom: 18px; }
.flash.success { border-color: var(--green); }
.flash.error { border-color: var(--red); background: #fff4f5; }
.flash.warning { border-color: var(--amber); background: #fffaf0; }
.copy-row { display: flex; gap: 8px; margin-top: 8px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--black); color: var(--white); padding: 2px 8px; border-radius: 2px; font-size: 1rem; user-select: all; }

/* ---------- Avatars ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--ink); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; flex-shrink: 0; font-size: .95rem; }
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; }
.avatar.xl { width: 140px; height: 140px; font-size: 2.6rem; border: 4px solid var(--white); box-shadow: var(--shadow); }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.person { display: flex; align-items: center; gap: 10px; }
.person .name { font-weight: 600; color: var(--ink); }

/* ---------- Forum ---------- */
.topics { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.topics a { font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-size: .88rem; padding: 6px 14px; border: 1px solid var(--grey-3); background: var(--white); color: var(--ink); border-radius: 20px; text-decoration: none; }
.topics a.on { background: var(--black); border-color: var(--black); color: var(--white); }
.composer textarea { min-height: 80px; border: 0; border-bottom: 1px solid var(--grey-2); border-radius: 0; padding: 4px 0 10px; font-size: 1.05rem; }
.composer textarea:focus { outline: none; border-color: var(--red); }
.composer .bar { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.composer .bar select { width: auto; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.post { padding: 0; overflow: hidden; }
.post .post-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; gap: 10px; }
.post .post-body { padding: 12px 20px; white-space: pre-line; overflow-wrap: anywhere; }
.post .post-img { max-height: 560px; width: 100%; object-fit: cover; background: var(--grey-2); }
.post .post-actions { display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--grey-2); align-items: center; font-size: .92rem; }
.post .post-actions form { display: inline; }
.like-btn { background: none; border: 0; cursor: pointer; font: inherit; color: var(--grey-7); display: inline-flex; gap: 6px; align-items: center; padding: 0; }
.like-btn.on { color: var(--red); font-weight: 600; }
.comments { background: #fafafa; padding: 12px 20px 16px; border-top: 1px solid var(--grey-2); }
.comment { display: flex; gap: 10px; margin-bottom: 10px; }
.comment .bubble { background: var(--white); border: 1px solid var(--grey-2); border-radius: 12px; padding: 8px 12px; flex: 1; overflow-wrap: anywhere; white-space: pre-line; }
.comment .bubble b { display: block; font-size: .88rem; }
.comment-form { display: flex; gap: 8px; }
.comment-form input { border-radius: 20px; }
.pin { color: var(--red); font-family: var(--head); text-transform: uppercase; font-size: .78rem; letter-spacing: .1em; }

/* ---------- Product-style cards (test models, pilots) ---------- */
.product { background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.product:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.product .img { aspect-ratio: 4 / 3; background: #f7f7f7 center / contain no-repeat; position: relative; border-bottom: 1px solid var(--grey-2); }
.product .img .badge { position: absolute; top: 12px; left: 12px; }
.product .body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.product .code { font-family: var(--head); color: var(--grey-5); font-size: .85rem; letter-spacing: .1em; }
.product h3 { margin: 2px 0 8px; font-size: 1.35rem; }
.product .foot { margin-top: auto; display: flex; justify-content: space-between; font-size: .85rem; color: var(--grey-7); padding-top: 10px; border-top: 1px solid var(--grey-2); }

.pilot-card { text-align: center; padding: 26px 18px; }
.pilot-card .avatar { margin: 0 auto 12px; }
.pilot-card h3 { margin-bottom: 2px; }

.hero-model { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; }
.hero-model .img { background: #f7f7f7 center / contain no-repeat; min-height: 340px; }
.hero-model .info { padding: 28px; }

.report { border-left: 4px solid var(--grey-3); }
.report.sev-critical { border-left-color: var(--red); }
.report.sev-high { border-left-color: #ff6b7c; }
.report.sev-medium { border-left-color: var(--amber); }
.report .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.reply { background: var(--grey-1); border-left: 3px solid var(--black); padding: 10px 14px; margin-top: 12px; }
.report-img { max-height: 320px; margin-top: 10px; border-radius: var(--radius); cursor: zoom-in; }

details.admin-box { margin-top: 12px; border-top: 1px dashed var(--grey-3); padding-top: 10px; }
details.admin-box summary { cursor: pointer; font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: var(--grey-7); }

.empty { text-align: center; padding: 40px 20px; color: var(--grey-5); }
.empty h3 { color: var(--grey-7); }

.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--grey-2); margin-bottom: 20px; overflow-x: auto; }
.tabs a { font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; padding: 10px 16px; color: var(--grey-7); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }

.code-block { background: var(--black); color: #eee; padding: 14px; border-radius: var(--radius); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; overflow-x: auto; white-space: pre; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; background: var(--white); }
.login-art { background: radial-gradient(circle at 70% 30%, #3a0007 0%, #111 55%), #111; color: var(--white); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; left: 72%; top: -10%; width: 220px; height: 130%; background: var(--red); transform: skewX(-22deg); opacity: .92; }
.login-art::before { content: ''; position: absolute; left: calc(72% + 250px); top: -10%; width: 40px; height: 130%; background: var(--red); transform: skewX(-22deg); opacity: .6; }
.login-art > * { position: relative; z-index: 1; }
.login-art .logo { color: var(--white); }
.login-art .logo .tag { border-color: #444; color: #999; }
.login-art h1 { color: var(--white); font-size: 3.6rem; max-width: 9em; text-shadow: 0 2px 20px rgba(0,0,0,.4); }
.login-art h1 span { color: var(--red); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form form { width: 100%; max-width: 360px; }

/* ---------- Footer ---------- */
footer { background: var(--black); color: #9a9a9a; font-size: .85rem; padding: 26px 0; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: #ccc; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side, .hero-model { grid-template-columns: minmax(0, 1fr); }
  .hero-model .img { min-height: 240px; }
}
@media (max-width: 820px) {
  .header .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 0; gap: 4px 16px; }
  .nav { width: 100%; order: 3; }
  .nav a { padding: 10px 10px 9px; }
  .logo .tag { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; padding: 28px; }
  .login-art h1 { font-size: 2.2rem; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .g2, .g3, .g4, .fields, .fields.three { grid-template-columns: minmax(0, 1fr); }
  .band h1 { font-size: 1.9rem; }
  .card { padding: 16px; }
  .topbar .brand-line { display: none; }
}
@media (max-width: 640px) {
  .grid > * { grid-column: auto !important; }
}

/* ---------- Static app additions ---------- */
.loading-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--grey-3); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
button[disabled] { opacity: .6; cursor: progress; }
.busy-note { font-size: .85rem; color: var(--grey-7); margin-left: 8px; }
[hidden] { display: none !important; }
