/* ============================================================
   CMD Akademia AI — Panel uczestnika
   Profesjonalny design: sidebar + content
   ============================================================ */

:root {
  /* palette */
  --sidebar-bg: #061329;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active: rgba(94,229,229,0.15);
  --sidebar-border: rgba(94,229,229,0.25);
  --sidebar-text: #b6cad5;
  --sidebar-text-bright: #ecfbff;

  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --ink: #0f172a;
  --ink-secondary: #475569;
  /* przyciemnione dla kontrastu WCAG AA (poprzednio #94a3b8) */
  --ink-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --accent: #0ea5e9;
  --accent-light: #e0f2fe;
  --accent-dark: #0284c7;
  --cyan: #5ee5e5;
  --cyan-dark: #20b9be;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --violet: #7c3aed;
  --violet-light: #f3e8ff;

  --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --gradient-accent: linear-gradient(135deg, #5ee5e5 0%, #0ea5e9 50%, #6366f1 100%);
  --gradient-dark: linear-gradient(160deg, #061329 0%, #0c2d4a 40%, #1e1b4b 100%);
  --gradient-card: linear-gradient(135deg, rgba(94,229,229,0.04) 0%, rgba(99,102,241,0.04) 100%);
  --gradient-glow: linear-gradient(135deg, rgba(94,229,229,0.12) 0%, rgba(14,165,233,0.08) 50%, rgba(99,102,241,0.08) 100%);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.1), 0 4px 8px -4px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 20px rgba(14,165,233,0.15), 0 0 60px rgba(94,229,229,0.06);

  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-width: 260px;
  --topbar-height: 64px;

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== RESET ===== */

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(94,229,229,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(99,102,241,0.05) 0%, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input { font: inherit; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14,165,233,0.25);
  border: none;
}
.btn--primary:hover {
  box-shadow: 0 4px 16px rgba(14,165,233,0.35);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--surface-hover); }

.btn--ghost {
  background: transparent;
  color: var(--ink-secondary);
}
.btn--ghost:hover { background: var(--surface-hover); }

.btn--success {
  background: var(--green);
  color: #fff;
}
.btn--success:hover { background: #15803d; }

.btn--danger {
  background: var(--red);
  color: #fff;
}

.btn--demo {
  background: var(--sidebar-bg);
  color: #fff;
  border: 2px solid var(--cyan);
}
.btn--demo:hover { background: #0a1e3d; }

.btn--full { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--lg { padding: 14px 28px; font-size: 16px; }

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 6px;
}

/* ===== LOGIN SCREEN ===== */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 18% 24%, rgba(94,229,229,0.3), transparent 40%),
    radial-gradient(ellipse at 84% 18%, rgba(99,102,241,0.2), transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(14,165,233,0.15), transparent 50%),
    linear-gradient(160deg, #061329 0%, #0c2d4a 42%, #1e1b4b 48%, #f0f4f8 48%);
}

.login-card {
  width: 100%;
  max-width: 520px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, var(--cyan), var(--accent), #6366f1, #d8b764) border-box;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 80px rgba(6,19,41,0.28), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(8px);
}

.login-logo {
  width: 200px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.login-card h1 {
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
}

.login-subtitle {
  color: var(--ink-secondary);
  font-size: 14px;
  margin-top: -8px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#register-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

.login-links {
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}

.login-links a {
  color: var(--accent-dark);
  font-weight: 500;
}

.login-links__sep {
  margin: 0 8px;
  color: var(--border);
}

.login-status {
  font-size: 13px;
  color: var(--red);
  text-align: center;
  min-height: 20px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.password-hint {
  font-size: 12px;
  color: var(--ink-secondary);
  background: linear-gradient(135deg, rgba(94,229,229,0.14), rgba(14,165,233,0.08));
  border: 1px solid rgba(14,165,233,0.18);
  border-radius: 8px;
  padding: 10px 12px;
}

.login-actions {
  margin-top: 4px;
}

/* ===== REGISTER CONSENTS ===== */

.register-consents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.consent-checkbox input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent-checkbox a {
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: underline;
}

/* ===== PASSWORD TOGGLE ===== */

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  padding-right: 44px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink-muted);
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.password-toggle:hover {
  color: var(--accent);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* ===== MODALS ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 19, 41, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 24px 80px rgba(6,19,41,0.35);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h2 {
  font-size: 20px;
  color: var(--ink);
  margin: 0;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--ink-secondary);
  margin: -4px 0 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.modal-footer-link {
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 8px;
}

.modal-footer-link a {
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: none;
}

.modal-footer-link a:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== APP SHELL ===== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--gradient-dark);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow-y: auto;
  border-right: 1px solid rgba(94,229,229,0.08);
}

.sidebar__top {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar__logo {
  width: 180px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.sidebar__nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  text-align: left;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(94,229,229,0.15) 0%, rgba(99,102,241,0.12) 100%);
  color: var(--cyan);
  font-weight: 600;
  border-left: 3px solid var(--cyan);
  padding-left: 11px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan) 0%, #6366f1 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(94,229,229,0.3);
}

.sidebar__user-info {
  min-width: 0;
}

.sidebar__user-info strong {
  display: block;
  font-size: 13px;
  color: var(--sidebar-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-info span {
  display: block;
  font-size: 12px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__access {
  background: linear-gradient(135deg, rgba(94,229,229,0.06) 0%, rgba(99,102,241,0.06) 100%);
  border: 1px solid rgba(94,229,229,0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}

.sidebar__access span {
  display: block;
  color: var(--sidebar-text);
}

.sidebar__access strong {
  display: block;
  color: var(--cyan);
  margin-top: 2px;
  font-size: 13px;
}

.sidebar .btn--ghost {
  color: var(--sidebar-text);
  border: 1px solid rgba(255,255,255,0.1);
}
.sidebar .btn--ghost:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-bright);
}

/* ===== BOTTOM NAV (mobile) ===== */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gradient-dark);
  z-index: 40;
  padding: 4px 0;
  border-top: 1px solid rgba(94,229,229,0.1);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  /* min. 44px wysokości i 12px font — czytelne dla słabszego wzroku */
  padding: 9px 4px;
  min-height: 48px;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s;
}

.bottom-nav__item svg {
  width: 22px;
  height: 22px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav__item.is-active {
  color: var(--cyan);
}

/* ===== MAIN CONTENT ===== */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 0 32px 40px;
  min-width: 0;
}

/* ===== TOPBAR ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  background: rgba(240,244,248,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.topbar h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__program {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-primary);
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(14,165,233,0.2);
}

/* ===== VIEWS ===== */

.view {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== DASHBOARD ===== */

.dashboard-welcome {
  background: linear-gradient(135deg, #061329 0%, #0c2d4a 45%, #1e1b4b 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.dashboard-welcome::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(94,229,229,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.dashboard-welcome::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: 10%;
  width: 40%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.dashboard-welcome h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.dashboard-welcome p {
  color: #94b8d4;
  font-size: 14px;
  max-width: 600px;
}

.dashboard-welcome .eyebrow {
  display: inline-block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dash-card {
  background: var(--surface);
  background-image: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.dash-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.dash-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(14,165,233,0.2);
  transform: translateY(-3px);
}

.dash-card:hover::before {
  opacity: 1;
}

.dash-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-card__icon svg {
  width: 22px;
  height: 22px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-card__icon--pretraining { background: linear-gradient(135deg, #dbeafe, #e0f2fe); color: var(--blue); }
.dash-card__icon--modules { background: linear-gradient(135deg, #f3e8ff, #ede9fe); color: #7c3aed; }
.dash-card__icon--materials { background: linear-gradient(135deg, #dbeafe, #e0f2fe); color: var(--blue); }
.dash-card__icon--prompts { background: linear-gradient(135deg, #f3e8ff, #fce7f3); color: #7c3aed; }
.dash-card__icon--flashcards { background: linear-gradient(135deg, #fef3c7, #fef9c3); color: #d97706; }
.dash-card__icon--test { background: linear-gradient(135deg, #dcfce7, #d1fae5); color: var(--green); }

.dash-card h4 {
  font-size: 15px;
  font-weight: 600;
}

.dash-card p {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

/* ===== MATERIALS ===== */

.materials-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.material-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.15s;
}

.material-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.material-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--red-light);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
}

.material-info {
  flex: 1;
  min-width: 0;
}

.material-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.material-info p {
  font-size: 13px;
  color: var(--ink-secondary);
}

.material-meta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* ===== PROMPTS ===== */

.prompts-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.is-active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(14,165,233,0.2);
}

.prompts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.prompt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}

.prompt-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(14,165,233,0.15);
  transform: translateY(-2px);
}

.prompt-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.prompt-card h4 {
  font-size: 15px;
  font-weight: 600;
}

.prompt-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.prompt-badge--email { background: var(--blue-light); color: var(--blue); }
.prompt-badge--analiza { background: #f3e8ff; color: #7c3aed; }
.prompt-badge--organizacja { background: var(--amber-light); color: #d97706; }
.prompt-badge--kreacja { background: var(--green-light); color: var(--green); }
.prompt-badge--dane { background: var(--red-light); color: var(--red); }

.prompt-usecase {
  font-size: 13px;
  color: var(--ink-secondary);
  font-style: italic;
}

.prompt-text {
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  flex: 1;
}

.prompt-card .btn {
  align-self: flex-start;
}

.prompt-card--locked {
  opacity: 0.7;
  border-style: dashed;
}

.prompt-card--locked:hover {
  border-color: var(--amber);
}

.prompt-text--blur {
  filter: blur(3px);
  user-select: none;
  pointer-events: none;
}

.prompt-lock-icon {
  font-size: 14px;
  margin-left: 6px;
}

.prompts-unlock-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(14,165,233,0.06));
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
  flex-wrap: wrap;
}

/* ===== AI NEWS ===== */

.ai-news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.ai-news-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.ai-news-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ai-news-card__category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: 4px;
}

.ai-news-card__date {
  font-size: 12px;
  color: var(--ink-muted);
}

.ai-news-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.4;
}

.ai-news-card__summary {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin: 0 0 10px;
}

.ai-news-card__source {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
}

/* ===== FLASHCARDS ===== */

.flashcards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.flashcards-counter {
  font-size: 14px;
  color: var(--ink-secondary);
  font-weight: 600;
}

.flashcards-counter strong {
  color: var(--accent-dark);
}

.flashcard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.flashcard {
  width: 100%;
  max-width: 560px;
  min-height: 280px;
  perspective: 1000px;
  cursor: pointer;
}

.flashcard__inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard.is-flipped .flashcard__inner {
  transform: rotateY(180deg);
}

.flashcard__front,
.flashcard__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.flashcard__front {
  background: var(--gradient-dark);
  color: #fff;
  border: 2px solid rgba(94,229,229,0.3);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.flashcard__back {
  background: var(--surface);
  border: 2px solid var(--green);
  transform: rotateY(180deg);
  color: var(--ink);
}

.flashcard__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  opacity: 0.6;
}

.flashcard__front .flashcard__label { color: var(--cyan); opacity: 1; }
.flashcard__back .flashcard__label { color: var(--green); opacity: 1; }

.flashcard__text {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 500;
}

.flashcard__hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 20px;
}

.flashcard__front .flashcard__hint { color: rgba(255,255,255,0.4); }

.flashcard-actions {
  display: flex;
  gap: 12px;
}

.flashcard-actions .btn {
  min-width: 140px;
}

.flashcards-progress {
  width: 100%;
  max-width: 560px;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.flashcards-progress__bar {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.flashcards-done {
  text-align: center;
  padding: 60px 20px;
}

.flashcards-done h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.flashcards-done p {
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

/* ===== TEST / QUIZ ===== */

.test-intro {
  text-align: center;
  max-width: 520px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.test-intro__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(14,165,233,0.3);
}

.test-intro__icon svg {
  width: 32px;
  height: 32px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.test-intro h3 {
  font-size: 22px;
}

.test-intro p {
  color: var(--ink-secondary);
  font-size: 14px;
}

.test-rules {
  list-style: none;
  text-align: left;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.test-rules li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.test-rules li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex-shrink: 0;
}

/* QUIZ ACTIVE */

.quiz-container {
  max-width: 700px;
  margin: 0 auto;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.test-intro {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.quiz-header__info {
  font-size: 14px;
  color: var(--ink-secondary);
  font-weight: 600;
}

.quiz-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border);
}

.quiz-timer svg {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quiz-timer.is-warning {
  border-color: var(--amber);
  color: var(--amber);
}

.quiz-timer.is-danger {
  border-color: var(--red);
  color: var(--red);
  animation: pulse 0.5s ease infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.quiz-timer.is-expired {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
}

.quiz-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-bar__fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.quiz-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.quiz-question-card h4 {
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: all 0.15s;
  color: var(--ink);
}

.quiz-answer:hover:not(.is-disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.quiz-answer.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
}

.quiz-answer.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quiz-answer__letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.quiz-answer.is-selected .quiz-answer__letter {
  background: var(--accent);
  color: #fff;
}

.quiz-nav-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* QUESTION MAP */

.quiz-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
  justify-content: center;
}

.quiz-map__item {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  transition: all 0.15s;
}

.quiz-map__item:hover { border-color: var(--accent); }
.quiz-map__item.is-current { border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark); }
.quiz-map__item.is-answered { border-color: var(--green); background: var(--green-light); color: var(--green); }
.quiz-map__item.is-expired { border-color: var(--red); background: var(--red-light); color: var(--red); }

/* QUIZ RESULTS */

.quiz-results {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.quiz-results__score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.quiz-results__score-circle.is-pass {
  background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
  border: 4px solid var(--green);
  color: var(--green);
  box-shadow: 0 8px 24px rgba(22,163,74,0.2);
}

.quiz-results__score-circle.is-fail {
  background: var(--red-light);
  border: 4px solid var(--red);
  color: var(--red);
}

.quiz-results__score-circle .score-percent {
  font-size: 42px;
  line-height: 1;
}

.quiz-results__score-circle .score-label {
  font-size: 13px;
  margin-top: 4px;
}

.quiz-results h3 {
  font-size: 24px;
}

.quiz-results p {
  color: var(--ink-secondary);
  font-size: 14px;
}

.quiz-results__details {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.quiz-results__details strong {
  color: var(--ink);
}

.quiz-results__actions {
  display: flex;
  gap: 12px;
}

/* ===== CERTIFICATE ===== */

.certificate-locked {
  text-align: center;
  padding: 60px 20px;
  max-width: 480px;
  margin: 0 auto;
}

.certificate-locked__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--amber-light);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.certificate-locked__icon svg {
  width: 32px;
  height: 32px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.certificate-locked h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.certificate-locked p {
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

.certificate-success {
  text-align: center;
  margin-bottom: 24px;
}

.certificate-success__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.certificate-success h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.certificate-success p {
  color: var(--ink-secondary);
  font-size: 14px;
}

/* CERTIFICATE PREVIEW */

.cert-preview {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(45,106,79,0.08);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Decorative inner border handled by .cert-decorative-border */

.cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cert-header__logo {
  width: 160px;
  background: var(--sidebar-bg);
  border-radius: 6px;
  padding: 8px;
}

.cert-header__right {
  text-align: right;
}

.cert-header__right span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.cert-header__right strong {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.cert-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 20px 0;
}

.cert-body__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

.cert-body__title {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 800;
  color: var(--sidebar-bg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cert-body__name {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.cert-body__program {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--ink);
  font-weight: 600;
}

.cert-body__subtitle {
  font-size: 13px;
  color: var(--ink-muted);
}

.cert-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.cert-footer__col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cert-footer__col span {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cert-footer__col strong {
  font-size: 13px;
  color: var(--ink);
}

.cert-footer__signature {
  text-align: center;
}

.cert-footer__signature-line {
  width: 180px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 4px;
}

.cert-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ===== SECTION HEADERS ===== */

.section-header {
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.section-header p {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-top: 4px;
}

/* ===== EMPTY STATE ===== */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--ink-muted);
  margin-bottom: 12px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== TOAST ===== */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--sidebar-bg);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 100;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== CHAT NOTIFICATION WIDGET ===== */

.chat-notif-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.chat-notif-widget.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-notif-widget__content {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--ink);
  max-width: 380px;
}

.chat-notif-widget__content svg {
  flex-shrink: 0;
  color: var(--accent);
}

.chat-notif-widget__go {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chat-notif-widget__close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

@media (max-width: 640px) {
  .chat-notif-widget {
    bottom: 72px;
    right: 12px;
    left: 12px;
  }
  .chat-notif-widget__content {
    max-width: 100%;
  }
}

/* ===== PREVIEW MODE (free user) ===== */

.view.is-preview {
  position: relative;
  min-height: 400px;
}

.view.is-preview > *:not(.preview-overlay) {
  filter: blur(2px) grayscale(0.4);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  background: rgba(248,250,252,0.3);
  backdrop-filter: blur(1px);
}

.preview-overlay__card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  max-width: 440px;
  text-align: center;
}

.preview-overlay__card svg {
  color: var(--amber);
  margin-bottom: 16px;
}

.preview-overlay__card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--ink);
}

.preview-overlay__card p {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.preview-overlay__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== CERTIFICATE: decorative border ===== */

.cert-decorative-border {
  border: 3px double #b8860b;
  border-radius: 6px;
  padding: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cert-bur-info {
  text-align: center;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.02em;
}

/* ===== NEWS SECTION (dashboard) ===== */

.news-section { margin-top: 24px; }
.news-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.news-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.news-card__tag { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.news-card__tag--models { background: #f3e8ff; color: #7c3aed; }
.news-card__tag--regulations { background: #fee2e2; color: #dc2626; }
.news-card__tag--tools { background: #dbeafe; color: #2563eb; }
.news-card__tag--automation { background: #dcfce7; color: #16a34a; }
.news-card__body h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.news-card__body p { font-size: 13px; color: var(--ink-secondary); margin: 0; line-height: 1.4; }
.news-card__date { font-size: 11px; color: var(--ink-muted); }
.news-toggle { font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; background: none; border: none; padding: 8px 0; }

/* ===== PRINT ===== */

.print-certificate {
  display: none;
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }

  body > *:not(.print-certificate) { display: none !important; }

  .print-certificate {
    display: block !important;
    width: 100%;
    height: 100vh;
  }

  .print-certificate .cert-preview {
    max-width: none;
    width: 100%;
    height: 100vh;
    aspect-ratio: auto;
    border: 1px solid #999;
    box-shadow: none;
    margin: 0;
    border-radius: 0;
    page-break-inside: avoid;
  }

  .print-certificate .cert-decorative-border {
    border: 3px double #b8860b;
    height: 100%;
  }

  .print-certificate .cert-bur-info {
    color: #666;
  }
}

/* ===== SIDEBAR NAV SEPARATOR ===== */

.sidebar__nav-separator {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 14px;
}

/* ===== NOTIFICATION BADGE (sidebar + mobile) ===== */

.nav-item--notifications,
.bottom-nav__item--notifications {
  position: relative;
}

.notification-badge {
  display: none;
  position: absolute;
  top: 4px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
}

.notification-badge.is-visible {
  display: block;
}

.notification-badge--mobile {
  top: 0;
  right: 50%;
  transform: translateX(12px);
}

/* ===== COMMUNITY (chat grupowy) ===== */

.community-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 56px);
  max-height: 700px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.community-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.community-header__info h3 {
  font-size: 16px;
  font-weight: 600;
}

.community-header__count {
  font-size: 13px;
  color: var(--ink-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.chat-message--reply {
  margin-left: 28px;
  padding-left: 14px;
  border-left: 3px solid var(--accent-light);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-avatar--admin {
  background: var(--blue);
  color: #fff;
}

.chat-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.chat-message__body {
  flex: 1;
  min-width: 0;
}

.chat-message__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.chat-message__header strong {
  font-size: 14px;
  color: var(--ink);
}

.chat-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue);
}

.chat-message__time {
  font-size: 12px;
  color: var(--ink-muted);
}

.chat-reply-ref {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: 4px;
  padding: 4px 8px;
  background: var(--border-light);
  border-radius: 4px;
  border-left: 2px solid var(--accent);
}

.chat-message__content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  word-wrap: break-word;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.15s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

/* ===== MESSAGES (DM) ===== */

.dm-container {
  height: calc(100vh - var(--topbar-height) - 56px);
  max-height: 700px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dm-container--mobile-thread {
  display: flex;
  flex-direction: column;
}

.dm-layout {
  display: grid;
  grid-template-columns: 30% 70%;
  height: 100%;
}

.dm-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dm-sidebar__header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.dm-sidebar__header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.dm-conversations {
  flex: 1;
  overflow-y: auto;
}

.dm-conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
}

.dm-conversation-item:hover {
  background: var(--surface-hover);
}

.dm-conversation-item.is-active {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
}

.dm-conversation-info {
  flex: 1;
  min-width: 0;
}

.dm-conversation-info__top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-conversation-info__top strong {
  font-size: 13px;
  color: var(--ink);
}

.dm-conversation-info__badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue);
}

.dm-conversation-preview {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.dm-conversation-time {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.dm-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dm-thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.dm-thread-header__user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-thread-header__user strong {
  font-size: 14px;
}

.dm-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dm-bubble {
  max-width: 75%;
  display: flex;
  flex-direction: column;
}

.dm-bubble--mine {
  align-self: flex-end;
}

.dm-bubble--theirs {
  align-self: flex-start;
}

.dm-bubble__content {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.dm-bubble--mine .dm-bubble__content {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.dm-bubble--theirs .dm-bubble__content {
  background: var(--border-light);
  color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.dm-bubble__time {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.dm-bubble--mine .dm-bubble__time {
  text-align: right;
}

/* ===== NOTIFICATIONS ===== */

.notifications-container {
  max-width: 700px;
}

.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.notifications-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.notifications-header__count {
  font-size: 13px;
  color: var(--ink-muted);
  display: block;
  margin-top: 2px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.notification-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.notification-item--unread {
  background: var(--accent-light);
  border-color: rgba(14,165,233,0.2);
}

.notification-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-item__icon--message {
  background: var(--blue-light);
  color: var(--blue);
}

.notification-item__icon--dm {
  background: #f3e8ff;
  color: #7c3aed;
}

.notification-item__icon--material {
  background: var(--green-light);
  color: var(--green);
}

.notification-item__icon--announcement {
  background: var(--amber-light);
  color: #d97706;
}

.notification-item__icon--test_result {
  background: var(--green-light);
  color: var(--green);
}

.notification-item__icon--certificate {
  background: var(--amber-light);
  color: #d97706;
}

.notification-item__body {
  flex: 1;
  min-width: 0;
}

.notification-item__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.notification-item__text {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item__time {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== RESPONSIVE: TABLET ===== */

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 72px;
  }

  .sidebar__logo {
    width: 40px;
  }

  .sidebar__top {
    padding: 16px 12px 12px;
    display: flex;
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
    padding: 10px;
  }

  .nav-item span {
    display: none;
  }

  .sidebar__footer {
    padding: 10px;
  }

  .sidebar__user-info,
  .sidebar__access span {
    display: none;
  }

  .dark-mode-toggle span { display: none; }
  .dark-mode-toggle { justify-content: center; }

  .sidebar__access {
    text-align: center;
    padding: 8px;
  }

  .sidebar__access strong {
    font-size: 11px;
  }

  .sidebar .btn--ghost span,
  .sidebar .btn--ghost {
    font-size: 11px;
    padding: 6px;
  }

  .main-content {
    padding: 0 20px 40px;
  }

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

  .prompts-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== RESPONSIVE: MOBILE ===== */

@media (max-width: 640px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 0 16px 80px;
  }

  .topbar h2 { font-size: 20px; }

  .topbar__program { display: none; }
  #topbar-logout { display: none; }

  .dashboard-cards {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-welcome {
    padding: 24px 20px;
  }

  .dashboard-welcome h3 {
    font-size: 18px;
  }

  .prompts-grid {
    grid-template-columns: 1fr;
  }

  .material-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .quiz-nav-actions {
    flex-direction: column;
  }

  .quiz-results__details {
    flex-direction: column;
    gap: 8px;
  }

  .quiz-results__actions {
    flex-direction: column;
    width: 100%;
  }

  .quiz-results__actions .btn {
    width: 100%;
  }

  .cert-preview {
    padding: 12px;
    aspect-ratio: auto;
    min-height: 400px;
  }

  .cert-decorative-border {
    padding: 20px;
  }

  .cert-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cert-header__right {
    text-align: left;
  }

  .cert-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .cert-actions {
    flex-direction: column;
    width: 100%;
  }

  .cert-actions .btn {
    width: 100%;
  }

  .flashcard-actions {
    width: 100%;
  }

  .flashcard-actions .btn {
    flex: 1;
  }

  /* Community mobile */
  .community-container {
    height: calc(100vh - var(--topbar-height) - 120px);
    max-height: none;
    border-radius: var(--radius);
  }

  .chat-messages {
    padding: 12px;
  }

  .chat-input-bar {
    padding: 10px 12px;
  }

  .chat-message--reply {
    margin-left: 12px;
    padding-left: 10px;
  }

  /* DM mobile */
  .dm-container {
    height: calc(100vh - var(--topbar-height) - 120px);
    max-height: none;
    border-radius: var(--radius);
  }

  .dm-layout {
    grid-template-columns: 1fr;
  }

  .dm-bubble {
    max-width: 85%;
  }

  .dm-thread {
    padding: 12px;
  }

  /* Notifications mobile */
  .notifications-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .notification-item {
    padding: 12px;
  }

  .notification-item__icon {
    width: 32px;
    height: 32px;
  }

  .notification-item__time {
    display: none;
  }

  .bottom-nav__item svg {
    width: 20px;
    height: 20px;
  }
}

/* ===== MORE MENU (mobile) ===== */

.more-menu {
  position: fixed;
  bottom: 56px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  min-width: 200px;
  padding: 8px 0;
}

.more-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
}

.more-menu__item:hover {
  background: var(--surface-hover);
}

.more-menu__item--logout {
  color: var(--red);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.notification-badge--inline {
  display: inline-flex;
  position: static;
  transform: none;
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
}

/* ===== SHOP / PRICING ===== */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.shop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: all 0.2s;
}

.shop-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.shop-card--featured {
  border: 2px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--gradient-accent);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.shop-card--dark {
  background: var(--gradient-dark);
  color: #fff;
  border-color: rgba(94,229,229,0.3);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.shop-card--dark h4 {
  color: #fff;
}

.shop-card--dark p,
.shop-card--dark .shop-benefit {
  color: #94b8d4;
}

.shop-card--dark .shop-benefit__check {
  color: var(--cyan);
}

.shop-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.shop-badge--popular {
  background: var(--accent);
  color: #fff;
}

.shop-badge--value {
  background: var(--cyan-dark);
  color: #fff;
}

.shop-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-card__icon svg {
  width: 24px;
  height: 24px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-card__icon--starter { background: var(--amber-light); color: #d97706; }
.shop-card__icon--club { background: var(--blue-light); color: var(--blue); }
.shop-card__icon--insider { background: #f3e8ff; color: #7c3aed; }
.shop-card__icon--training { background: rgba(94,229,229,0.2); color: var(--cyan); }

.shop-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.shop-price__amount {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.shop-price__period {
  font-size: 14px;
  color: var(--ink-secondary);
}

.shop-card--dark .shop-price__period {
  color: #94b8d4;
}

.shop-price__original {
  font-size: 16px;
  color: var(--ink-muted);
  text-decoration: line-through;
}

.shop-card--dark .shop-price__original {
  color: rgba(255,255,255,0.4);
}

.shop-benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.shop-benefit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.shop-benefit__check {
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.shop-card .btn {
  width: 100%;
  margin-top: auto;
  text-decoration: none;
  text-align: center;
}

/* Shop banner on dashboard */
.shop-banner {
  background: var(--gradient-dark);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 8px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.shop-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 50%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(94,229,229,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.shop-banner .eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}

.shop-banner h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.shop-banner p {
  font-size: 13px;
  color: #94b8d4;
  margin: 0;
}

@media (max-width: 900px) {
  .shop-grid { grid-template-columns: 1fr; }
  .shop-banner { flex-direction: column; text-align: center; }
}

/* ===== RANKING CARD (dashboard) ===== */

.ranking-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, rgba(6,19,41,0.03) 0%, rgba(99,102,241,0.05) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.ranking-card__left {
  flex-shrink: 0;
}

.ranking-level {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-dark);
}

.ranking-points {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 600;
  margin-top: 2px;
}

.ranking-card__right {
  flex: 1;
  min-width: 0;
}

.ranking-bar {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.ranking-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.ranking-next {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 6px;
}

@media (max-width: 640px) {
  .ranking-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ===== DASHBOARD CARDS: new icons ===== */

.dash-card__icon--pretraining { background: #fce7f3; color: #db2777; }
.dash-card__icon--modules { background: #ede9fe; color: #7c3aed; }

/* ===== PRE-TRAINING ===== */

.pt-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.pt-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.pt-progress-label {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 600;
  margin-bottom: 20px;
}

.pt-complete-banner {
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.pt-complete-banner h3 {
  color: var(--green);
  font-size: 18px;
  margin-bottom: 6px;
}

.pt-complete-banner p {
  color: #15803d;
  font-size: 14px;
}

.pt-lessons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pt-lesson {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all 0.15s;
}

.pt-lesson--available {
  cursor: pointer;
}

.pt-lesson--available:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.pt-lesson--completed {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.03);
}

.pt-lesson--locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.pt-lesson__number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--ink-secondary);
}

.pt-lesson--completed .pt-lesson__number {
  background: var(--green-light);
  color: var(--green);
}

.pt-lesson--available .pt-lesson__number {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.pt-lesson__info {
  flex: 1;
  min-width: 0;
}

.pt-lesson__info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.pt-lesson__meta {
  font-size: 12px;
  color: var(--ink-muted);
}

.pt-lesson__status {
  flex-shrink: 0;
}

/* Lesson view */

.pt-lesson-view {
  max-width: 700px;
}

.pt-lesson-header {
  margin: 20px 0;
}

.pt-lesson-header__number {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pt-lesson-header h3 {
  font-size: 22px;
  margin: 6px 0 4px;
}

.pt-lesson-header__duration {
  font-size: 13px;
  color: var(--ink-muted);
}

.pt-lesson-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  line-height: 1.7;
  font-size: 15px;
}

.pt-lesson-content p { margin-bottom: 12px; }
.pt-lesson-content p:last-child { margin-bottom: 0; }
.pt-lesson-content ul, .pt-lesson-content ol { margin: 8px 0 12px 20px; }
.pt-lesson-content li { margin-bottom: 4px; }

.pt-quiz-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.pt-quiz-section h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--ink);
}

.pt-quiz-question {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.pt-quiz-question:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pt-quiz-question__text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.pt-quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pt-quiz-answer {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  transition: all 0.15s;
  color: var(--ink);
}

.pt-quiz-answer:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.pt-quiz-answer.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.pt-quiz-answer.is-correct {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
  font-weight: 600;
}

.pt-quiz-answer.is-wrong {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
}

.pt-quiz-feedback {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.pt-quiz-question--correct .pt-quiz-feedback {
  color: var(--green);
}

.pt-quiz-question--wrong .pt-quiz-feedback {
  color: var(--red);
}

.pt-lesson-actions {
  text-align: center;
}

.pt-hint {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 8px;
}

.btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== MODULES ===== */

.mod-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.mod-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.mod-progress-label {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 600;
  margin-bottom: 20px;
}

.mod-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all 0.15s;
}

.mod-card--available {
  cursor: pointer;
}

.mod-card--available:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.mod-card--completed {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.03);
}

.mod-card--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.mod-card__header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mod-card__number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--ink-secondary);
}

.mod-card--completed .mod-card__number {
  background: var(--green-light);
  color: var(--green);
}

.mod-card--available .mod-card__number {
  background: #ede9fe;
  color: #7c3aed;
}

.mod-card__title {
  flex: 1;
  min-width: 0;
}

.mod-card__title h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.mod-card__title p {
  font-size: 13px;
  color: var(--ink-secondary);
}

.mod-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.mod-card__duration {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.mod-card__status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 999px;
}

.mod-card__status--done {
  background: var(--green-light);
  color: var(--green);
}

.mod-card__status--open {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.mod-card__status--locked {
  background: var(--border-light);
  color: var(--ink-muted);
}

.mod-card__topics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.mod-topic-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--border-light);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

/* Module quiz view */

.mod-quiz-view {
  max-width: 700px;
}

.mod-quiz-header {
  margin: 20px 0;
}

.mod-quiz-header h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.mod-quiz-header p {
  font-size: 14px;
  color: var(--ink-secondary);
}

.mod-quiz-questions {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

.mod-quiz-question__text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.mod-quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mod-quiz-answer {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  transition: all 0.15s;
  color: var(--ink);
}

.mod-quiz-answer:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.mod-quiz-answer.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.mod-quiz-actions {
  text-align: center;
}

@media (max-width: 640px) {
  .mod-card__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .mod-card__meta {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
}

/* ===== NOTES ===== */

.notes-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-form__row {
  display: flex;
  gap: 12px;
}

.notes-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  min-width: 200px;
}

.notes-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

.notes-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  resize: vertical;
  font-family: var(--font);
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

.notes-form .btn {
  align-self: flex-start;
}

.notes-list {
  margin-top: 8px;
}

.notes-list h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink-secondary);
}

.note-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.note-item:hover {
  border-color: var(--accent);
}

.note-item__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.note-item__date {
  font-size: 12px;
  color: var(--ink-muted);
}

.note-item__label {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.note-item__delete {
  margin-left: auto;
  color: var(--ink-muted);
}

.note-item__delete:hover {
  color: var(--red);
}

.note-item__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ===== TOOLS GRID ===== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.15s;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.tool-recommended-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
}

.tool-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-light), #ede9fe);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.tool-card__header h4 {
  font-size: 16px;
  font-weight: 700;
}

.tool-card__company {
  font-size: 12px;
  color: var(--ink-muted);
}

.tool-card__desc {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.tool-card__pricing {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.tool-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.tool-card__rating {
  display: flex;
  gap: 2px;
  color: var(--amber);
}

.tool-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== FAQ ===== */

.faq-search-bar {
  margin-bottom: 16px;
}

.faq-search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s;
}

.faq-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-item__question {
  padding: 16px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

.faq-item__question::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] .faq-item__question::after {
  transform: rotate(45deg);
}

.faq-item__category {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--border-light);
  color: var(--ink-muted);
  flex-shrink: 0;
}

.faq-item__answer {
  padding: 0 20px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-secondary);
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

/* ===== FAVORITE PROMPTS ===== */

.prompt-card__actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.prompt-fav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--ink-muted);
  transition: all 0.15s;
}

.prompt-fav-btn:hover {
  color: var(--amber);
  background: var(--amber-light);
}

.prompt-fav-btn.is-fav {
  color: var(--amber);
}

/* ===== DASHBOARD CARDS: 6-column grid adjustment ===== */

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

@media (max-width: 1024px) {
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dashboard-cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== PROGRESS RING (dashboard) ===== */

.progress-ring-section { display: flex; align-items: center; gap: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.progress-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.progress-ring svg { width: 100%; height: 100%; }
.progress-ring__bg { stroke: var(--border); }
.progress-ring__fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.progress-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.progress-ring__percent { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1; }
.progress-ring__text { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.progress-ring__details h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.progress-items { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.progress-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-secondary); }
.progress-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.progress-item__dot.done { background: var(--green); }
.progress-item__dot.partial { background: var(--amber); }

@media (max-width: 640px) {
  .progress-ring-section { flex-direction: column; text-align: center; }
  .progress-ring-section .progress-ring__details { text-align: left; width: 100%; }
}

/* ===== DARK MODE TOGGLE ===== */

.dark-mode-toggle { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.dark-mode-toggle span { font-size: 12px; color: var(--sidebar-text); }
.toggle-switch { width: 40px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.15); position: relative; cursor: pointer; border: none; padding: 0; }
.toggle-switch__slider { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--sidebar-text); transition: .2s; }
html.dark .toggle-switch { background: var(--accent); }
html.dark .toggle-switch__slider { left: 21px; background: #fff; }

html.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --ink: #e2e8f0;
  --ink-secondary: #94a3b8;
  --ink-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
}
html.dark .login-screen {
  background:
    radial-gradient(circle at 18% 24%, rgba(94,229,229,0.22), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(14,165,233,0.20), transparent 32%),
    linear-gradient(135deg, #020617 0%, #0f172a 100%);
}
html.dark .login-card { background: #1e293b; border-color: #334155; }
html.dark .modal-card { background: #1e293b; }
html.dark .modal-close { color: #94a3b8; }
html.dark .modal-close:hover { background: #334155; color: #e2e8f0; }
html.dark .topbar { background: #0f172a; }
html.dark .field input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html.dark .quiz-answer { background: #1e293b; color: #e2e8f0; border-color: #334155; }
html.dark .quiz-answer.is-selected { background: rgba(14,165,233,.15); }
html.dark .prompt-text { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .flashcard__back { background: #1e293b; color: #e2e8f0; }
html.dark .cert-preview { background: #1e293b; border-color: #475569; }
html.dark .notes-textarea { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html.dark .notes-select { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html.dark .faq-search-input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html.dark .chat-input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html.dark .pt-quiz-answer { background: #1e293b; color: #e2e8f0; border-color: #334155; }
html.dark .mod-quiz-answer { background: #1e293b; color: #e2e8f0; border-color: #334155; }

/* Dark mode — additional overrides for text visibility */
html.dark .test-intro h3,
html.dark .test-intro p,
html.dark .quiz-results h3,
html.dark .quiz-results p { color: var(--ink); }
html.dark .test-rules li { color: var(--ink-secondary); }
html.dark .certificate-locked h3,
html.dark .certificate-locked p,
html.dark .certificate-success h3,
html.dark .certificate-success p { color: var(--ink); }
html.dark .section-header h3,
html.dark .section-header p { color: var(--ink); }
html.dark .community-header h3 { color: var(--ink); }
html.dark .community-header__count { color: var(--ink-secondary); }
html.dark .chat-message__content { color: var(--ink); }
html.dark .chat-message__header strong { color: var(--ink); }
html.dark .chat-message__time { color: var(--ink-muted); }
html.dark .quiz-question-card h4 { color: var(--ink); }
html.dark .quiz-header__info { color: var(--ink-secondary); }
html.dark .quiz-results__details span { color: var(--ink-secondary); }
html.dark .quiz-nav-actions .btn--secondary { background: var(--surface-hover); color: var(--ink); border-color: var(--border); }
html.dark .progress-item { color: var(--ink-secondary); }
html.dark .dashboard-card { background: var(--surface); border-color: var(--border); }
html.dark .dashboard-card h4,
html.dark .dashboard-card p { color: var(--ink); }
html.dark .dashboard-card__value { color: var(--ink); }
html.dark .shop-card { background: var(--surface); border-color: var(--border); }
html.dark .shop-card h4 { color: var(--ink); }
html.dark .shop-benefit { color: var(--ink-secondary); }
html.dark .tool-card { background: var(--surface); border-color: var(--border); }
html.dark .tool-card h4 { color: var(--ink); }
html.dark .tool-card p { color: var(--ink-secondary); }
html.dark .faq-card { background: var(--surface); border-color: var(--border); }
html.dark .faq-card h4,
html.dark .faq-card__question { color: var(--ink); }
html.dark .faq-card__answer { color: var(--ink-secondary); }
html.dark .notification-item { background: var(--surface); border-color: var(--border); }
html.dark .notification-item__title { color: var(--ink); }
html.dark .notification-item__text { color: var(--ink-secondary); }
html.dark .pt-lesson-card { background: var(--surface); border-color: var(--border); }
html.dark .pt-lesson-card h4 { color: var(--ink); }
html.dark .pt-lesson-card p { color: var(--ink-secondary); }
html.dark .mod-card { background: var(--surface); border-color: var(--border); }
html.dark .mod-card h4 { color: var(--ink); }
html.dark .mod-card p { color: var(--ink-secondary); }
html.dark .material-card { background: var(--surface); border-color: var(--border); }
html.dark .material-card h4 { color: var(--ink); }
html.dark .flashcard__front { background: var(--surface); color: var(--ink); border-color: var(--border); }
html.dark .profile-card { background: var(--surface); border-color: var(--border); }
html.dark .profile-card label { color: var(--ink-secondary); }
html.dark .profile-card__value { color: var(--ink); }
html.dark .test-program-card { background: var(--surface) !important; border-color: var(--border) !important; }
html.dark .test-program-card h4 { color: var(--ink) !important; }
html.dark .test-program-card p { color: var(--ink-secondary) !important; }
html.dark .test-program-card.is-selected { background: rgba(22,163,74,0.15) !important; border-color: #16a34a !important; }
html.dark .preview-overlay__card { background: var(--surface); }
html.dark .preview-overlay__card h3 { color: var(--ink); }
html.dark .preview-overlay__card p { color: var(--ink-secondary); }
html.dark .cert-preview > div { background: var(--surface) !important; }

/* ===== ONBOARDING WIZARD ===== */

.onboarding-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.onboarding-card { background: var(--surface); border-radius: 16px; padding: 40px; max-width: 480px; text-align: center; box-shadow: 0 24px 48px rgba(0,0,0,.2); }
.onboarding-card h2 { font-size: 22px; margin-bottom: 8px; color: var(--ink); }
.onboarding-card p { color: var(--ink-secondary); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
.onboarding-step { font-size: 12px; color: var(--ink-muted); margin-bottom: 12px; }
.onboarding-icon { font-size: 48px; margin-bottom: 16px; display: block; }
.onboarding-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 20px; }
.onboarding-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.onboarding-dots span.active { background: var(--accent); }
.onboarding-actions { display: flex; gap: 10px; justify-content: center; }

/* ===== AVATAR CLICKABLE ===== */

.sidebar__avatar { cursor: pointer; transition: opacity 0.15s; background-position: center; }
.sidebar__avatar:hover { opacity: 0.8; }

/* ============================================================
   FUNKCJA 5: WYZWANIA TYGODNIOWE
   ============================================================ */

.challenges-container {
  max-width: 900px;
}

.challenges-header {
  margin-bottom: 24px;
}

.challenges-stats {
  display: flex;
  gap: 24px;
}

.challenges-stat {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  min-width: 160px;
}

.challenges-stat__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.challenges-stat__label {
  font-size: 13px;
  color: var(--ink-muted);
}

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .challenges-grid { grid-template-columns: 1fr; }
  .challenges-stats { flex-direction: column; gap: 12px; }
}

.challenge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.challenge-card:hover {
  box-shadow: var(--shadow-md);
}

.challenge-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.challenge-card--done {
  border-color: var(--green);
  background: var(--green-light);
}

.challenge-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.challenge-card__icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.challenge-card__icon svg {
  width: 100%;
  height: 100%;
}

.challenge-card__week {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.challenge-badge--active {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.challenge-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.challenge-card__desc {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.challenge-card__progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.challenge-progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.challenge-progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.challenge-card--done .challenge-progress-bar__fill {
  background: var(--green);
}

.challenge-card__progress-text {
  font-size: 12px;
  color: var(--ink-muted);
}

.challenge-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.challenge-card__reward {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
}

.challenge-card__badge-done {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   FUNKCJA 6: ACHIEVEMENTY / ODZNAKI
   ============================================================ */

.achievements-container {
  max-width: 900px;
}

.achievements-header {
  margin-bottom: 24px;
}

.achievements-counter {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.achievements-progress-bar {
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
}

.achievements-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 5px;
  transition: width 0.6s ease;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .achievements-grid { grid-template-columns: 1fr; }
}

.achievement-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.achievement-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.achievement-card--locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-card--unlocked {
  border-color: var(--accent-light);
}

.achievement-card__icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 4px;
}

.achievement-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.achievement-card__desc {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}

.achievement-card__status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  margin-top: 4px;
}

.achievement-card__status--unlocked {
  background: var(--green-light);
  color: var(--green);
}

.achievement-card__status--locked {
  background: var(--border-light);
  color: var(--ink-muted);
}

/* ============================================================
   FUNKCJA 8: BIBLIOTEKA SZABLONÓW
   ============================================================ */

.templates-container {
  max-width: 900px;
}

.templates-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .templates-grid { grid-template-columns: 1fr; }
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s;
}

.template-card:hover {
  box-shadow: var(--shadow-md);
}

.template-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-card__category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 10px;
}

.template-card__format {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--border-light);
  padding: 3px 8px;
  border-radius: 6px;
}

.template-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.template-card__desc {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
  flex: 1;
}

/* ============================================================
   FUNKCJA 10: PROFIL UCZESTNIKA
   ============================================================ */

.profile-container {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  gap: 28px;
  align-items: center;
}

@media (max-width: 640px) {
  .profile-card { flex-direction: column; text-align: center; padding: 24px 16px; }
}

.profile-card__avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan-dark));
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-card__avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-light);
}

.profile-card__info {
  flex: 1;
}

.profile-card__name {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.profile-card__email {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.profile-card__program {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
}

.profile-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-stat__value {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.profile-stat__label {
  font-size: 12px;
  color: var(--ink-muted);
}

.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.profile-section__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-badge {
  width: 48px;
  height: 48px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius);
  cursor: default;
  transition: transform 0.15s;
}

.profile-badge:hover {
  transform: scale(1.1);
}

.profile-badges__empty {
  font-size: 13px;
  color: var(--ink-muted);
}

.profile-actions {
  display: flex;
  gap: 12px;
}

/* ============================================================
   FUNKCJA 11: TABLICA LIDERÓW
   ============================================================ */

.leaderboard-container {
  max-width: 800px;
}

.leaderboard-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 32px;
  padding: 20px 0;
}

@media (max-width: 540px) {
  .leaderboard-podium { gap: 8px; }
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 100px;
}

@media (max-width: 540px) {
  .podium-item { min-width: 80px; }
}

.podium-item__medal {
  font-size: 36px;
  line-height: 1;
}

.podium-item__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.podium-item__points {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 600;
}

.podium-item__bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  transition: height 0.4s ease;
}

.podium--gold .podium-item__bar {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.podium--silver .podium-item__bar {
  background: linear-gradient(180deg, #d1d5db, #9ca3af);
}

.podium--bronze .podium-item__bar {
  background: linear-gradient(180deg, #d97706, #b45309);
}

.podium-item__rank {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
}

.leaderboard-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--border-light);
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tbody tr:hover {
  background: var(--surface-hover);
}

.leaderboard-row--current {
  background: var(--accent-light) !important;
}

.leaderboard-row--current td {
  font-weight: 600;
}

.leaderboard-medal {
  font-size: 20px;
}

.leaderboard-rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-light);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.leaderboard-you {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.leaderboard-level-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
}

.leaderboard-level--advanced {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.leaderboard-level--mid {
  background: var(--amber-light);
  color: #92400e;
}

.leaderboard-level--beginner {
  background: var(--border-light);
  color: var(--ink-muted);
}

.leaderboard-points strong {
  color: var(--ink);
}

.leaderboard-badges {
  font-weight: 600;
  color: var(--ink-secondary);
}

/* ===== v2.4 UX — dostępność i ścieżka nauki ===== */

/* Widoczny fokus przy nawigacji klawiaturą */
a:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible,
.more-menu__item:focus-visible,
.dash-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.bottom-nav__item:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

/* Pasek statusu planu (konto darmowe) */
.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink-secondary);
}

.plan-banner strong {
  color: var(--ink);
}

/* Notka przy zablokowanym szablonie */
.prompt-locked-note {
  color: var(--ink-muted);
  font-style: normal;
  font-size: 12px;
}

/* Ścieżka nauki na dashboardzie */
.learn-path {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.learn-path__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.learn-path__header h3 {
  margin: 0;
  font-size: 17px;
}

.learn-path__progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 999px;
}

.learn-path__steps {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.learn-step {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}

.learn-step:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.learn-step__marker {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 700;
}

.learn-step__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.learn-step__detail {
  font-size: 12px;
  color: var(--ink-muted);
}

.learn-step.is-done {
  border-color: rgba(22, 163, 74, 0.35);
  background: var(--green-light);
}

.learn-step.is-done .learn-step__marker {
  background: var(--green);
  color: #fff;
}

.learn-step.is-current {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.learn-step.is-current .learn-step__marker {
  background: var(--accent);
  color: #fff;
}

.learn-step__arrow {
  align-self: center;
  width: 14px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}

.learn-path__cta {
  width: 100%;
  font-size: 15px;
}

.learn-path__complete {
  text-align: center;
  font-weight: 600;
  color: var(--green);
  padding: 10px;
  background: var(--green-light);
  border-radius: 10px;
}

@media (max-width: 640px) {
  .learn-path__steps {
    flex-direction: column;
  }

  .learn-step {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }

  .learn-step__detail {
    margin-left: auto;
  }

  .learn-step__arrow {
    display: none;
  }

  /* większe cele dotykowe na telefonie */
  .btn {
    min-height: 44px;
  }
}

/* ===== USER MENU (topbar) ===== */

.user-menu {
  position: relative;
}

.user-menu__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}

.user-menu__btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.user-menu__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu__chevron {
  color: var(--ink-muted);
}

.user-menu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 6px;
  z-index: 90;
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
}

.user-menu__item:hover {
  background: var(--surface-hover);
}

.user-menu__item svg {
  color: var(--ink-muted);
  flex-shrink: 0;
}

.user-menu__item--logout {
  color: var(--red);
}

.user-menu__item--logout svg {
  color: var(--red);
}

.user-menu__sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

@media (max-width: 640px) {
  .user-menu__name {
    display: none;
  }
}
