/* ============================================================
   Milly Knowledge Base — Stylesheet
   Visual style: hi-milly.eu  |  Layout: HubSpot Knowledge Base
   ============================================================ */

:root {
  /* Brand */
  --pink: #FFBBBB;
  --blue: #A3DFE7;
  --yellow: #F7E39A;

  /* Icon-circle backgrounds (lighter tints) */
  --pink-light: #FFE5E5;
  --blue-light: #DFF3F6;
  --yellow-light: #FFF3D0;

  /* UI */
  --primary: #FF808A;
  --primary-hover: #FF6673;

  /* Semantic */
  --success: #16A34A;
  --warning: #E8A308;
  --error: #EF4444;

  /* Neutrals — warmer palette inspired by hi-milly.eu */
  --bg: #FBF8F6;
  --bg-warm: #FFF6F1;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #F0EAEA;
  --border-light: #F7F2F0;

  /* Typography */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Segoe UI Mono", Consolas, monospace;

  /* Spacing */
  --s2: 4px;
  --s4: 8px;
  --s8: 16px;
  --s12: 24px;
  --s16: 32px;
  --s20: 40px;
  --s24: 48px;
  --s32: 64px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.03);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.08);

  /* Layout */
  --topbar-h: 60px;
  --sidebar-w: 260px;
  --max-w: 860px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(255,187,187,0.13) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 60%, rgba(163,223,231,0.09) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 80% 80%, rgba(247,227,154,0.08) 0%, transparent 50%);
  background-attachment: fixed;
  line-height: 1.65;
  overflow-x: hidden;
}

/* ============================================================
   TOP BAR
   ============================================================ */
/* Warm accent strip at very top (like hi-milly.eu) */
.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--yellow) 0%, var(--pink) 50%, var(--blue) 100%);
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 3px var(--s12) 0;
  gap: var(--s8);
}

.topbar-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -1px;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.topbar-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.topbar-right {
  margin-left: auto;
}

/* Mobile menu button */
.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}

.menu-btn:hover { background: var(--border-light); }
.menu-btn svg { width: 22px; height: 22px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  flex-shrink: 0;
  background: linear-gradient(180deg, #FFFAF8 0%, #FFFFFF 100%);
  border-right: 1px solid var(--border);
  padding: var(--s12) 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 99;
}
.sidebar-overlay.visible { display: block; }

.sidebar-group { margin-bottom: 2px; }

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text);
  background: none;
  border-radius: 0;
  margin: 0;
  padding: 8px var(--s12);
  transition: color 0.2s;
}

.sidebar-title:hover {
  color: var(--text);
}

.sidebar-group.open .sidebar-title {
  color: var(--text);
}

.sidebar-caret {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.sidebar-group.open .sidebar-caret {
  transform: rotate(180deg);
}

/* Collapsible links wrapper */
.sidebar-links {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 0;
}

.sidebar-group.open .sidebar-links {
  max-height: 500px;
  opacity: 1;
  padding: 4px 0 6px;
}

.sidebar a {
  display: block;
  padding: 5px var(--s12) 5px 32px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--border-light);
}

.sidebar a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
  background: rgba(255,128,138,0.08);
}

.sidebar a:active {
  transform: scale(0.98);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  flex: 1;
  min-width: 0;
  padding: var(--s16) var(--s16) var(--s32);
}

.main-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ============================================================
   HERO BANNER (full-width, Wiseworks-inspired)
   ============================================================ */
.kb-hero {
  background:
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(255,187,187,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 20% 80%, rgba(247,227,154,0.15) 0%, transparent 50%),
    linear-gradient(180deg, rgba(163,223,231,0.1) 0%, rgba(255,245,240,0.3) 100%);
  padding: 100px var(--s16) 80px;
  text-align: center;
  margin-left: calc(-1 * var(--s16));
  margin-right: calc(-1 * var(--s16));
  margin-top: calc(-1 * var(--s16));
  margin-bottom: var(--s24);
  position: relative;
}

.kb-hero h1 {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: var(--s8);
  color: var(--text);
}

.kb-hero .intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section {
  margin-bottom: var(--s24);
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.section-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: var(--s4);
  color: var(--text);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--s12);
  line-height: 1.6;
}

.section-divider {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, var(--pink) 0%, var(--yellow) 50%, var(--blue) 100%);
  opacity: 0.3;
  margin: var(--s16) 0;
  border-radius: 2px;
}

/* ============================================================
   CARDS (matching hi-milly.eu feature cards)
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(240,234,234,0.6);
  padding: var(--s12);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: rgba(255,187,187,0.3);
}

.card--flat:hover {
  box-shadow: var(--shadow-card);
  transform: none;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: var(--s4);
}

.card-body p {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card-body p + p { margin-top: var(--s4); }

.card-body ul, .card-body ol {
  padding-left: var(--s12);
  margin: var(--s4) 0;
}

.card-body li {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 4px;
}

.card-body li strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  gap: var(--s8);
  margin-bottom: var(--s12);
}

.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* ============================================================
   FEATURE CARDS (with icon circle, matching hi-milly.eu)
   ============================================================ */
.feat-card {
  padding: var(--s12);
}

.feat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s8);
  flex-shrink: 0;
}

.feat-icon svg {
  width: 22px;
  height: 22px;
}

.feat-icon--pink { background: var(--pink-light); color: #D94F5C; }
.feat-icon--blue { background: var(--blue-light); color: #3A9AAF; }
.feat-icon--yellow { background: var(--yellow-light); color: #B08A1A; }

.feat-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  color: var(--text);
}

.feat-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   COLLAPSIBLE SECTIONS (core concepts)
   ============================================================ */
.collapse {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(240,234,234,0.6);
  margin-bottom: var(--s4);
  overflow: hidden;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
  transition: border-color 0.2s ease;
}

.collapse.open {
  border-left: 3px solid var(--primary);
}

.collapse-trigger {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  padding: var(--s8) var(--s12);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  transition: background 0.15s ease;
}

.collapse-trigger:hover { background: var(--border-light); }

.collapse-trigger .caret {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.collapse.open .collapse-trigger .caret {
  transform: rotate(180deg);
}

.collapse-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease 0.05s;
}

.collapse.open .collapse-body {
  max-height: 4000px;
  opacity: 1;
}

.collapse-inner {
  padding: 0 var(--s12) var(--s12);
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.collapse-inner ul, .collapse-inner ol {
  padding-left: var(--s12);
  margin: var(--s4) 0;
}

.collapse-inner li { margin-bottom: 4px; }
.collapse-inner li strong { color: var(--text); font-weight: 600; }
.collapse-inner p + p { margin-top: var(--s4); }

/* Color dot before collapse trigger */
.collapse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.collapse-dot--pink { background: var(--pink); }
.collapse-dot--blue { background: var(--blue); }
.collapse-dot--yellow { background: var(--yellow); }

/* ============================================================
   STEP FLOW (end-to-end)
   ============================================================ */
.steps { position: relative; padding-left: 40px; }

.steps::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.step {
  position: relative;
  margin-bottom: var(--s8);
}

.step-num {
  position: absolute;
  left: -40px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.step-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--s8) var(--s12);
}

.step-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.step-body ul {
  padding-left: var(--s12);
  margin-top: var(--s2);
}

.step-body li { margin-bottom: 3px; }
.step-body li strong { color: var(--text); font-weight: 600; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  background: var(--card);
  margin-bottom: var(--s12);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead th {
  text-align: left;
  padding: 14px var(--s8);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 12px var(--s8);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

tbody td strong {
  color: var(--text);
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,128,138,0.03); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--pink { background: var(--pink-light); color: #B04050; }
.badge--blue { background: var(--blue-light); color: #2A7A8A; }
.badge--yellow { background: var(--yellow-light); color: #8A6A10; }

/* ============================================================
   ORG CHART (role hierarchy)
   ============================================================ */
.org-chart-wrap {
  background: linear-gradient(135deg, #FFFBFA 0%, #FFFFFF 50%, #FAFCFD 100%);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(240,234,234,0.6);
  padding: var(--s24) var(--s8);
  margin-bottom: var(--s12);
  overflow-x: auto;
}

.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 540px;
}

/* Tier label pill */
.org-tier-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 3px 14px;
  border-radius: 999px;
  margin-bottom: var(--s4);
}

/* Tier row */
.org-tier {
  display: flex;
  position: relative;
}

.org-tier--single {
  justify-content: center;
}

.org-tier--multi {
  width: 100%;
  max-width: 640px;
  padding-top: 36px;
}

.org-tier--multi .org-node { flex: 1; }

/* Horizontal connector line (spans center-of-first to center-of-last child) */
.org-tier--multi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 1.5px;
  background: var(--border);
}

/* Vertical connector from h-line down to each node */
.org-tier--multi .org-node::before {
  content: '';
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 36px;
  background: var(--border);
  z-index: 0;
}

/* Vertical stem between tiers */
.org-vline {
  width: 1.5px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* Node */
.org-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Avatar circle */
.org-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.org-avatar svg {
  width: 26px;
  height: 26px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Color variants */
.org-node--pink   { --node-color: var(--pink); }
.org-node--blue   { --node-color: var(--blue); }
.org-node--yellow { --node-color: var(--yellow); }

/* Colored ring (white gap + colored ring via box-shadow) */
.org-node--pink   .org-avatar { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--pink); }
.org-node--blue   .org-avatar { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--blue); }
.org-node--yellow .org-avatar { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--yellow); }

/* Small coloured dot at connection point — multi-tier nodes (top) */
.org-tier--multi .org-avatar::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--node-color, var(--border));
  border: 2.5px solid var(--card);
  z-index: 3;
}

/* Dot at bottom of single-tier (admin) node */
.org-tier--single .org-avatar::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--node-color, var(--border));
  border: 2.5px solid var(--card);
  z-index: 3;
}

/* Node label */
.org-name {
  margin-top: 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
}

/* Node description */
.org-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3px;
  line-height: 1.35;
  max-width: 120px;
}

/* ============================================================
   CALLOUT BOX
   ============================================================ */
.callout {
  background: linear-gradient(135deg, rgba(255,187,187,0.18), rgba(247,227,154,0.12), rgba(163,223,231,0.14));
  border-radius: var(--r-lg);
  border-left: 4px solid var(--primary);
  padding: var(--s12) var(--s12) var(--s12) var(--s16);
  margin-bottom: var(--s12);
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.callout strong { color: var(--text); }

/* ============================================================
   LOGIN TEASER
   ============================================================ */
.login-teaser {
  background: linear-gradient(135deg, hsl(355 100% 85%) 0%, hsl(195 90% 85%) 100%);
  border: none;
  border-radius: var(--r-xl);
  padding: var(--s24) var(--s16);
  text-align: center;
  margin-bottom: var(--s12);
}

.login-teaser-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--s8);
}

.login-teaser-icon svg {
  width: 26px;
  height: 26px;
  stroke: #1A1A1A;
}

.login-teaser-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1A1A1A;
  margin-bottom: var(--s4);
}

.login-teaser-desc {
  font-size: 0.95rem;
  color: rgba(26,26,26,0.7);
  max-width: 480px;
  margin: 0 auto var(--s12);
  line-height: 1.65;
}

.login-teaser-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border: none;
  border-radius: var(--r-sm);
  background: #FFFFFF;
  color: #1A1A1A;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.login-teaser-btn:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.login-teaser-btn:active {
  transform: translateY(0);
}

/* ============================================================
   LOGIN DIALOG (expandable on onboarding page)
   ============================================================ */
.login-dialog-wrap {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.4s ease 0.05s;
  margin: 0 auto;
  width: 100%;
}

.login-dialog-wrap.open {
  max-height: 700px;
  opacity: 1;
  margin-top: var(--s16);
}

.login-dialog {
  max-width: 400px;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1px solid #D9D9D9;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(26,26,26,0.1);
  padding: 24px;
  text-align: center;
}

/* Logo badge */
.login-logo-badge {
  background: linear-gradient(135deg, hsl(355 100% 85%) 0%, hsl(195 90% 85%) 100%);
  border-radius: 16px;
  padding: 16px;
  display: inline-block;
  margin-bottom: 16px;
}

.login-logo-text {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  color: #FFFFFF;
}

.login-subtitle {
  font-size: 1rem;
  color: #666666;
  margin-bottom: 20px;
}

/* Form */
.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1A1A1A;
  margin-bottom: 8px;
  line-height: 1;
}

.login-field input {
  width: 100%;
  height: 40px;
  background: #FAFAFA;
  border: 1px solid #E6E6E6;
  border-radius: 14px;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 0.875rem;
  color: #1A1A1A;
  outline: none;
  transition: box-shadow 0.2s;
}

.login-field input::placeholder {
  color: hsl(0,0%,70%);
  font-style: italic;
}

.login-field input:focus {
  box-shadow: 0 0 0 2px #FF808A, 0 0 0 4px rgba(255,128,138,0.2);
  border-color: #FF808A;
}

/* Password wrap */
.login-password-wrap {
  position: relative;
}

.login-password-wrap input {
  padding-right: 40px;
}

.login-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.login-pw-toggle svg {
  width: 16px;
  height: 16px;
  stroke: #666666;
  transition: stroke 0.15s;
}

.login-pw-toggle:hover svg {
  stroke: #1A1A1A;
}

/* Forgot password */
.login-forgot-row {
  text-align: right;
  margin-top: 6px;
}

.login-forgot {
  font-size: 0.875rem;
  font-weight: 500;
  color: #666666;
  text-decoration: none;
  transition: text-decoration 0.15s;
}

.login-forgot:hover {
  text-decoration: underline;
}

/* Submit button */
.login-submit {
  width: 100%;
  height: 44px;
  background: #FF808A;
  color: #1A1A1A;
  border: none;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0 32px;
  transition: opacity 0.2s, box-shadow 0.2s;
  margin-top: 8px;
}

.login-submit:hover {
  opacity: 0.9;
}

.login-submit:focus {
  box-shadow: 0 0 0 2px #FF808A, 0 0 0 4px rgba(255,128,138,0.2);
  outline: none;
}

/* New org section */
.login-new-org {
  margin-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: #666666;
}

.login-new-org-link {
  display: inline;
  margin-left: 4px;
  font-weight: 500;
  color: #FF808A;
  text-decoration: none;
  transition: text-decoration 0.15s;
}

.login-new-org-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ============================================================
   READ MORE LINK
   ============================================================ */
.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s, gap 0.2s;
}

.read-more-link:hover {
  color: var(--primary-hover);
  gap: 8px;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.btt {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
}

.btt.visible { opacity: 1; transform: translateY(0); }
.btt:hover { background: var(--pink-light); color: var(--primary); }
.btt svg { width: 18px; height: 18px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #F3EFED;
  border-top: 1px solid var(--border);
}

.footer-top {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--s8) var(--s16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text);
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-sep {
  color: var(--border);
  font-size: 0.9rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover { color: var(--primary); }

.footer-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: var(--s4) var(--s16);
  display: flex;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================
   TOPBAR LOGIN BUTTON (onboarding page)
   ============================================================ */
.topbar-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-login-btn:hover {
  background: var(--border-light);
  border-color: var(--text-muted);
}

.topbar-login-icon {
  display: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* When topbar has a login btn, lang-switcher shouldn't auto-push left */
.topbar-login-btn + .lang-switcher {
  margin-left: 8px;
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-switcher {
  position: relative;
  margin-left: auto;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s;
}

.lang-btn:hover { background: var(--border-light); }

.lang-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  min-width: 160px;
  z-index: 500;
}

.lang-dropdown.open { display: block; }

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  text-align: left;
  color: var(--text);
  transition: background 0.15s;
}

.lang-option:hover { background: var(--border-light); }

.lang-option.active {
  background: var(--yellow-light);
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html { font-size: 16px; }

  .menu-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%);
    z-index: 300;
    box-shadow: 4px 0 16px rgba(0,0,0,0.08);
  }
  .sidebar.open { transform: translateX(0); }

  .main { padding: var(--s8) var(--s4) var(--s16); }

  .kb-hero {
    padding: 60px var(--s4) 48px;
    margin-left: calc(-1 * var(--s4));
    margin-right: calc(-1 * var(--s4));
    margin-top: calc(-1 * var(--s8));
  }
  .kb-hero h1 { font-size: 2rem; letter-spacing: -0.8px; }

  .card-grid--3,
  .card-grid--2 { grid-template-columns: 1fr; }

  .org-chart { min-width: 480px; }
  .org-avatar { width: 52px; height: 52px; }
  .org-avatar svg { width: 22px; height: 22px; }
  .org-name { font-size: 0.6rem; margin-top: 10px; }
  .org-desc { font-size: 0.6rem; max-width: 90px; }

  .card { padding: var(--s8); }

  .footer-sep { display: none; }
  .footer-top { flex-direction: column; padding: var(--s8) var(--s4); gap: 4px; }

  .steps { padding-left: 32px; }
  .steps::before { left: 11px; }
  .step-num { left: -32px; width: 26px; height: 26px; font-size: 0.72rem; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 var(--s4); gap: 4px; }
  .topbar-logo { font-size: 1.3rem; }
}

/* Ensure lang-switcher is always visible on mobile */
@media (max-width: 768px) {
  .topbar { gap: 6px; }
  .topbar-login-btn {
    padding: 7px 8px;
  }
  .topbar-login-text { display: none; }
  .topbar-login-icon { display: block; }
  .topbar-login-btn + .lang-switcher {
    margin-left: 4px;
    flex-shrink: 0;
  }
  .topbar-sep { display: none; }
  .topbar-label { display: none; }
  .lang-current { display: none; }
  .lang-btn { padding: 6px 8px; }
}

/* ============ SEARCH BAR ============ */
.topbar-search {
  position: relative;
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F5F5F5;
  border: 1px solid #E8E4E1;
  border-radius: 10px;
  padding: 6px 12px;
  transition: border-color 0.15s, background 0.15s;
}
.search-input-wrap:focus-within {
  background: #fff;
  border-color: #FF6B6B;
  box-shadow: 0 0 0 3px rgba(255,107,107,0.08);
}
.search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: #999;
}
.search-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: #1A1A1A;
  width: 180px;
  min-width: 0;
}
.search-input::placeholder {
  color: #AAA;
}
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 340px;
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #E8E4E1;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 6px;
}
.search-dropdown.open {
  display: block;
}
.search-result {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.1s;
}
.search-result:hover {
  background: #FFF0F0;
}
.search-result-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.search-result-page {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #FF6B6B;
  background: #FFF0F0;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.search-result[data-page="overview.html"] .search-result-page {
  color: #4A90D9;
  background: #EEF4FC;
}
.search-result[data-page="onboarding.html"] .search-result-page {
  color: #2BAC76;
  background: #EDFAF3;
}
.search-result[data-page="backoffice_guide.html"] .search-result-page {
  color: #7C3AED;
  background: #F3EEFF;
}
.search-lock {
  width: 11px;
  height: 11px;
  stroke: #FF6B6B;
}
.search-result-parent {
  font-size: 0.75rem;
  color: #888;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-snippet {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-result-snippet mark {
  background: #FFE4B5;
  color: #1A1A1A;
  border-radius: 2px;
  padding: 0 1px;
}
.search-empty {
  padding: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: #999;
  font-family: 'Inter', sans-serif;
}

mark.search-highlight {
  background: rgba(255, 200, 50, 0.55);
  color: inherit;
  padding: 1px 2px;
  border-radius: 3px;
  animation: searchHighlightPulse 1.5s ease-in-out 2;
}

@keyframes searchHighlightPulse {
  0%, 100% { background: rgba(255, 200, 50, 0.55); }
  50%      { background: rgba(255, 160, 0, 0.75); }
}

@media (max-width: 768px) {
  .topbar-search {
    margin-left: auto;
  }
  .topbar-search .search-input-wrap {
    padding: 6px 8px;
  }
  .topbar-search .search-input {
    width: 0;
    padding: 0;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
  }
  .topbar-search.expanded {
    flex: 1;
    min-width: 0;
  }
  .topbar-search.expanded .search-input {
    width: 100%;
    flex: 1;
    opacity: 1;
  }
  .topbar-search.expanded ~ .topbar-login-btn,
  .topbar-search.expanded ~ .lang-switcher {
    display: none;
  }
  .search-dropdown {
    position: fixed;
    left: 8px;
    right: 8px;
    top: calc(var(--topbar-h) + 6px);
    min-width: 0;
    width: auto;
    max-width: none;
  }
}
