:root {
  --artifis-red:        #cc2020;
  --artifis-red-dark:   #9e1818;
  --artifis-red-light:  #fdf0f0;
  --artifis-charcoal:   #2e2e2e;
  --artifis-charcoal-mid: #444444;
  --artifis-charcoal-light: #666666;

  --status-pass:        #1a7a4a;
  --status-pass-bg:     #edf7f2;
  --status-pass-border: #a3d9be;
  --status-warn:        #b06000;
  --status-warn-bg:     #fff8ed;
  --status-warn-border: #f5d580;
  --status-block:       #9e1818;
  --status-block-bg:    #fdf0f0;
  --status-block-border:#f5c0c0;

  --surface:            #f8f8f7;
  --surface-card:       #ffffff;
  --border:             #e2e2e0;
  --border-strong:      #cccccc;
  --text:               #2e2e2e;
  --text-secondary:     #555555;
  --text-muted:         #888888;

  --radius:             8px;
  --radius-card:        10px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.6; color: var(--text);
  background: var(--surface);
}
h1, h2, h3, h4 { font-weight: 500; }
a { color: var(--artifis-red); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0f0ef; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ── App shell ─────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--artifis-charcoal); color: #fff;
  flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 18px 18px 10px; }
.brand-mark { display: block; font-weight: 500; letter-spacing: 2px; font-size: 18px; }
.brand-sub { display: block; font-size: 11px; color: #b9b9b9; letter-spacing: 1px; }
.nav { display: flex; flex-direction: column; padding: 6px 0; }
.nav-item {
  color: #ddd; padding: 11px 18px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; border-left: 3px solid transparent;
}
.nav-item:hover { background: #3a3a3a; text-decoration: none; color: #fff; }
.nav-item.active { background: #3a3a3a; color: #fff; border-left-color: var(--artifis-red); }
.nav-ico { width: 16px; text-align: center; opacity: .8; }
.nav-sep { height: 1px; background: #444; margin: 6px 14px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--surface-card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.page-title { font-size: 18px; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.policy-chip { background: #f0f0ef; border: 1px solid var(--border); border-radius: 20px; padding: 3px 12px; font-size: 12px; color: var(--text-secondary); }
.mini-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.content { padding: 22px; max-width: 1100px; width: 100%; }

.nav-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 20; background: var(--artifis-charcoal); color: #fff; border: none; border-radius: 6px; padding: 8px 12px; font-size: 16px; }

/* ── Status dots ───────────────────────────────────── */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-pass { background: var(--status-pass); }
.dot-warning, .dot-warn { background: var(--status-warn); }
.dot-blocked { background: var(--status-block); }
.status-pass { color: var(--status-pass); }
.status-warning { color: var(--status-warn); }
.status-blocked { color: var(--status-block); }

/* ── Cards ─────────────────────────────────────────── */
.card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px; margin-bottom: 18px; }
.card-title { margin: 0 0 12px; font-size: 15px; }
.muted { color: var(--text-muted); }

/* ── Banner ────────────────────────────────────────── */
.banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-card); margin-bottom: 18px; border: 1px solid; }
.banner-icon { font-size: 22px; }
.banner-sub { display: block; font-size: 12px; opacity: .85; }
.banner > a { margin-left: auto; }
.banner-pass { background: var(--status-pass-bg); border-color: var(--status-pass-border); color: var(--status-pass); }
.banner-warning { background: var(--status-warn-bg); border-color: var(--status-warn-border); color: var(--status-warn); }
.banner-blocked { background: var(--status-block-bg); border-color: var(--status-block-border); color: var(--status-block); }

/* ── Condition cards ───────────────────────────────── */
.cond-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.cond-stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.cond-card { background: var(--surface-card); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); padding: 16px; }
.cond-pass { border-left-color: var(--status-pass); }
.cond-warning { border-left-color: var(--status-warn); }
.cond-blocked { border-left-color: var(--status-block); }
.cond-head { display: flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.cond-name { margin: 6px 0; font-size: 15px; }
.cond-label { margin: 6px 0 4px; font-size: 13px; }
.cond-detail { font-size: 12px; color: var(--text-secondary); }
.cond-action { font-size: 13px; font-weight: 500; }

/* ── Overall void ──────────────────────────────────── */
.overall { padding: 14px; border-radius: var(--radius); font-weight: 500; text-align: center; margin-bottom: 16px; }
.overall-pass { background: var(--status-pass-bg); color: var(--status-pass); border: 1px solid var(--status-pass-border); }
.overall-warning { background: var(--status-warn-bg); color: var(--status-warn); border: 1px solid var(--status-warn-border); }
.overall-blocked { background: var(--status-block-bg); color: var(--status-block); border: 1px solid var(--status-block-border); }
.void-title { margin: 0; font-size: 18px; }
.void-head { margin-bottom: 12px; }

/* ── Stat cards ────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-num { display: block; font-size: 26px; font-weight: 500; }
.stat-lbl { font-size: 12px; color: var(--text-muted); }
.stat-warn .stat-num { color: var(--status-warn); }

/* ── Badges ────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-pass, .badge-low { background: var(--status-pass-bg); color: var(--status-pass); }
.badge-warn, .badge-medium { background: var(--status-warn-bg); color: var(--status-warn); }
.badge-high { background: #fff3e0; color: #c05000; }
.badge-blocked { background: var(--status-block-bg); color: var(--status-block); }

/* ── Buttons ───────────────────────────────────────── */
.btn { display: inline-block; padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-align: center; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--artifis-charcoal); color: #fff; }
.btn-primary:hover { background: #000; color: #fff; }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: #f3f3f3; }
.btn-light { background: rgba(255,255,255,.7); border-color: var(--border-strong); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.policy-period-flag { border-left: 3px solid var(--status-warn, #c08a00); padding-left: 10px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }

/* ── Tables ────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { color: var(--text-muted); font-weight: 500; font-size: 12px; }
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv td:first-child { color: var(--text-muted); width: 38%; }

/* ── List head & chips ─────────────────────────────── */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filters, .faq-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: #fff; border: 1px solid var(--border-strong); border-radius: 20px; padding: 5px 13px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.chip-on { background: var(--artifis-charcoal); color: #fff; border-color: var(--artifis-charcoal); }

/* ── Alerts ────────────────────────────────────────── */
.alert { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; font-size: 13px; }
.alert-block { background: var(--status-block-bg); color: var(--status-block); border-color: var(--status-block-border); }
.alert-warn { background: var(--status-warn-bg); color: var(--status-warn); border-color: var(--status-warn-border); }
.alert-info { background: #eef3fb; color: #2a4a7a; border-color: #c4d5ee; }

/* ── Login ─────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--artifis-charcoal); }
.login-card { background: #fff; border-radius: 12px; padding: 34px 30px; width: 320px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.login-brand .brand-mark { color: var(--artifis-charcoal); font-size: 22px; letter-spacing: 3px; }
.login-brand .brand-sub { color: var(--text-muted); }
.login-policy { color: var(--text-muted); font-size: 12px; margin: 4px 0 18px; }
.login-form { text-align: left; }
.login-form label { font-size: 12px; color: var(--text-secondary); }
.login-foot { margin-top: 18px; font-size: 11px; color: var(--text-muted); }

/* ── H&S policy render ─────────────────────────────── */
.hs-policy-render h1 { color: var(--artifis-red); font-size: 22px; }
.hs-policy-render h2 { border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-top: 22px; }
.hs-policy-render .policy-meta { border-collapse: collapse; margin: 10px 0; }
.hs-policy-render .policy-meta td { border: 1px solid var(--border); padding: 4px 10px; }
.hs-policy-render .signature-block { margin-top: 26px; }

/* ── FAQ ───────────────────────────────────────────── */
.faq-controls { margin-bottom: 14px; }
.faq-search { width: 100%; padding: 12px 14px; font-size: 15px; border: 1px solid var(--border-strong); border-radius: var(--radius); margin-bottom: 10px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 12px; background: #fff; }
.faq-item summary { cursor: pointer; padding: 10px 0; font-weight: 500; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-cat-tag { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); background: #f0f0ef; border-radius: 10px; padding: 1px 8px; margin-right: 8px; }
.faq-answer { padding: 0 0 12px; color: var(--text-secondary); font-size: 13px; }

.code-block { background: #2e2e2e; color: #eee; padding: 12px; border-radius: var(--radius); font-size: 12px; overflow-x: auto; white-space: pre-wrap; }

/* ── Void widget ───────────────────────────────────── */
.void-widget { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 20px; font-size: 13px; border: 1px solid var(--border); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 860px) {
  .cond-row, .stat-row { grid-template-columns: 1fr 1fr; }
  .sidebar { position: fixed; left: -240px; transition: left .2s; z-index: 15; box-shadow: 2px 0 12px rgba(0,0,0,.3); }
  .sidebar.open { left: 0; }
  .nav-toggle { display: block; }
  .topbar { padding-left: 60px; }
}
@media (max-width: 560px) {
  .cond-row, .stat-row { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}
