@font-face { font-family: 'FbEinstein'; src: url('/brand/fonts/FbEinsteinHebEng-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'FbEinstein'; src: url('/brand/fonts/FbEinsteinHebEng-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --bg: #f4f6f9;
  --card: #fff;
  --ink: #16202e;
  --muted: #5f6c7e;
  --line: #e1e6ee;
  --brand: #1C0D4D;      /* BG purple */
  --brand-2: #4A3A8C;
  --brand-soft: #ECE9F4;
  --accent: #FC5100;     /* BG orange */
  --ok: #1f7a4d;
  --ok-soft: #e6f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff4dc;
  --bad: #b4232c;
  --bad-soft: #fdecee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'FbEinstein', 'Assistant', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 15.5px; line-height: 1.5; }
a { color: var(--brand); }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.2px; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16.5px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.pad { padding: 40px; text-align: center; }
.small { font-size: 13.5px; }

.appbar { background: #1C0D4D; color: #fff; position: sticky; top: 0; z-index: 30; }
.appbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; height: 54px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: #fff; font-weight: 800; text-decoration: none; font-size: 18px; }
.appbar nav { display: flex; gap: 18px; align-items: center; }
.appbar nav a, .appbar .link { color: #d6e4f5; text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.appbar nav a:hover, .appbar .link:hover { color: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.crumb { font-size: 14px; margin-bottom: 6px; display: inline-block; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.btn { appearance: none; border: 1px solid transparent; border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; background: var(--brand); color: #fff; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; min-height: 38px; }
.btn:hover { background: #2B1A66; }
.btn.ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); background: #fff; }
.btn.danger { background: #fff; color: var(--bad); border-color: #f1c4c8; }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #FDA77E; outline-offset: 1px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; border-radius: 99px; padding: 1px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.published, .badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.closed { background: #eceff3; color: var(--muted); }
.badge.demo { background: #f2e9fb; color: #6b3fa0; }
.badge.master { background: var(--brand-soft); color: var(--brand); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi .v { font-size: 28px; font-weight: 800; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 13.5px; }

.linkbox { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.linkbox code { direction: ltr; background: #f1f4f8; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; word-break: break-all; flex: 1; min-width: 220px; user-select: all; }
.qr svg { width: 112px; height: 112px; display: block; }

.bar { height: 10px; background: #edf1f6; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.score { font-weight: 800; }
.heat td.cell { text-align: center; font-weight: 700; border-radius: 6px; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13.5px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; font: inherit; color: inherit; border: 1px solid #cfd7e3; border-radius: 8px; padding: 7px 10px; background: #fff;
}
textarea { resize: vertical; min-height: 64px; }
input:disabled, select:disabled, textarea:disabled { background: #f6f8fb; color: #3b4656; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { flex: 0 0 auto; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; white-space: nowrap; }

.banner { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.banner.info { background: var(--brand-soft); color: var(--brand); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner ul { margin: 6px 0 0; padding-inline-start: 20px; font-weight: 400; }

/* editor */
.section-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: #fbfcfe; }
.section-top { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; margin-bottom: 10px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.item-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.item-top .id { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: #eef2f7; border-radius: 6px; padding: 2px 6px; direction: ltr; }
.item-top select { width: auto; }
.item-top .spacer { flex: 1; }
.item textarea { min-height: 44px; }
.item-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.item-meta select { width: auto; max-width: 320px; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; margin-top: 8px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; min-width: 30px; height: 30px; cursor: pointer; font-size: 14px; color: var(--muted); }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.scale-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; margin-bottom: 6px; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1C0D4D; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: .2s; pointer-events: none; z-index: 100; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 25, 40, .45); }
dialog .dlg { padding: 20px; }
dialog .dlg-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 16px; }

.login { max-width: 380px; margin: 10vh auto; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* report */
.report { background: #fff; max-width: 920px; margin: 0 auto; padding: 36px 40px; border-radius: 14px; box-shadow: var(--shadow); }
.report .cover { border-bottom: 3px solid var(--accent); padding-bottom: 16px; margin-bottom: 22px; }
.report .cover .kicker { color: var(--accent); font-weight: 800; letter-spacing: .3px; }
.report h2 { margin-top: 26px; color: #1C0D4D; }
.report p { margin: 0 0 10px; }
.report .finding { border-inline-start: 4px solid var(--brand-2); padding: 4px 14px; margin-bottom: 12px; }
.report .finding .ev { color: var(--muted); font-size: 14px; }
.report .quote { background: #f6f8fb; border-radius: 8px; padding: 8px 12px; margin: 6px 0 0; font-style: italic; }
.report .footer { margin-top: 30px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 10px; }
.chart-box { position: relative; width: 100%; }
.prio { font-weight: 800; }
.prio.h { color: var(--bad); }
.prio.m { color: var(--warn); }
.prio.l { color: var(--muted); }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .report { box-shadow: none; padding: 0; max-width: none; }
  .report h2 { break-after: avoid; }
  .finding, tr, .chart-box { break-inside: avoid; }
}

/* BG brand */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { height: 26px; width: auto; display: block; }
.report .cover-logo { height: 46px; width: auto; display: block; margin-bottom: 14px; }
.login .login-logo { height: 52px; width: auto; display: block; margin-bottom: 14px; }
