/* ------------------------------------------------------------------ */
/* Workspark HR & Ops SOP Portal — docs-style layout                   */
/* Brand: orange #f15a22, greys, Arial                                 */
/* ------------------------------------------------------------------ */
:root {
  --bg: #14110f;
  --surface: #1d1916;
  --surface-2: #271f1a;
  --border: #392f28;
  --text: #ece7e3;
  --muted: #a99e95;
  --accent: #f15a22;       /* Workspark orange */
  --accent-2: #ff8a4d;     /* lighter orange for gradients */
  --hr: #3fb6a8;           /* HR category accent + "done" state */
  --ops: #f0a64e;          /* Ops category accent */
  --radius: 14px;
  --sidebar-w: 286px;
  --content-max: 860px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15.5px/1.55 Arial, "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }

/* ---- Layout shell ------------------------------------------------- */
.layout { display: flex; align-items: flex-start; min-height: 100vh; }

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #10141b;
  padding: 18px 14px 28px;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 34px 40px 90px;
  background:
    radial-gradient(700px 380px at 90% -10%, rgba(241, 90, 34, 0.10), transparent 60%),
    radial-gradient(600px 360px at -10% 0%, rgba(255, 138, 77, 0.08), transparent 55%);
}

/* ---- Brand -------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 4px 8px 16px; letter-spacing: -0.01em; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px;
  background: var(--accent);
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; letter-spacing: 0; }

/* ---- Search ------------------------------------------------------- */
.search-wrap { padding: 0 6px 14px; }
#search {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; outline: none;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.2); }

/* ---- Sidebar nav -------------------------------------------------- */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); padding: 14px 10px 6px;
}
.nav-home, .nav-browse {
  padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--muted);
}
.nav-home:hover, .nav-browse:hover { background: var(--surface); color: var(--text); }
.nav-home.active, .nav-browse.active { color: var(--accent); }
.nav-browse { margin-top: 12px; border-top: 1px solid var(--border); border-radius: 0; padding-top: 16px; }

.nav-chapter { margin-bottom: 2px; }
.nav-chapter-head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 600;
}
.nav-chapter-head:hover { background: var(--surface); }
.nav-chapter-ico { font-size: 16px; }
.nav-chapter-label { flex: 1; min-width: 0; }
.nav-chapter-count { font-size: 11px; color: var(--muted); font-weight: 500; }
.nav-chapter.open .nav-chapter-head, .nav-chapter-head.active { color: var(--accent); }

.nav-lessons { list-style: none; margin: 2px 0 6px; padding: 0 0 0 6px; }
.nav-lesson {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 14px; margin-left: 8px;
  border-left: 2px solid var(--border); border-radius: 0 8px 8px 0;
  font-size: 13.5px; color: var(--muted);
}
.nav-lesson:hover { background: var(--surface); color: var(--text); }
.nav-lesson.active {
  color: var(--text); background: var(--surface);
  border-left-color: var(--accent); font-weight: 600;
}
.nav-tick {
  flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border); font-size: 9px; line-height: 11px;
  text-align: center; color: transparent;
}
.nav-tick.on { background: var(--hr); border-color: var(--hr); color: #0e1116; font-weight: 800; }
.nav-lesson-label { flex: 1; min-width: 0; }
.nav-empty { color: var(--muted); font-size: 13px; padding: 10px 12px; }

/* ---- Mobile toggle ------------------------------------------------ */
.nav-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 30;
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 18px; cursor: pointer;
}
.scrim { display: none; }

/* ---- Line art ----------------------------------------------------- */
.art-svg { width: 100%; height: 100%; display: block; color: var(--accent); }

/* ---- Hero / headings ---------------------------------------------- */
.hero-learn { margin: 4px 0 24px; }
.hero-learn h2 { font-size: 28px; margin: 0 0 8px; line-height: 1.2; }
.hero-sub { color: var(--muted); margin: 0; }
.section-label {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin: 22px 0 12px;
}
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 4px; font-size: 24px; }
.page-head .muted { margin: 0; }
.page-head-icon { font-size: 32px; }
.sop-head { justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.muted { color: var(--muted); }

/* ---- Progress bar ------------------------------------------------- */
.bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.4s ease; }

/* ---- Resume card -------------------------------------------------- */
.resume {
  display: block; position: relative; padding: 18px 20px; margin-bottom: 26px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(79,140,255,0.10), rgba(111,92,255,0.06));
}
.resume:hover { box-shadow: var(--shadow); }
.resume-tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; }
.resume-title { font-size: 18px; font-weight: 650; margin: 4px 0 2px; }
.resume-sub { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.resume-go { position: absolute; top: 18px; right: 20px; color: var(--accent); font-weight: 650; }

/* ---- Path (chapter) cards ----------------------------------------- */
.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.path-card {
  display: flex; flex-direction: column; padding: 22px;
  border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.path-card.path-hr { border-top-color: var(--hr); }
.path-card.path-ops { border-top-color: var(--ops); }
.path-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.path-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.path-icon { font-size: 30px; }
.path-count { font-size: 12px; color: var(--muted); }
.badge-done { font-size: 12px; font-weight: 700; color: var(--hr); }
.path-card h3 { margin: 4px 0 6px; font-size: 19px; }
.path-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; flex: 1; }
.path-foot-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; }
.path-cta { color: var(--accent); font-weight: 650; }

/* ---- Path head + roadmap ------------------------------------------ */
.path-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.path-head-icon { font-size: 40px; }
.path-head-text { flex: 1; min-width: 220px; }
.path-head-text h2 { margin: 0 0 4px; font-size: 24px; }
.path-head-prog { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.path-head-prog .muted { font-size: 13px; }
.path-head-cta { align-self: center; }

.roadmap { display: flex; flex-direction: column; gap: 10px; }
.stop {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.stop:hover { border-color: var(--accent); transform: translateX(2px); }
.stop-marker {
  flex: 0 0 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  background: var(--surface-2); border: 2px solid var(--border); color: var(--muted);
}
.stop-done .stop-marker { background: var(--hr); border-color: var(--hr); color: #0e1116; }
.stop-art {
  flex: 0 0 56px; width: 56px; height: 44px; padding: 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.stop-body { flex: 1; min-width: 0; }
.stop-title { font-weight: 650; }
.stop-sum { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.stop-meta { display: flex; align-items: center; gap: 8px; }
.stop-go { color: var(--muted); font-size: 20px; }

/* ---- Lesson ------------------------------------------------------- */
.lesson-pos { font-size: 13px; color: var(--accent); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.lesson-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
  background: linear-gradient(180deg, transparent, var(--bg) 45%); padding-bottom: 14px;
}

/* ---- Buttons ------------------------------------------------------ */
.btn { display: inline-block; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; font-weight: 650; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-done.on { background: var(--hr); border-color: var(--hr); color: #0e1116; font-weight: 700; }

/* ---- Steps (with line art) ---------------------------------------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.step {
  counter-increment: step; display: flex; gap: 18px; align-items: center;
  padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.step-visual {
  flex: 0 0 112px; width: 112px; height: 86px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  display: grid; place-items: center;
}
.step-visual img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.step-text { flex: 1; min-width: 0; }
.step-text h4 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.step-text h4::before {
  content: counter(step); flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.step-body { color: var(--text); font-size: 15px; }
.step-body code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* ---- Browse / SOP rows -------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cat-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), var(--surface-2)); transition: transform 0.12s ease, border-color 0.12s ease; }
.cat-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.cat-icon { font-size: 28px; }
.cat-body h3 { margin: 0 0 4px; font-size: 18px; }
.cat-body p { margin: 0; color: var(--muted); font-size: 14px; }
.cat-count { margin-top: auto; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }

.sop-list { display: flex; flex-direction: column; gap: 10px; }
.sop-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color 0.12s ease, transform 0.12s ease; }
.sop-row:hover { border-color: var(--accent); transform: translateX(2px); }
.sop-row-art { flex: 0 0 50px; width: 50px; height: 40px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.sop-row-main { flex: 1; min-width: 0; }
.sop-row-title { font-weight: 650; }
.sop-row-sum { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.sop-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sop-row-go { color: var(--muted); font-size: 20px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; color: #0e1116; }
.pill-hr { background: var(--hr); }
.pill-ops { background: var(--ops); }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.dot { color: var(--border); }
.tick { color: var(--hr); }

/* ---- Breadcrumb + misc -------------------------------------------- */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.crumb a:hover { color: var(--text); }
.crumb .sep { opacity: 0.5; }
.inpath-note { padding: 12px 16px; margin-bottom: 18px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); font-size: 14px; color: var(--muted); }
.inpath-note a { color: var(--accent); font-weight: 600; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* ---- Responsive --------------------------------------------------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 25;
    transform: translateX(-100%); transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.5); }
  .content { max-width: none; padding: 64px 20px 80px; }
  .path-grid, .cat-grid { grid-template-columns: 1fr; }
  .step { flex-direction: column; align-items: stretch; }
  .step-visual { width: 100%; height: 120px; }
  .sop-head { flex-direction: column; }
  .lesson-nav { flex-wrap: wrap; }
  .lesson-nav .btn { flex: 1; text-align: center; }
}
