/* HexaMind — UI kit for design mockups (web + mobile). Requires brand.css. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--hx-bg); color: var(--hx-text); font-family: var(--hx-font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.num, .tabular { font-variant-numeric: tabular-nums; font-family: var(--hx-font-en); }
.en { font-family: var(--hx-font-en); direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--hx-muted); } .faint { color: var(--hx-faint); }
.small { font-size: 12px; } .xs { font-size: 11px; }
.bold { font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.8; flex-shrink: 0; }

/* ---------- App shell (web) ---------- */
.app { display: grid; grid-template-columns: 256px 1fr; width: 100vw; height: 100vh; overflow: hidden; }
.sidebar { background: var(--hx-ink); color: #C9D1E6; display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 36px; height: 36px; background: #fff; border-radius: 10px; padding: 3px; }
.brand .name { font-family: var(--hx-font-en); font-weight: 700; font-size: 17px; color: #fff; letter-spacing: .2px; line-height: 1.1; }
.brand .sub { font-size: 11px; color: #8E9AB8; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #6F7C9C; padding: 12px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: #C9D1E6; font-size: 13.5px; text-decoration: none; position: relative; }
.nav-item svg.lucide { width: 17px; height: 17px; color: #8E9AB8; }
.nav-item.active { background: rgba(51, 70, 211, .28); color: #fff; }
.nav-item.active svg.lucide { color: var(--hx-teal-500); }
.nav-item.active::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--hx-teal-500); }
.nav-item .count { margin-inline-start: auto; background: var(--hx-critical); color: #fff; font-size: 10.5px; font-weight: 600; border-radius: 10px; padding: 0 7px; font-family: var(--hx-font-en); }
.nav-item .tag { margin-inline-start: auto; font-size: 9.5px; color: var(--hx-teal-500); border: 1px solid rgba(15,181,166,.5); border-radius: 6px; padding: 0 5px; font-family: var(--hx-font-en); }
.sidebar .spacer { flex: 1; }
.sidebar .org { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--hx-ink-2); font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { height: 64px; background: var(--hx-surface); border-bottom: 1px solid var(--hx-border); display: flex; align-items: center; gap: 14px; padding: 0 24px; flex-shrink: 0; }
.topbar .crumbs { font-size: 12px; color: var(--hx-muted); }
.topbar .title { font-size: 16px; font-weight: 600; }
.search { flex: 1; max-width: 460px; margin-inline-start: auto; display: flex; align-items: center; gap: 8px; background: var(--hx-bg); border: 1px solid var(--hx-border); border-radius: 10px; padding: 8px 12px; color: var(--hx-faint); font-size: 13px; }
.search kbd { margin-inline-start: auto; font-family: var(--hx-font-en); font-size: 11px; border: 1px solid var(--hx-border); border-radius: 5px; padding: 0 5px; background: #fff; }
.role-chip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--hx-border); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; font-weight: 500; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--hx-border); display: grid; place-items: center; position: relative; color: var(--hx-text-2); background: #fff; }
.icon-btn .dot { position: absolute; top: 8px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--hx-critical); border: 2px solid #fff; }
.content { flex: 1; overflow: hidden; padding: 18px 24px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 22px; font-weight: 700; line-height: 1.25; }
.page-head p { color: var(--hx-muted); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-5 { grid-template-columns: repeat(5, 1fr); }
.g-12 { grid-template-columns: repeat(12, 1fr); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }

/* ---------- Cards ---------- */
.card { background: var(--hx-surface); border: 1px solid var(--hx-border); border-radius: var(--hx-radius); padding: 16px 18px; box-shadow: var(--hx-shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head .link { font-size: 12.5px; color: var(--hx-indigo-500); font-weight: 500; }

.kpi .label { color: var(--hx-muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-family: var(--hx-font-en); font-size: 28px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 15px; color: var(--hx-muted); font-weight: 500; }
.kpi .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--hx-muted); }
.kpi .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--hx-indigo-50); color: var(--hx-indigo-500); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 500; border: 1px solid var(--hx-border-strong); background: #fff; color: var(--hx-text); white-space: nowrap; font-family: inherit; }
.btn svg.lucide { width: 16px; height: 16px; }
.btn-primary { background: var(--hx-indigo-500); border-color: var(--hx-indigo-500); color: #fff; }
.btn-teal { background: var(--hx-teal-500); border-color: var(--hx-teal-500); color: #fff; }
.btn-ai { background: var(--hx-ai-grad); border: 0; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--hx-text-2); }
.btn-danger { color: var(--hx-critical); border-color: #F3C2C2; background: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 11px 18px; font-size: 14px; }

/* ---------- Chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.nodot::before { display: none; }
.chip.ok { background: var(--hx-success-bg); color: var(--hx-success); }
.chip.warn { background: var(--hx-warning-bg); color: var(--hx-warning); }
.chip.crit { background: var(--hx-critical-bg); color: var(--hx-critical); }
.chip.info { background: var(--hx-info-bg); color: var(--hx-info); }
.chip.indigo { background: var(--hx-indigo-50); color: var(--hx-indigo-500); }
.chip.teal { background: var(--hx-teal-50); color: var(--hx-teal-600); }
.chip.neutral { background: #EEF1F6; color: var(--hx-muted); }
.delta { font-family: var(--hx-font-en); font-size: 12px; font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.delta.up { color: var(--hx-success); } .delta.down { color: var(--hx-critical); }

/* ---------- AI elements ---------- */
.ai-card { position: relative; border-radius: var(--hx-radius); padding: 16px 18px; background: var(--hx-ai-bg); border: 1px solid var(--hx-indigo-100); }
.ai-card .ai-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.ai-badge { width: 28px; height: 28px; border-radius: 8px; background: var(--hx-ai-grad); color: #fff; display: grid; place-items: center; }
.ai-badge svg.lucide { width: 16px; height: 16px; }
.ai-sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--hx-muted); margin-top: 10px; }
.ai-sources .src { background: #fff; border: 1px solid var(--hx-border); border-radius: 6px; padding: 1px 7px; }
.ai-note { font-size: 11.5px; color: var(--hx-muted); display: flex; align-items: center; gap: 6px; }
.human-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--hx-teal-700); background: var(--hx-teal-50); border-radius: 6px; padding: 2px 8px; font-weight: 500; }

/* ---------- Tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: start; font-weight: 500; color: var(--hx-muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--hx-border); background: #FAFBFD; white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--hx-border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .id { font-family: var(--hx-font-en); color: var(--hx-muted); font-size: 12px; }

/* ---------- Progress ---------- */
.progress { height: 6px; background: #EDF0F6; border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--hx-indigo-500); border-radius: 6px; }
.progress.ok > span { background: var(--hx-success); }
.progress.warn > span { background: var(--hx-warning); }
.progress.crit > span { background: var(--hx-critical); }
.progress.teal > span { background: var(--hx-teal-500); }

/* ---------- Stepper (7-step decision method) ---------- */
.stepper { display: flex; align-items: flex-start; gap: 0; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; position: relative; font-size: 12px; color: var(--hx-muted); }
.step .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--hx-font-en); font-weight: 600; background: #fff; border: 2px solid var(--hx-border-strong); color: var(--hx-muted); z-index: 1; }
.step::after { content: ""; position: absolute; top: 15px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--hx-border-strong); }
.step:last-child::after { display: none; }
.step.done .dot { background: var(--hx-teal-500); border-color: var(--hx-teal-500); color: #fff; }
.step.done::after { background: var(--hx-teal-500); }
.step.current .dot { background: var(--hx-indigo-500); border-color: var(--hx-indigo-500); color: #fff; box-shadow: 0 0 0 5px var(--hx-indigo-100); }
.step.current { color: var(--hx-text); font-weight: 600; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--hx-text-2); }
.field .hint { font-size: 11.5px; color: var(--hx-faint); }
.input, .select, .textarea { border: 1px solid var(--hx-border-strong); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; background: #fff; color: var(--hx-text); font-family: inherit; display: flex; align-items: center; gap: 8px; min-height: 40px; }
.select::after { content: "⌄"; margin-inline-start: auto; color: var(--hx-faint); }
.textarea { min-height: 84px; align-items: flex-start; line-height: 1.6; }
.input.focus { border-color: var(--hx-indigo-500); box-shadow: 0 0 0 3px var(--hx-indigo-100); }
.placeholder { color: var(--hx-faint); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hx-border); }
.tab { padding: 9px 14px; font-size: 13px; color: var(--hx-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--hx-indigo-500); border-color: var(--hx-indigo-500); font-weight: 600; }
.seg { display: inline-flex; background: #EDF0F6; border-radius: 10px; padding: 3px; gap: 2px; }
.seg span { padding: 5px 12px; border-radius: 8px; font-size: 12.5px; color: var(--hx-muted); }
.seg span.on { background: #fff; color: var(--hx-text); font-weight: 600; box-shadow: var(--hx-shadow-sm); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hx-border); }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 500; font-size: 13.5px; }
.list-item .s { font-size: 12px; color: var(--hx-muted); }
.lead-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.lead-ico.indigo { background: var(--hx-indigo-50); color: var(--hx-indigo-500); }
.lead-ico.teal { background: var(--hx-teal-50); color: var(--hx-teal-600); }
.lead-ico.warn { background: var(--hx-warning-bg); color: var(--hx-warning); }
.lead-ico.crit { background: var(--hx-critical-bg); color: var(--hx-critical); }
.lead-ico.ok { background: var(--hx-success-bg); color: var(--hx-success); }

/* ---------- Avatars ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--hx-indigo-500); flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.teal { background: var(--hx-teal-500); } .avatar.ink { background: var(--hx-ink-3); } .avatar.amber { background: #C2851B; }
.avatars { display: flex; } .avatars .avatar { border: 2px solid #fff; margin-inline-start: -8px; } .avatars .avatar:first-child { margin-inline-start: 0; }

/* ---------- Risk heat matrix ---------- */
.heat { display: grid; grid-template-columns: 28px repeat(5, 1fr); gap: 4px; font-size: 11px; }
.heat .c { aspect-ratio: 1.6; border-radius: 6px; display: grid; place-items: center; font-family: var(--hx-font-en); font-weight: 600; font-size: 13px; }
.heat .l1 { background: #E8F7EE; color: #15803D; } .heat .l2 { background: #D9F2C9; color: #4D7C0F; }
.heat .l3 { background: #FEF3C7; color: #B45309; } .heat .l4 { background: #FED7AA; color: #C2410C; }
.heat .l5 { background: #FECACA; color: #B91C1C; }
.heat .ax { display: grid; place-items: center; color: var(--hx-muted); }

/* ---------- Mobile shell ---------- */
body.mobile { width: 390px; height: 844px; overflow: hidden; background: var(--hx-bg); margin: 0 auto 0 0; } /* headless Chrome keeps a wider window; pin the phone frame to the left edge */
.m-status { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-family: var(--hx-font-en); font-weight: 600; font-size: 14px; direction: ltr; }
.m-header { display: flex; align-items: center; gap: 10px; padding: 6px 18px 12px; }
.m-header h1 { font-size: 20px; font-weight: 700; }
.m-content { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.m-tabbar { position: absolute; bottom: 0; left: 0; right: 0; height: 84px; background: #fff; border-top: 1px solid var(--hx-border); display: flex; justify-content: space-around; padding-top: 10px; }
.m-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--hx-faint); }
.m-tab.active { color: var(--hx-indigo-500); font-weight: 600; }
.m-tab svg.lucide { width: 22px; height: 22px; }
.m-tab .fab { width: 46px; height: 46px; border-radius: 15px; background: var(--hx-ai-grad); color: #fff; display: grid; place-items: center; margin-top: -18px; box-shadow: var(--hx-shadow-lg); }
body.mobile .card { padding: 14px; border-radius: 14px; }
