/* ===================================================
   IT Lernplattform - style.css
   Theme: Catppuccin (Latte light / Mocha dark)
   https://catppuccin.com
=================================================== */

/* ── Catppuccin Latte (Light) - Default ──────────── */
:root {
  --sidebar-width: 240px;
  --bg:          #eff1f5;
  --sidebar-bg:  #e6e9ef;
  --crust:       #dce0e8;
  --surface:     #ccd0da;
  --surface-1:   #bcc0cc;
  --overlay:     #9ca0b0;
  --text:        #4c4f69;
  --subtext:     #6c6f85;
  --accent:      #1e66f0;
  --accent-soft: #dce8fd;
  --accent-dim:  #185fa5;
  --green:       #40a02b;
  --green-soft:  #dff0d8;
  --red:         #d20f39;
  --red-soft:    #fde4ea;
  --yellow:      #df8e1d;
  --yellow-soft: #fdf0d8;
  --mauve:       #8839ef;
  --mauve-soft:  #ede8fc;
  --teal:        #179299;
}

/* ── System dark mode preference ─────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #1e1e2e;
    --sidebar-bg:  #181825;
    --crust:       #11111b;
    --surface:     #313244;
    --surface-1:   #45475a;
    --overlay:     #6c7086;
    --text:        #cdd6f4;
    --subtext:     #a6adc8;
    --accent:      #89b4fa;
    --accent-soft: #1a2744;
    --accent-dim:  #b4befe;
    --green:       #a6e3a1;
    --green-soft:  #1a2e1e;
    --red:         #f38ba8;
    --red-soft:    #2e1a22;
    --yellow:      #f9e2af;
    --yellow-soft: #2e2418;
    --mauve:       #cba6f7;
    --mauve-soft:  #251a38;
    --teal:        #94e2d5;
  }
}

/* ── Explicit theme overrides (via JS toggle) ─────── */
html.light {
  --bg:          #eff1f5;
  --sidebar-bg:  #e6e9ef;
  --crust:       #dce0e8;
  --surface:     #ccd0da;
  --surface-1:   #bcc0cc;
  --overlay:     #9ca0b0;
  --text:        #4c4f69;
  --subtext:     #6c6f85;
  --accent:      #1e66f0;
  --accent-soft: #dce8fd;
  --accent-dim:  #185fa5;
  --green:       #40a02b;
  --green-soft:  #dff0d8;
  --red:         #d20f39;
  --red-soft:    #fde4ea;
  --yellow:      #df8e1d;
  --yellow-soft: #fdf0d8;
  --mauve:       #8839ef;
  --mauve-soft:  #ede8fc;
  --teal:        #179299;
}

html.dark {
  --bg:          #1e1e2e;
  --sidebar-bg:  #181825;
  --crust:       #11111b;
  --surface:     #313244;
  --surface-1:   #45475a;
  --overlay:     #6c7086;
  --text:        #cdd6f4;
  --subtext:     #a6adc8;
  --accent:      #89b4fa;
  --accent-soft: #1a2744;
  --accent-dim:  #b4befe;
  --green:       #a6e3a1;
  --green-soft:  #1a2e1e;
  --red:         #f38ba8;
  --red-soft:    #2e1a22;
  --yellow:      #f9e2af;
  --yellow-soft: #2e2418;
  --mauve:       #cba6f7;
  --mauve-soft:  #251a38;
  --teal:        #94e2d5;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Skip link ────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ── Focus styles ─────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Nav items and answer options use a tighter inset ring */
.nav-item:focus-visible,
.answer-option:focus-visible {
  outline-offset: -2px;
}

/* Buttons already have a border; use box-shadow instead to avoid double border */
.btn:focus-visible,
.theme-btn:focus-visible,
.hamburger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  min-height: 100dvh;
  transition: background 0.2s, color 0.2s;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ───────────────────────────────────────── */
.platform { display: flex; min-height: 100dvh; }

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--surface);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: background 0.2s, border-color 0.2s, transform 0.25s ease;
  z-index: 100;
}

.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--surface);
  flex-shrink: 0;
}
.sbl-name { font-size: 15px; font-weight: 600; color: var(--text); padding-left: 15px; line-height: 1.3; }
.sbl-sub  { font-size: 11px; color: var(--subtext); padding-left: 15px; line-height: 1.3; }
.sidebar-home-link { text-decoration: none; border-radius: 6px; transition: opacity 0.15s; display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 0; align-self: stretch; }
.sidebar-home-link:hover { opacity: 0.75; }

.sidebar-logo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--surface);
  background: var(--bg);
  color: var(--subtext);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.theme-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.theme-btn i { font-size: 15px; }

/* ── Regular nav items ────────────────────────────── */
.nav-label {
  font-size: 10px; font-weight: 700; color: var(--overlay);
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 1rem 1.25rem 0.4rem;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 0.55rem 1.25rem;
  font-size: 14px; color: var(--subtext);
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav-item i          { font-size: 16px; flex-shrink: 0; }
.nav-item:hover      { background: var(--surface); color: var(--text); }
.nav-item.active     { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* SQL sub-items (slightly indented) */
.nav-sub { padding-left: 2.75rem; font-size: 13px; }
.nav-sub i { font-size: 14px; }

/* ── Collapsible SQL group header ─────────────────── */
.nav-sql-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem 0.4rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.nav-sql-header:hover { background: var(--surface); }

.nav-sql-inner {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--overlay);
}
.nav-sql-header:hover .nav-sql-inner { color: var(--text); }
.nav-sql-inner i { font-size: 13px; }

.nav-sql-chevron {
  font-size: 14px; color: var(--overlay);
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.nav-sql-header.open .nav-sql-chevron { transform: rotate(0deg); }
.nav-sql-header:hover .nav-sql-chevron { color: var(--text); }

#sql-subnav { overflow: hidden; }

/* ── Theme toggle ─────────────────────────────────── */
.theme-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1.25rem;
  border: none; border-top: 1px solid var(--surface);
  background: none; cursor: pointer; font-family: inherit;
  color: var(--subtext); font-size: 12px; width: 100%;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface); color: var(--text); }
.theme-toggle-label { display: flex; align-items: center; gap: 8px; }
.theme-toggle i     { font-size: 16px; }

/* .theme-pill {
  width: 30px; height: 17px;
  background: var(--surface-1);
  border-radius: 9px; position: relative;
  transition: background 0.2s; flex-shrink: 0;
}
.theme-pill.on { background: var(--accent); }
.theme-pill::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.theme-pill.on::after { transform: translateX(13px); } */

/* ── Progress section ─────────────────────────────── */
.progress-section {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--surface);
  flex-shrink: 0;
}
.progress-label {
  font-size: 11px; color: var(--subtext); margin-bottom: 6px;
  display: flex; justify-content: space-between;
}
.progress-bar  { height: 5px; background: var(--surface); border-radius: 3px; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 3px; transition: width 0.4s; }

/* ── Mobile Hamburger ─────────────────────────────── */
.hamburger {
  display: none;
  position: fixed; top: 0.85rem; left: 0.85rem;
  z-index: 300;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  background: var(--sidebar-bg);
  border: 1px solid var(--surface);
  border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 18px;
  transition: background 0.15s, transform 0.25s ease, opacity 0.25s ease;
}
@media (hover: hover) {
  .hamburger:hover { background: var(--surface); }
}

.hamburger.hidden {
  transform: translate(-120%);
  opacity: 0;
  pointer-events: none;
}


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

/* ── Main Content ─────────────────────────────────── */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  max-width: 820px;
  transition: margin 0.2s;
}

/* ── Page Header ──────────────────────────────────── */
.breadcrumb   { font-size: 11px; color: var(--subtext); margin-bottom: 6px; }
.breadcrumb a { color: var(--subtext); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb a:hover { color: var(--text); }
.page-title   {
  font-size: 22px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.page-title i   { font-size: 32px; color: var(--accent); }
.page-subtitle  { font-size: 14px; color: var(--subtext); margin-bottom: 1.5rem; }

/* ── Info / Warn Boxes ────────────────────────────── */
.info-box {
  background: var(--accent-soft); border-radius: 8px;
  padding: 0.75rem 1rem; margin-bottom: 1.25rem;
  font-size: 13.5px; color: var(--accent);
  display: flex; gap: 8px; align-items: flex-start;
}
.info-box i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.warn-box {
  background: var(--yellow-soft); border-radius: 8px;
  padding: 0.75rem 1rem; margin: 0.75rem 0 0.25rem;
  font-size: 13.5px; color: var(--yellow);
  display: flex; gap: 8px; align-items: flex-start;
  border-left: 3px solid var(--yellow);
}
.warn-box i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* ── Section Blocks ───────────────────────────────── */
.section-block {
  background: var(--sidebar-bg);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--surface);
  transition: background 0.2s, border-color 0.2s;
}
.section-block.accent {
  border-left: 3px solid var(--accent);
}
.section-block h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.section-block p  { font-size: 14px; color: var(--subtext); line-height: 1.8; margin-bottom: 0.5rem; }
.section-block p:last-child { margin-bottom: 0; }

/* ── Code Blocks (hljs handles bg + colours) ─────── */
pre.code-block {
  border-radius: 8px;
  overflow: hidden;
  margin: 0.75rem 0 0.25rem;
  border: 3px solid var(--surface);
}
pre.code-block code {
  padding: 1rem 1.25rem !important;
  font-family: 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12.5px;
  line-height: 1.75;
  display: block;
}

/* Inline code */
code {
  background: var(--surface);
  color: var(--accent);
  padding: 2px 6px; border-radius: 4px;
  font-family: 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ── Content Tables ───────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--surface);
}
.table-scroll .content-table {
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
  width: auto;
  min-width: 100%;
}
.table-scroll .content-table thead th {
  white-space: nowrap;
}
.content-table {
  width: 100%; border-collapse: collapse;
  margin: 0.75rem 0 0.25rem;
  font-size: 12.5px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--surface);
}
.content-table thead th {
  background: var(--accent); color: #fff;
  padding: 0.5rem 0.75rem; text-align: left;
  font-weight: 600; font-size: 11.5px;
}
.content-table tbody td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--surface);
  vertical-align: top; color: var(--text);
}
.content-table tbody tr:last-child td { border-bottom: none; }
.content-table tbody tr:nth-child(even) td { background: var(--bg); }
.content-table code { font-size: 11.5px; }

/* ── Module Cards (index) ─────────────────────────── */
.module-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px; margin-bottom: 1.5rem;
}

.module-card {
  background: var(--sidebar-bg);
  border: 1px solid var(--surface);
  border-radius: 10px; padding: 1.1rem 1.25rem;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.2s;
}
.module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.module-card-icon   { font-size: 24px; margin-bottom: 8px; }
.module-card-title  { font-size: 14px; font-weight: 600; color: var(--text); }
.module-card-desc   { font-size: 12px; color: var(--subtext); margin-top: 3px; }
.module-card-status { margin-top: 10px; }

/* M164 SQL full-width card */
.sql-card {
  grid-column: 1 / -1;
  background: var(--sidebar-bg);
  border: 1px solid var(--surface);
  border-radius: 10px; padding: 1.1rem 1.25rem;
  transition: background 0.2s;
}
.sql-card-header   { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sql-blocks-grid   { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sql-block-link {
  display: block; background: var(--bg);
  border: 1px solid var(--surface);
  border-radius: 8px; padding: 0.6rem 0.75rem;
  text-align: center; font-size: 11.5px; color: var(--text);
  transition: all 0.15s;
}
.sql-block-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sql-block-link.done  { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.sql-block-link .block-num { font-weight: 700; font-size: 10px; color: var(--subtext); display: block; margin-bottom: 3px; }

/* ── Badges ───────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 10px;
  padding: 3px 9px; border-radius: 99px; font-weight: 600;
}
.badge-todo { background: var(--surface); color: var(--subtext); }
.badge-done { background: var(--green-soft); color: var(--green); }
.badge-wip  { background: var(--yellow-soft); color: var(--yellow); }

/* ── Quiz ─────────────────────────────────────────── */
.quiz-container {
  background: var(--sidebar-bg);
  border: 1px solid var(--surface);
  border-radius: 10px; padding: 1.25rem 1.5rem; margin-top: 1.5rem;
  transition: background 0.2s;
}
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--surface);
}
.quiz-title   { font-size: 13.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.quiz-title i { color: var(--accent); }
.quiz-counter { font-size: 11px; color: var(--subtext); }

.question-text { font-size: 15px; color: var(--text); line-height: 1.6; margin-bottom: 1rem; font-weight: 500; }

.answer-option {
  display: flex; align-items: center; gap: 10px;
  padding: 0.65rem 1rem; border: 1px solid var(--surface);
  border-radius: 8px; margin-bottom: 8px; cursor: pointer;
  font-size: 14px; color: var(--text);
  transition: all 0.15s; background: var(--bg);
  width: 100%; text-align: left; font-family: inherit;
}
.answer-option:hover   { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.answer-option.correct { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.answer-option.wrong   { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.answer-option.disabled { pointer-events: none; }

.option-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--surface-1); flex-shrink: 0; }
.answer-option.correct .option-dot { border-color: var(--green); background: var(--green); }
.answer-option.wrong   .option-dot { border-color: var(--red);   background: var(--red);   }

.feedback {
  margin-top: 0.75rem; padding: 0.65rem 1rem;
  border-radius: 8px; font-size: 13.5px; display: none; line-height: 1.5; gap: 6px;
}
.feedback.correct { background: var(--green-soft); color: var(--green); display: flex; }
.feedback.wrong   { background: var(--red-soft);   color: var(--red);   display: flex; }

.quiz-actions { margin-top: 1rem; display: flex; gap: 8px; }

.quiz-code { margin: 0.75rem 0 1rem !important; }
.quiz-image { max-width: 100%; border-radius: 8px; margin: 0.75rem 0 1rem; display: block; border: 1px solid var(--surface); }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1.1rem; border-radius: 8px; font-size: 13px;
  cursor: pointer; border: 1px solid var(--surface);
  background: var(--sidebar-bg); color: var(--text);
  transition: background 0.15s, border-color 0.15s; font-family: inherit;
}
.btn:hover           { background: var(--surface); }
.btn.primary         { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover   { opacity: 0.88; }
.btn.success         { background: var(--green); color: #fff; border-color: var(--green); pointer-events: none; }

/* ── Page Navigation ──────────────────────────────── */
.page-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid var(--surface);
  flex-wrap: wrap; gap: 8px;
}
.page-nav-right { margin-left: auto; }

/* ── Placeholder ──────────────────────────────────── */
.placeholder-section {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 280px; text-align: center;
  background: var(--sidebar-bg);
  border: 2px dashed var(--surface);
  border-radius: 12px; margin-top: 1.5rem; padding: 2rem;
  transition: background 0.2s;
}
.placeholder-section .ph-icon { font-size: 40px; color: var(--overlay); margin-bottom: 12px; }
.placeholder-section h3 { font-size: 16px; font-weight: 600; color: var(--overlay); margin-bottom: 6px; }
.placeholder-section p  { font-size: 12.5px; color: var(--overlay); }

/* ── Dashboard Stats Row ─────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1.5rem;
}
.dash-stat {
  background: var(--sidebar-bg);
  border: 1px solid var(--surface);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  transition: background 0.2s;
}
.dash-stat-label { font-size: 11px; color: var(--subtext); margin-bottom: 4px; }
.dash-stat-val   { font-size: 22px; font-weight: 700; color: var(--text); }
.dash-stat-val.dv-accent { color: var(--accent); }
.dash-stat-val.dv-green  { color: var(--green); }
.dash-stat-val.dv-yellow { color: var(--yellow); }

/* ── Dashboard Section Title ──────────────────────── */
.dash-section-title {
  font-size: 10px; font-weight: 700; color: var(--overlay);
  text-transform: uppercase; letter-spacing: 0.09em;
  margin-bottom: 8px;
}

/* ── Module Accordion ─────────────────────────────── */
.module-list { display: flex; flex-direction: column; gap: 6px; }

.module-item {
  background: var(--sidebar-bg);
  border: 1px solid var(--surface);
  border-radius: 10px;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}

.module-header {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; cursor: pointer;
  transition: background 0.12s; user-select: none;
}
.module-header:hover { background: var(--surface); }

.mod-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.mi-blue   { background: var(--accent-soft); color: var(--accent); }
.mi-amber  { background: var(--yellow-soft); color: var(--yellow); }
.mi-purple { background: var(--mauve-soft);  color: var(--mauve); }
.mi-green  { background: var(--green-soft);  color: var(--green); }
.mi-teal   { background: rgba(23,146,153,0.15); color: var(--teal); }
.mi-coral  { background: var(--red-soft);    color: var(--red); }

.mod-meta { flex: 1; min-width: 0; }
.mod-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mod-sub  { font-size: 11px; color: var(--subtext); margin-top: 1px; }

.mod-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.seg-bar {
  width: 90px; height: 6px; border-radius: 3px;
  background: var(--surface); overflow: hidden; display: flex;
}
.seg-green  { height: 100%; background: var(--green); }
.seg-yellow { height: 100%; background: var(--yellow); }

.mod-pct { font-size: 11px; color: var(--subtext); min-width: 32px; text-align: right; }
.mod-chevron { font-size: 15px; color: var(--overlay); transition: transform 0.2s; flex-shrink: 0; }
.mod-chevron.open { transform: rotate(180deg); }

/* Block list (accordion body) */
.block-list { border-top: 1px solid var(--surface); display: none; }
.block-list.open { display: block; }

.block-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 62px;
  border-bottom: 1px solid var(--crust);
}
.block-row:last-child { border-bottom: none; }
.block-row-action { padding-left: 14px; padding-top: 9px; padding-bottom: 9px; }

.block-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bd-open   { background: var(--surface-1); }
.bd-green  { background: var(--green); }
.bd-yellow { background: var(--yellow); }

.block-name { flex: 1; font-size: 12px; color: var(--text); }

.block-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 99px;
  font-weight: 600; white-space: nowrap;
}
.bb-open   { background: var(--surface); color: var(--subtext); }
.bb-green  { background: var(--green-soft); color: var(--green); }
.bb-yellow { background: var(--yellow-soft); color: var(--yellow); }

/* Dashboard legend */
.dash-legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--subtext); }
.leg-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Sidebar Stats (replaces progress bar) ────────── */
.sidebar-stats {
  margin-top: auto;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--surface);
  flex-shrink: 0;
}
.sidebar-stats-label {
  font-size: 10px; font-weight: 700; color: var(--overlay);
  text-transform: uppercase; letter-spacing: 0.09em;
  margin-bottom: 8px;
}
.sidebar-mod-stat {
  display: flex; align-items: center; gap: 7px; padding: 4px 0;
}
.sms-label {
  font-size: 11px; font-weight: 600; color: var(--text);
  width: 36px; flex-shrink: 0;
}
.sms-bar {
  flex: 1; height: 5px; border-radius: 3px;
  background: var(--surface-1); overflow: hidden; display: flex;
}
.sms-seg { height: 100%; }
.sms-green  { background: var(--green); }
.sms-yellow { background: var(--yellow); }
.sms-count {
  font-size: 10px; color: var(--subtext);
  white-space: nowrap; min-width: 30px; text-align: right;
}

/* btn review state */
.btn.review { background: var(--yellow-soft); color: var(--yellow); border-color: var(--yellow); pointer-events: none; }

/* responsive */
@media (max-width: 768px) {
  .dash-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .dash-stat-val { font-size: 18px; }
  .seg-bar { width: 60px; }
  .block-row { padding-left: 14px; }
  /* prevent module rows from overflowing on narrow screens */
  .module-item { overflow: visible; }
  .module-header { flex-wrap: nowrap; min-width: 0; }
  .mod-meta { min-width: 0; overflow: hidden; }
  .mod-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mod-sub  { display: none; }
}

@media (max-width: 480px) {
  .dash-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .dash-stat { padding: 0.6rem 0.65rem; }
  .dash-stat-label { font-size: 10px; }
  .dash-stat-val { font-size: 16px; }
  /* hide progress bar on very small screens, just show % */
  .seg-bar { display: none; }
  .mod-pct { min-width: auto; }
}

/* ═══════════════════════════════════════════════════
   Content Components (M162 + general reuse)
═══════════════════════════════════════════════════ */



/* ── Callout boxes ────────────────────────────────── */
.callout {
  display: flex; gap: 10px; border-radius: 8px;
  padding: 0.8rem 1rem; margin-bottom: 1rem;
  font-size: 13px; line-height: 1.65; align-items: flex-start;
  border-left: 3px solid transparent;
}
.callout i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-title { font-weight: 600; margin-bottom: 3px; font-size: 13px; }
.callout p { font-size: 13px; margin: 0; }
/* blue  — informational */
.callout.c-info   { background: var(--accent-soft);  color: var(--accent);  border-left-color: var(--accent); }
/* amber — warning */
.callout.c-warn   { background: var(--yellow-soft);  color: var(--yellow);  border-left-color: var(--yellow); }
/* green — success / tip */
.callout.c-ok     { background: var(--green-soft);   color: var(--green);   border-left-color: var(--green); }
/* mauve — neutral note / hint */
.callout.c-note   { background: var(--mauve-soft);   color: var(--mauve);   border-left-color: var(--mauve); }
/* red   — danger / error */
.callout.c-danger { background: var(--red-soft);     color: var(--red);     border-left-color: var(--red); }

/* ── Step label (section divider with trailing line) ─ */
.step-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--overlay);
  margin: 1.75rem 0 0.75rem;
  display: flex; align-items: center; gap: 10px;
}
.step-label::after { content: ''; flex: 1; height: 1px; background: var(--surface); }

/* ── Thread (left-bordered citation block) ────────── */
.thread {
  border-left: 3px solid var(--teal); padding-left: 1rem;
  margin-bottom: 1rem;

}
.thread-title { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.thread p     { font-size: 13px; color: var(--subtext); line-height: 1.7; }

/* ── Card heading (inside .section-block) ─────────── */
.card-heading {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 0.6rem; display: flex; align-items: center; gap: 8px;
}
.card-heading i { font-size: 16px; color: var(--accent); }

/* ── Relational model schema box ──────────────────── */
.rm-box {
  background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem;
  font-family: 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  font-size: 12px; color: var(--text); line-height: 1.9;
}
.rm-box .rm-label {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--overlay); margin-bottom: 0.5rem;
}
.rm-line { display: block; }
.rm-pk   { text-decoration: underline; }
.rm-fk   { color: var(--yellow); }
.rm-new  { color: var(--green); }

/* ── Data table (named, for example rows) ─────────── */
.data-table {
  background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; overflow: hidden; margin-bottom: 1rem;
}
.dt-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table-title {
  background: var(--surface); padding: 0.4rem 0.85rem;
  font-size: 10.5px; font-weight: 700; color: var(--subtext);
  text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 1px solid var(--surface);
}
.data-table table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.data-table table thead th {
  padding: 0.5rem 0.85rem; text-align: left;
  font-weight: 600; font-size: 11.5px; color: var(--subtext);
  background: var(--sidebar-bg); border-bottom: 1px solid var(--surface);
}
.data-table table tbody td {
  padding: 0.45rem 0.85rem; color: var(--text);
  border-bottom: 1px solid var(--crust); vertical-align: top;
}
.data-table table tbody tr:last-child td { border-bottom: none; }

/* ── Arrow flow diagram ───────────────────────────── */
.arrow-flow { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.arrow-box {
  flex: 1; background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; padding: 0.6rem 0.85rem;
  font-size: 12.5px; color: var(--subtext); text-align: center;
}
.arrow-box.active {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}
.arrow-box .arrow-sub { font-size: 11px; color: var(--overlay); margin-top: 2px; display: block; }
.arrow-box.active .arrow-sub { color: var(--accent-dim); opacity: 0.8; }
.arrow-mid { font-size: 18px; color: var(--overlay); flex-shrink: 0; }

/* ── Anomaly cards grid ───────────────────────────── */
.anom-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0.65rem; margin-bottom: 1rem;
}
.anom-card {
  background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; padding: 0.85rem 1rem;
}
.anom-icon  { font-size: 20px; margin-bottom: 0.4rem; }
.anom-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.anom-desc  { font-size: 12px; color: var(--subtext); line-height: 1.55; }
.anom-ex    { font-size: 11.5px; color: var(--red); margin-top: 5px; line-height: 1.45; }

/* ── Normalform badges + blocks ───────────────────── */
.nf-block {
  background: var(--sidebar-bg);
  border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.nf-header { display: flex; align-items: center; gap: 10px; margin-bottom: 0.65rem; }
.nf-badge  {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 6px; white-space: nowrap;
}
.nf-0 { background: var(--red-soft);    color: var(--red); }
.nf-1 { background: var(--yellow-soft); color: var(--yellow); }
.nf-2 { background: var(--accent-soft); color: var(--accent); }
.nf-3 { background: var(--green-soft);  color: var(--green); }
.nf-title { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Utility text colours ─────────────────────────── */
.text-danger { color: var(--red);    font-weight: 500; }
.text-warn   { color: var(--yellow); font-weight: 500; }
.text-fk     { color: var(--yellow); }
.text-new    { color: var(--green); }
.pk-u        { text-decoration: underline; }

/* ── ER-Modell components (Block 2) ───────────────── */
.er-wrap {
  background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem; overflow-x: auto;
  border-left: 3px solid var(--accent);

}
.sym-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem; margin-bottom: 1rem;
}
.sym-card {
  background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; padding: 0.85rem 1rem;
}
.sym-icon { display: flex; align-items: center; justify-content: center; height: 36px; margin-bottom: 0.5rem; }
.sym-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; text-align: center; }
.sym-desc { font-size: 11.5px; color: var(--subtext); text-align: center; line-height: 1.5; }

.kard-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.65rem; margin-bottom: 1rem;
}
.kard-card {
  background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; padding: 0.75rem 1rem;
}
.kard-sym   { font-family: 'Cascadia Code', Consolas, monospace; font-size: 20px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.kard-label { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.kard-desc  { font-size: 12px; color: var(--subtext); line-height: 1.5; }
.kard-ex    { font-size: 11px; color: var(--overlay); margin-top: 4px; font-style: italic; }

.process-list { margin-bottom: 1rem; }
.process-item {
  display: flex; gap: 14px; padding: 0.75rem 0;
  border-bottom: 1px solid var(--surface);
}
.process-item:last-child { border-bottom: none; }
.p-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.p-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.p-desc  { font-size: 12.5px; color: var(--subtext); line-height: 1.6; }

.rel-block {
  background: var(--sidebar-bg); border: 1px solid var(--surface);
  border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 0.75rem;
}
.rel-header { display: flex; align-items: center; gap: 10px; margin-bottom: 0.6rem; }
.rel-badge  {
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px;
}
.rel-mc1  { background: var(--mauve-soft); color: var(--mauve); }
.rel-mcmc { background: var(--yellow-soft); color: var(--yellow); }
.rel-one1 { background: var(--green-soft);  color: var(--green); }
.rel-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.rel-expr {
  font-family: 'Cascadia Code', Consolas, monospace; font-size: 12.5px;
  background: var(--bg); border: 1px solid var(--surface);
  border-radius: 6px; padding: 0.5rem 0.85rem; margin-bottom: 0.6rem;
  color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.rel-entity  { background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 5px; font-size: 12px; }
.rel-kard    { color: var(--yellow); font-weight: 700; letter-spacing: 1px; }
.rel-kard-teal { color: var(--teal); font-weight: 700; }
.rel-diamond { color: var(--overlay); }
.rel-desc    { font-size: 13px; color: var(--subtext); line-height: 1.65; }
.rel-next    { font-size: 12px; color: var(--overlay); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

.pk-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 13px; border: 1px solid var(--surface); border-radius: 8px; overflow: hidden; }
.pk-table th { padding: 0.5rem 0.85rem; text-align: left; font-weight: 600; font-size: 11.5px; color: var(--subtext); border-bottom: 1px solid var(--surface); background: var(--surface); }
.pk-table td { padding: 0.5rem 0.85rem; border-bottom: 1px solid var(--crust); vertical-align: top; line-height: 1.55; background: var(--sidebar-bg); }
.pk-table tr:last-child td { border-bottom: none; }
.pk-good { color: var(--green); font-size: 12px; }
.pk-bad  { color: var(--red);   font-size: 12px; }


/* -- Block 2 svg Diagramm ----- */

.svg-ID {
  text-decoration: underline;
  fill: rgb(243, 89, 89);
}

/* ── Block 2 hero header ──────────────────────────── */
.block-hero { margin-bottom: 1.5rem; }
.block-hero-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem;
}
.block-hero-title {
  font-size: 26px; font-weight: 300; color: var(--text);
  line-height: 1.25; margin-bottom: 0.75rem; letter-spacing: -0.3px;
}
.block-hero-title strong { font-weight: 600; }
.block-hero-sub { font-size: 14px; color: var(--subtext); line-height: 1.75; max-width: 600px; }

/* ── Responsive overrides for new components ──────── */
@media (max-width: 600px) {
  .anom-grid { grid-template-columns: 1fr; }
  .sym-grid  { grid-template-columns: 1fr; }
  .kard-grid { grid-template-columns: 1fr; }
  .arrow-flow { flex-direction: column; }
  .block-hero-title { font-size: 20px; }
}

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  margin-left: var(--sidebar-width);
  padding: 0.9rem 2.5rem;
  border-top: 1px solid var(--surface);
  font-size: 11px; color: var(--overlay);
  line-height: 1.6; background: var(--bg);
  transition: background 0.2s, color 0.2s;
}

/* ── Mobile Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  }

  .sidebar-logo {
    padding-top: 0.75rem;
    padding-left: 3.25rem;
    padding-right: 25px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .sidebar.mobile-open { transform: translateX(0); }

  .content {
    margin-left: 0 !important;
    padding: 1.25rem;
    padding-top: 4rem;
    max-width: 100%;
  }

  .module-cards      { grid-template-columns: 1fr; }
  .sql-blocks-grid   { grid-template-columns: 1fr 1fr !important; }
  .page-nav          { flex-direction: column; }
  .page-nav-right    { margin-left: 0; width: 100%; }
  .page-nav .btn     { width: 100%; justify-content: center; }
  .content-table     { font-size: 11.5px; }
  .content-table td,
  .content-table th  { padding: 0.4rem 0.5rem; }
  .site-footer       { margin-left: 0; }
}
