/* ============================================================
   Legal Ops OS — guided UX preview
   Standalone mockup styles. No framework, no build step.
   Design tokens mirror the product (Notion/Pulley-inspired,
   warm neutral canvas, black primary, growth-green secondary).
   ============================================================ */

:root {
  --bg-canvas: #fafaf8;
  --bg-surface: #ffffff;
  --bg-surface-2: #f5f5f3;
  --bg-sidebar: #fbfbf9;

  --border-subtle: #ebebe8;
  --border-default: #e2e2de;
  --border-strong: #c9c9c4;

  --text-primary: #1f1f1e;
  --text-secondary: #5a5a55;
  --text-tertiary: #8a8a82;
  --text-inverse: #ffffff;

  --accent-primary: #1f1f1e;
  --accent-secondary: #2e7d5b;
  --accent-secondary-hover: #266b4d;
  --accent-wash: #f0f6f2;
  --accent-line: #cbe3d5;

  --dark-bg: #0b0d0c;
  --dark-ink: #eaf0ec;
  --dark-muted: #9aa39e;
  --dark-green: #3ddc84;

  --success-bg: #eaf3ee;
  --success-fg: #3a7257;
  --warning-bg: #f7efe9;
  --warning-fg: #a76038;
  --danger-bg: #f7eaea;
  --danger-fg: #9c4b48;
  --info-bg: #eaf0f6;
  --info-fg: #3f6389;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-panel: 0 1px 2px rgba(20, 20, 18, 0.04);
  --shadow-pop: 0 8px 28px rgba(20, 20, 18, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: #ececeA;
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }
a { color: inherit; text-decoration: none; }

/* ── Demo chrome ─────────────────────────────────────────── */

.demo-bar {
  height: 46px;
  background: #16181a;
  color: #dfe4e8;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  font-size: 12.5px;
}

.demo-bar .demo-title {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

.demo-bar .demo-note { color: #8b939b; }

.demo-tabs {
  margin-left: auto;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 3px;
}

.demo-tabs a {
  padding: 5px 13px;
  border-radius: 999px;
  color: #b6bec5;
  font-size: 12px;
  white-space: nowrap;
}

.demo-tabs a.on {
  background: #fff;
  color: #16181a;
  font-weight: 600;
}

/* ── App shell ───────────────────────────────────────────── */

.app {
  height: calc(100% - 46px);
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  overflow: hidden;
}

.topbar {
  height: 52px;
  flex: 0 0 auto;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 640;
  letter-spacing: -0.015em;
  font-size: 14.5px;
}

.brand .mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.company-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 7px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.company-pill .logo {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: #26343d;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-pill .sub { color: var(--text-tertiary); font-size: 12px; }

.topsearch {
  margin-left: 8px;
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  border-radius: 8px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.topsearch .kbd {
  margin-left: auto;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
}

.icon-btn:hover { background: var(--bg-surface-2); }

.icon-btn .dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger-fg);
  border: 1.5px solid #fff;
}

.ask-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.ask-btn .spark { color: var(--accent-secondary); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #dfe6e2;
  color: #3a4a43;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 640;
}

/* ── Scenario strip ──────────────────────────────────────── */

.strip {
  flex: 0 0 auto;
  background: var(--accent-wash);
  border-bottom: 1px solid var(--accent-line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  font-size: 13px;
  color: #1f5f45;
}

.strip .name { font-weight: 620; }

.strip-steps { display: flex; align-items: center; gap: 2px; }

.strip-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  color: #4d7f68;
  font-size: 12.5px;
  white-space: nowrap;
}

.strip-step.cur {
  background: #fff;
  border: 1px solid var(--accent-line);
  color: #1f5f45;
  font-weight: 600;
}

.strip-step .n {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d8ebe0;
  color: #2c6d51;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.strip-step.done .n { background: var(--accent-secondary); color: #fff; }
.strip-step.cur .n { background: var(--accent-secondary); color: #fff; }
.strip-step .n svg { width: 11px; height: 11px; }

.strip-sep { color: #a9cbba; }

.mode-toggle {
  display: flex;
  background: #fff;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.mode-toggle span {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: #4d7f68;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mode-toggle span.on {
  background: var(--accent-secondary);
  color: #fff;
  font-weight: 600;
}

.strip-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #4d7f68;
  font-size: 12.5px;
}

.strip-right .ghost {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Body: sidebar + main ────────────────────────────────── */

.body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 212px;
  flex: 0 0 auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 1px;
}

.nav-item:hover { background: var(--bg-surface-2); }

.nav-item.on {
  background: #eeefec;
  color: var(--text-primary);
  font-weight: 600;
}

.nav-item .count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--danger-fg);
  color: #fff;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.nav-sub {
  padding: 3px 9px 6px 32px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-sub a {
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding: 2px 0;
}

.nav-sub a:hover { color: var(--text-secondary); }
.nav-sub a.on { color: var(--text-primary); font-weight: 550; }

.nav-rule {
  height: 1px;
  background: var(--border-subtle);
  margin: 10px 4px;
}

.sidebar-foot { margin-top: auto; }

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 26px 34px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.page-head .sub {
  color: var(--text-tertiary);
  font-size: 13.5px;
  padding-bottom: 2px;
}

.page-head .date {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 12.5px;
  padding-bottom: 3px;
}

/* ── Home grid 30 / 70 ───────────────────────────────────── */

.home {
  display: grid;
  grid-template-columns: minmax(240px, 30%) 1fr;
  gap: 18px;
  align-items: start;
}

.col { display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  font-weight: 620;
}

.panel-head .more { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text-tertiary); font-weight: 400; }

.panel-body { padding: 11px 14px 13px; }

/* Signals */

.signal {
  display: flex;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--border-subtle);
}

.signal:first-child { border-top: none; padding-top: 3px; }

.signal .bar {
  width: 3px;
  border-radius: 2px;
  background: var(--danger-fg);
  flex: 0 0 auto;
}

.signal.warn .bar { background: var(--warning-fg); }
.signal.info .bar { background: var(--info-fg); }

.signal .txt { font-size: 13px; line-height: 1.45; }
.signal .when { color: var(--text-tertiary); font-size: 12px; margin-top: 2px; }

/* Dark metric card */

.metrics {
  background: var(--dark-bg);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--dark-ink);
  background-image: radial-gradient(320px 130px at 15% -10%, rgba(61, 220, 132, 0.10), transparent 62%);
}

.metrics .h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dark-muted);
  font-weight: 620;
  margin-bottom: 11px;
}

.metric-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
  color: #b8c1bb;
}

.metric-row:first-of-type { border-top: none; }

.metric-row b {
  font-size: 19px;
  font-weight: 640;
  color: #fff;
  min-width: 30px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.metric-row .trend { margin-left: auto; font-size: 11.5px; color: var(--dark-green); }
.metric-row .trend.flat { color: #6f7873; }

/* Checklist (empty-state left column) */

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--border-subtle);
}

.checklist-item:first-child { border-top: none; padding-top: 4px; }

.checkbox {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  flex: 0 0 auto;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.checkbox.done { background: var(--accent-secondary); border-color: var(--accent-secondary); }
.checkbox.done svg { width: 11px; height: 11px; }

.checklist-item .t { font-size: 13.5px; font-weight: 550; }
.checklist-item.is-done .t { color: var(--text-tertiary); text-decoration: line-through; }
.checklist-item .d { font-size: 12.5px; color: var(--text-tertiary); margin-top: 1px; line-height: 1.4; }
.checklist-item .skip { margin-left: auto; font-size: 12px; color: var(--text-tertiary); flex: 0 0 auto; padding-left: 8px; }

.progress {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  overflow: hidden;
  margin-top: 10px;
}

.progress i { display: block; height: 100%; background: var(--accent-secondary); border-radius: 999px; }

/* Activity */

.act {
  display: flex;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.act:first-child { border-top: none; padding-top: 2px; }
.act .ic { color: var(--text-tertiary); margin-top: 2px; flex: 0 0 auto; }
.act .when { color: var(--text-tertiary); font-size: 12px; margin-top: 1px; }

/* ── Scenario block ──────────────────────────────────────── */

.scen {
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 14px;
}

.scen-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
}

.scen-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #17402f;
}

.scen-head .hint { color: #4d7f68; font-size: 12.5px; }

.scen-head .collapse {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: #4d7f68;
}

.scen-sect {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 660;
  color: #3d7059;
  margin: 15px 0 7px;
}

.scen-row {
  background: #fff;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 7px;
}

.scen-row:last-child { margin-bottom: 0; }
.scen-row.soft { border-color: #e0ece5; }

.scen-row .ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.scen-row .tt { font-size: 13.5px; font-weight: 600; color: #1c2f26; }
.scen-row .mm { font-size: 12.5px; color: #6f8d7f; margin-top: 1px; }
.scen-row .mm .warn { color: var(--warning-fg); font-weight: 550; }
.scen-row .mm .due { color: var(--danger-fg); font-weight: 550; }

.scen-row .acts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.mini-steps { display: flex; gap: 3px; margin-top: 6px; }
.mini-steps i { width: 22px; height: 3px; border-radius: 999px; background: #dfeee6; display: block; }
.mini-steps i.on { background: var(--accent-secondary); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-pri { background: var(--accent-secondary); color: #fff; }
.btn-pri:hover { background: var(--accent-secondary-hover); }
.btn-gh { border-color: var(--accent-line); color: #3d7059; background: #fff; }
.btn-gh:hover { background: var(--accent-wash); }

.pin-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a7c6b5;
}

.pin-btn.on { color: var(--accent-secondary); background: var(--accent-wash); }

.browse {
  margin-top: 11px;
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 9px;
  text-align: center;
  font-size: 13px;
  color: #3d7059;
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.scen-collapsed {
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: #17402f;
}

.scen-collapsed .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-secondary);
  color: #fff;
  font-size: 12px;
  font-weight: 660;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Catalog inside the block */

.cat-search {
  background: #fff;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7ea391;
  font-size: 13px;
  margin-bottom: 8px;
}

.cat {
  background: #fff;
  border: 1px solid #e0ece5;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: #1c2f26;
}

.cat .n { margin-left: auto; color: #7ea391; font-size: 12.5px; }

/* ── Empty state hero ────────────────────────────────────── */

.hero {
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 22px;
}

.hero h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.02em;
  color: #17402f;
}

.hero p {
  margin: 0 0 16px;
  color: #446b58;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 52ch;
}

.hero .btn { height: 34px; font-size: 13.5px; }

.foot-note {
  margin-top: 16px;
  color: var(--text-tertiary);
  font-size: 12.5px;
  text-align: center;
}

/* ── Utility ─────────────────────────────────────────────── */

.muted { color: var(--text-tertiary); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 550;
}
.tag.ok { background: var(--success-bg); color: var(--success-fg); }
.tag.warn { background: var(--warning-bg); color: var(--warning-fg); }
.tag.dang { background: var(--danger-bg); color: var(--danger-fg); }
.tag.info { background: var(--info-bg); color: var(--info-fg); }

.ico-16 { width: 16px; height: 16px; }
.ico-14 { width: 14px; height: 14px; }
.ico-18 { width: 18px; height: 18px; }

@media (max-width: 1080px) {
  .home { grid-template-columns: 1fr; }
  .home .col-left { order: 2; }
  .home .col-right { order: 1; }
  .sidebar { width: 64px; }
  .sidebar .nav-item span.lbl, .nav-sub, .nav-item .count { display: none; }
}
