@import url('./colors_and_type.css');

/* =========================================================================
   FormaVerse LMS — shared component CSS
   ========================================================================= */

* { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--fv-ink-50);
  font-family: var(--fv-font-body);
  color: var(--fv-fg);
  font-size: 14px;
}
button { font-family: inherit; }

/* === App Shell ============================================================ */
.lms-app, .lms-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lms-app--collapsed, .lms-shell--collapsed { grid-template-columns: 72px 1fr; }
.lms-main { min-width: 0; display: flex; flex-direction: column; }
.lms-page { padding: 28px 32px; max-width: 100%; }
.lms-page--wide { padding: 24px 32px; }

/* === Sidebar ============================================================== */
.lms-side {
  background: #fff;
  border-right: 1px solid var(--fv-ink-200);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.lms-side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--fv-ink-100); }
.lms-side-brand img { height: 26px; }
.lms-side-role {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fv-font-display);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fv-violet-deep);
  background: var(--fv-violet-wash);
  padding: 4px 8px; border-radius: 999px;
  margin-top: 6px;
}
.lms-side-section { font-family: var(--fv-font-display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fv-fg-subtle); padding: 8px 12px 4px; }
.lms-side-nav { display: flex; flex-direction: column; gap: 1px; }
.lms-side-flex { flex: 1; }
.lms-side-foot { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--fv-ink-100); padding-top: 10px; }
.lms-side-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--fv-font-body); font-size: 13.5px; font-weight: 500;
  color: var(--fv-fg); text-align: left; width: 100%;
  transition: background var(--fv-dur-fast) var(--fv-ease-standard);
}
.lms-side-item:hover { background: var(--fv-ink-50); }
.lms-side-item.is-active { background: var(--fv-violet-wash); color: var(--fv-violet-deep); }
.lms-side-item .lu { stroke-width: 1.75; flex-shrink: 0; }
.lms-side-item .badge {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  background: var(--fv-violet); color: #fff;
  padding: 1px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.lms-side-item.is-active .badge { background: var(--fv-violet-deep); }

/* === Top bar ============================================================== */
.lms-top {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fv-ink-100);
  position: sticky; top: 0; z-index: 20;
}
.lms-top-title { font-family: var(--fv-font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.lms-top-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fv-fg-subtle); }
.lms-top-crumbs .sep { color: var(--fv-ink-300); }
.lms-top-crumbs strong { color: var(--fv-fg); font-weight: 600; }
.lms-top-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  background: var(--fv-ink-50); border: 1px solid var(--fv-ink-200); border-radius: 10px;
  padding: 7px 12px; color: var(--fv-fg-subtle);
}
.lms-top-search input { border: none; background: transparent; outline: none; flex: 1; font-family: var(--fv-font-body); font-size: 13px; color: var(--fv-fg); }
.lms-top-search kbd { font-family: var(--fv-font-mono); font-size: 11px; background: #fff; border: 1px solid var(--fv-ink-200); padding: 2px 6px; border-radius: 4px; color: var(--fv-fg-muted); }
.lms-icon-btn {
  background: transparent; border: 1px solid var(--fv-ink-200);
  border-radius: 10px; padding: 7px; cursor: pointer; color: var(--fv-fg);
  position: relative;
}
.lms-icon-btn:hover { background: var(--fv-ink-50); }
.lms-icon-btn .dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--fv-danger); border: 1.5px solid #fff; }
.lms-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--fv-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fv-font-display); font-weight: 700; font-size: 13px;
  flex-shrink: 0;
  cursor: pointer;
}
.lms-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.lms-avatar--md { width: 40px; height: 40px; font-size: 14px; }
.lms-avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.lms-avatar--xl { width: 72px; height: 72px; font-size: 22px; }
.lms-avatar--ink { background: var(--fv-ink-800); }
.lms-avatar--blue { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.lms-avatar--violet { background: linear-gradient(135deg, #A78BFA, #6D3FE0); }
.lms-avatar--green { background: linear-gradient(135deg, #16A34A, #047857); }
.lms-avatar--orange { background: linear-gradient(135deg, #F59E0B, #B45309); }
.lms-avatar--rose { background: linear-gradient(135deg, #F43F5E, #BE123C); }

/* === Buttons ============================================================== */
.fv-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--fv-font-body); font-weight: 600; font-size: 14px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff; color: var(--fv-fg);
  cursor: pointer;
  transition: background var(--fv-dur-fast) var(--fv-ease-standard),
              transform var(--fv-dur-fast) var(--fv-ease-standard),
              box-shadow var(--fv-dur-fast) var(--fv-ease-standard),
              border-color var(--fv-dur-fast) var(--fv-ease-standard);
  text-decoration: none;
  white-space: nowrap;
}
.fv-btn:active { transform: scale(0.98); }
.fv-btn:focus-visible { outline: none; box-shadow: var(--fv-focus-ring); }
.fv-btn--primary { background: var(--fv-violet); color: #fff; }
.fv-btn--primary:hover { background: var(--fv-violet-deep); }
.fv-btn--gradient { background: var(--fv-gradient); color: #fff; box-shadow: var(--fv-shadow-sm); }
.fv-btn--gradient:hover { box-shadow: var(--fv-glow-violet); }
.fv-btn--ghost { background: transparent; border-color: var(--fv-ink-200); }
.fv-btn--ghost:hover { background: var(--fv-ink-50); border-color: var(--fv-ink-300); }
.fv-btn--soft { background: var(--fv-violet-wash); color: var(--fv-violet-deep); }
.fv-btn--soft:hover { background: #E9DCFF; }
.fv-btn--danger { background: var(--fv-danger); color: #fff; }
.fv-btn--danger-soft { background: var(--fv-danger-wash); color: var(--fv-danger); }
.fv-btn--sm { padding: 6px 12px; font-size: 13px; }
.fv-btn--lg { padding: 14px 24px; font-size: 15px; }
.fv-btn--icon { padding: 9px; }
.fv-btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

/* === Pills / Badges ======================================================= */
.fv-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--fv-ink-100); color: var(--fv-fg-muted);
  white-space: nowrap;
}
.fv-pill--success { background: var(--fv-success-wash); color: #0E7E3A; }
.fv-pill--warning { background: var(--fv-warning-wash); color: #B45309; }
.fv-pill--danger  { background: var(--fv-danger-wash); color: var(--fv-danger); }
.fv-pill--info    { background: var(--fv-info-wash); color: var(--fv-blue-deep); }
.fv-pill--violet  { background: var(--fv-violet-wash); color: var(--fv-violet-deep); }
.fv-pill--ink     { background: var(--fv-ink-900); color: #fff; }
.fv-pill--gradient{ background: var(--fv-gradient); color: #fff; }
.fv-pill--outline { background: transparent; border: 1px solid var(--fv-ink-200); color: var(--fv-fg-muted); }
.fv-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* === Card ================================================================= */
.fv-card {
  background: #fff;
  border: 1px solid var(--fv-ink-200);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--fv-shadow-xs);
}
.fv-card--featured { position: relative; overflow: hidden; }
.fv-card--featured::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--fv-gradient); }
.fv-card--inverse { background: var(--fv-ink-900); color: #fff; border-color: var(--fv-ink-800); }
.fv-card--gradient { background: var(--fv-gradient-diag); color: #fff; border-color: transparent; box-shadow: var(--fv-glow-violet); }
.fv-card--flat { box-shadow: none; }
.fv-card--pad-sm { padding: 16px; }
.fv-card--pad-lg { padding: 28px; }

/* === Inputs =============================================================== */
.fv-input, .fv-select, .fv-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--fv-ink-200);
  border-radius: 10px;
  background: #fff;
  font-family: var(--fv-font-body); font-size: 14px;
  color: var(--fv-fg);
  outline: none;
  transition: border-color var(--fv-dur-fast), box-shadow var(--fv-dur-fast);
}
.fv-input:focus, .fv-select:focus, .fv-textarea:focus { border-color: var(--fv-violet); box-shadow: var(--fv-focus-ring); }
.fv-input::placeholder, .fv-textarea::placeholder { color: var(--fv-fg-subtle); }
.fv-textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.fv-field { display: flex; flex-direction: column; gap: 6px; }
.fv-field-label { font-size: 13px; font-weight: 600; color: var(--fv-fg); }
.fv-field-hint { font-size: 12px; color: var(--fv-fg-subtle); }
.fv-field-error { font-size: 12px; color: var(--fv-danger); }
.fv-input-icon { position: relative; }
.fv-input-icon .lu { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fv-fg-subtle); pointer-events: none; }
.fv-input-icon .fv-input { padding-left: 38px; }

/* Checkbox + radio */
.fv-check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.fv-check input { position: absolute; opacity: 0; pointer-events: none; }
.fv-check-box {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid var(--fv-ink-300); border-radius: 4px;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
  transition: background var(--fv-dur-fast), border-color var(--fv-dur-fast);
}
.fv-check input:checked + .fv-check-box { background: var(--fv-violet); border-color: var(--fv-violet); }
.fv-check input:checked + .fv-check-box::after { content: ""; width: 10px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }

/* === Tables =============================================================== */
.fv-table-wrap { background: #fff; border: 1px solid var(--fv-ink-200); border-radius: 18px; overflow: hidden; }
.fv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fv-table thead th {
  text-align: left;
  font-family: var(--fv-font-display);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fv-fg-subtle);
  padding: 12px 16px;
  background: var(--fv-ink-50);
  border-bottom: 1px solid var(--fv-ink-200);
  white-space: nowrap;
}
.fv-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--fv-ink-100); vertical-align: middle; }
.fv-table tbody tr:last-child td { border-bottom: none; }
.fv-table tbody tr:hover { background: var(--fv-ink-50); }
.fv-table tbody tr.is-selected { background: var(--fv-violet-wash); }
.fv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fv-table-row-user { display: flex; align-items: center; gap: 10px; }
.fv-table-row-user-name { font-weight: 500; color: var(--fv-fg); }
.fv-table-row-user-email { font-size: 12px; color: var(--fv-fg-subtle); }

/* === Progress ============================================================= */
.fv-progress {
  height: 8px;
  background: var(--fv-ink-100);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.fv-progress > div {
  height: 100%;
  background: var(--fv-gradient);
  border-radius: 999px;
  transition: width var(--fv-dur-slow) var(--fv-ease-standard);
}
.fv-progress--thin { height: 4px; }
.fv-progress--thick { height: 12px; }
.fv-progress--success > div { background: var(--fv-success); }
.fv-progress--warning > div { background: var(--fv-warning); }
.fv-progress--danger > div { background: var(--fv-danger); }

/* === Stat tiles =========================================================== */
.lms-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lms-stats--3 { grid-template-columns: repeat(3, 1fr); }
.lms-stats--5 { grid-template-columns: repeat(5, 1fr); }
.lms-stat {
  background: #fff;
  border: 1px solid var(--fv-ink-200);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.lms-stat-l {
  font-family: var(--fv-font-display);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fv-fg-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.lms-stat-n {
  font-family: var(--fv-font-display);
  font-weight: 700; font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--fv-fg);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.lms-stat-trend { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.lms-stat-trend--up { color: var(--fv-success); }
.lms-stat-trend--down { color: var(--fv-danger); }
.lms-stat-spark { height: 36px; margin-top: 4px; }

/* === Section heads & layout ============================================== */
.lms-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.lms-section-head h2, .lms-section-head h3 { margin: 0; font-family: var(--fv-font-display); font-weight: 600; letter-spacing: -0.01em; }
.lms-section-head h2 { font-size: 22px; }
.lms-section-head h3 { font-size: 17px; }
.lms-section-head p { margin: 4px 0 0; color: var(--fv-fg-muted); font-size: 13.5px; }
.lms-section { margin-bottom: 28px; }

.lms-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lms-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lms-grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.lms-grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.lms-grid-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; }

/* === Tabs ================================================================= */
.fv-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--fv-ink-200); }
.fv-tab {
  background: transparent; border: none;
  padding: 10px 14px;
  font-family: var(--fv-font-body); font-weight: 500; font-size: 13.5px;
  cursor: pointer;
  color: var(--fv-fg-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 8px;
}
.fv-tab:hover { color: var(--fv-fg); }
.fv-tab.is-active { color: var(--fv-violet-deep); border-bottom-color: var(--fv-violet); font-weight: 600; }

/* === Page header ========================================================= */
.lms-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.lms-page-head h1 { font-family: var(--fv-font-display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
.lms-page-head p { color: var(--fv-fg-muted); margin: 6px 0 0; font-size: 14.5px; max-width: 720px; line-height: 1.5; }
.lms-page-head-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* === Heading reset for in-card / inline headings ========================== */
/* The global colors_and_type.css h2/h3/h4 rules use a 30/22px display scale
   meant for marketing pages — too large for app card titles. Components that
   pass an explicit fontSize via inline style still inherit line-height: 1.2,
   which causes wrap-line collisions with surrounding text. Reset cleanly. */
.fv-card h2, .fv-card h3, .fv-card h4,
.lms-section-head h2, .lms-section-head h3,
h3[style*="font-size"], h4[style*="font-size"] {
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.fv-card h3 { font-size: 17px; }
.fv-card h4 { font-size: 14px; }
/* When inline style is set, it wins for size — but we need line-height to follow */
.fv-card h3[style], .fv-card h4[style] { line-height: 1.3; }

/* === Empty / dropzone ==================================================== */
.fv-empty { padding: 36px; border: 1.5px dashed var(--fv-ink-200); border-radius: 18px; text-align: center; color: var(--fv-fg-muted); background: var(--fv-ink-50); }
.fv-dropzone { padding: 40px; border: 2px dashed var(--fv-ink-300); border-radius: 18px; background: var(--fv-ink-50); display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; transition: border-color var(--fv-dur-fast), background var(--fv-dur-fast); }
.fv-dropzone:hover, .fv-dropzone.is-active { border-color: var(--fv-violet); background: var(--fv-violet-wash); }
.fv-dropzone-icon { width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 1px solid var(--fv-ink-200); display: flex; align-items: center; justify-content: center; color: var(--fv-violet); }
.fv-dropzone h4 { margin: 0; font-family: var(--fv-font-display); font-weight: 600; font-size: 17px; }
.fv-dropzone p { margin: 0; color: var(--fv-fg-muted); font-size: 13.5px; }

/* === Toggle =============================================================== */
.fv-toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.fv-toggle input { opacity: 0; width: 0; height: 0; }
.fv-toggle-track { position: absolute; inset: 0; background: var(--fv-ink-300); border-radius: 999px; cursor: pointer; transition: background var(--fv-dur-fast); }
.fv-toggle-track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform var(--fv-dur-fast) var(--fv-ease-standard); }
.fv-toggle input:checked + .fv-toggle-track { background: var(--fv-violet); }
.fv-toggle input:checked + .fv-toggle-track::after { transform: translateX(16px); }

/* === Modal / overlay ====================================================== */
.fv-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 14, 20, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  animation: fv-fade-in 200ms var(--fv-ease-standard);
}
.fv-modal {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--fv-shadow-xl);
  animation: fv-pop-in 280ms var(--fv-ease-emphatic);
  overflow: hidden;
}
.fv-modal--lg { max-width: 880px; }
.fv-modal--xl { max-width: 1120px; }
.fv-modal-head { padding: 20px 24px; border-bottom: 1px solid var(--fv-ink-100); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fv-modal-head h3 { margin: 0; font-family: var(--fv-font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.fv-modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.fv-modal-foot { padding: 16px 24px; border-top: 1px solid var(--fv-ink-100); display: flex; justify-content: flex-end; gap: 10px; background: var(--fv-ink-50); }

@keyframes fv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fv-pop-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* === Toast =============================================================== */
.fv-toast-stack { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.fv-toast {
  background: #fff; border: 1px solid var(--fv-ink-200); border-radius: 12px;
  padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start;
  min-width: 280px; max-width: 380px;
  box-shadow: var(--fv-shadow-lg);
  pointer-events: auto;
  animation: fv-pop-in 240ms var(--fv-ease-emphatic);
}
.fv-toast-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--fv-success-wash); color: var(--fv-success); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fv-toast--info .fv-toast-icon { background: var(--fv-info-wash); color: var(--fv-blue-deep); }
.fv-toast--warning .fv-toast-icon { background: var(--fv-warning-wash); color: #B45309; }
.fv-toast--danger .fv-toast-icon { background: var(--fv-danger-wash); color: var(--fv-danger); }
.fv-toast-title { font-weight: 600; font-size: 13.5px; color: var(--fv-fg); }
.fv-toast-msg { font-size: 12.5px; color: var(--fv-fg-muted); margin-top: 2px; line-height: 1.4; }

/* === Charts (CSS-only sparkline & bar) ==================================== */
.fv-bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.fv-bar-row-label { width: 140px; font-size: 13px; color: var(--fv-fg-muted); flex-shrink: 0; }
.fv-bar-row-track { flex: 1; height: 8px; background: var(--fv-ink-100); border-radius: 999px; overflow: hidden; }
.fv-bar-row-fill { height: 100%; background: var(--fv-gradient); border-radius: 999px; }
.fv-bar-row-val { width: 56px; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* === Skeleton & helpers =================================================== */
.fv-divider { height: 1px; background: var(--fv-ink-100); margin: 16px 0; }
.fv-stack { display: flex; flex-direction: column; }
.fv-row { display: flex; align-items: center; }
.fv-spacer { flex: 1; }
.muted { color: var(--fv-fg-muted); }
.subtle { color: var(--fv-fg-subtle); }
.mono { font-family: var(--fv-font-mono); }
.tabnum { font-variant-numeric: tabular-nums; }

/* === Scrollbar (subtle) ================================================== */
.lms-side::-webkit-scrollbar, .fv-modal-body::-webkit-scrollbar { width: 8px; }
.lms-side::-webkit-scrollbar-thumb, .fv-modal-body::-webkit-scrollbar-thumb { background: var(--fv-ink-200); border-radius: 999px; }
.lms-side::-webkit-scrollbar-track, .fv-modal-body::-webkit-scrollbar-track { background: transparent; }

/* === Utility text styles ================================================= */
.fv-eyebrow { font-family: var(--fv-font-display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fv-violet); }
.fv-mute-link { color: var(--fv-fg-muted); text-decoration: none; font-size: 13px; }
.fv-mute-link:hover { color: var(--fv-violet-deep); }

/* === SCORM player specific =============================================== */
.scorm-shell { display: grid; grid-template-columns: 320px 1fr 320px; min-height: calc(100vh - 64px); background: var(--fv-ink-50); }
.scorm-shell--no-debug { grid-template-columns: 320px 1fr; }
.scorm-nav { background: #fff; border-right: 1px solid var(--fv-ink-200); padding: 20px 16px; overflow-y: auto; }
.scorm-stage { display: flex; flex-direction: column; min-width: 0; }
.scorm-stage-header { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--fv-ink-100); }
.scorm-stage-header h3 { margin: 0; font-family: var(--fv-font-display); font-weight: 600; font-size: 15.5px; letter-spacing: -0.005em; }
.scorm-stage-header .crumb { font-size: 12px; color: var(--fv-fg-subtle); }
.scorm-frame {
  flex: 1;
  margin: 20px;
  background: #fff;
  border: 1px solid var(--fv-ink-200);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--fv-shadow-sm);
}
.scorm-bottom { padding: 12px 24px; background: #fff; border-top: 1px solid var(--fv-ink-100); display: flex; align-items: center; gap: 12px; }
.scorm-bottom-meta { display: flex; gap: 18px; font-size: 12px; color: var(--fv-fg-muted); }
.scorm-bottom-meta b { color: var(--fv-fg); font-weight: 600; }

.scorm-debug { background: #fff; border-left: 1px solid var(--fv-ink-200); padding: 18px; overflow-y: auto; font-family: var(--fv-font-mono); font-size: 12px; }
.scorm-debug h4 { font-family: var(--fv-font-display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fv-fg-subtle); margin: 0 0 10px; }
.scorm-debug-section { margin-bottom: 18px; }
.scorm-cmi-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--fv-ink-100); align-items: center; }
.scorm-cmi-row:last-child { border-bottom: none; }
.scorm-cmi-key { color: var(--fv-blue-deep); font-size: 11.5px; }
.scorm-cmi-val { color: var(--fv-fg); font-size: 11.5px; text-align: right; word-break: break-all; max-width: 60%; }

.scorm-tree { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.scorm-tree-group { margin-bottom: 8px; }
.scorm-tree-group-title { font-family: var(--fv-font-display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fv-fg-subtle); padding: 8px 8px 4px; display: flex; align-items: center; gap: 8px; }
.scorm-tree-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  border: none; background: transparent; text-align: left; width: 100%;
  color: var(--fv-fg);
}
.scorm-tree-item:hover { background: var(--fv-ink-50); }
.scorm-tree-item.is-current { background: var(--fv-violet-wash); color: var(--fv-violet-deep); font-weight: 600; }
.scorm-tree-item .ico { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; }
.scorm-tree-item .ico--done { background: var(--fv-success); color: #fff; }
.scorm-tree-item .ico--current { background: var(--fv-violet); color: #fff; }
.scorm-tree-item .ico--todo { background: var(--fv-ink-200); color: var(--fv-fg-subtle); }
.scorm-tree-item .ico--failed { background: var(--fv-danger-wash); color: var(--fv-danger); border: 1.5px solid currentColor; }
.scorm-tree-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorm-tree-item .meta { font-size: 11px; color: var(--fv-fg-subtle); font-variant-numeric: tabular-nums; }

/* === Role switcher ======================================================== */
.fv-role-switcher { position: relative; }
.fv-role-switcher-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 8px; border-radius: 10px;
  background: #fff; border: 1px solid var(--fv-ink-200);
  cursor: pointer; transition: border-color var(--fv-dur-fast);
  min-width: 200px;
}
.fv-role-switcher-btn:hover { border-color: var(--fv-violet); }
.fv-role-switcher-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fv-role-switcher-dot--orange { background: var(--fv-orange); }
.fv-role-switcher-dot--blue { background: var(--fv-blue); }
.fv-role-switcher-dot--violet { background: var(--fv-violet); }
.fv-role-switcher-label { display: flex !important; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; line-height: 1.1; gap: 2px; }
.fv-role-switcher-eyebrow { display: block; font-family: var(--fv-font-display); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fv-fg-subtle); }
.fv-role-switcher-name { display: block; font-size: 12.5px; font-weight: 600; color: var(--fv-fg); }
.fv-role-switcher-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--fv-ink-200); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  min-width: 320px; padding: 6px;
  z-index: 50;
}
.fv-role-switcher-menu-head {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--fv-font-display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fv-fg-subtle); padding: 10px 12px 8px;
}
.fv-role-switcher-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--fv-fg);
  transition: background var(--fv-dur-fast);
}
.fv-role-switcher-item:hover { background: var(--fv-ink-50); }
.fv-role-switcher-item.is-current { background: transparent; opacity: 0.7; cursor: default; }
.fv-role-switcher-item.is-current:hover { background: transparent; }
.fv-role-switcher-item-name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.fv-role-switcher-item-desc { font-size: 11.5px; color: var(--fv-fg-subtle); margin-top: 2px; }
.fv-role-switcher-current { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fv-violet-deep); background: var(--fv-violet-wash); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.fv-role-switcher-menu-foot {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--fv-fg-subtle);
  padding: 10px 12px; border-top: 1px solid var(--fv-ink-100); margin-top: 6px;
}

/* === Banner (vue rôle, etc) =============================================== */
.fv-rolebanner {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: linear-gradient(90deg, var(--fv-violet-wash), var(--fv-blue-wash));
  border-bottom: 1px solid var(--fv-ink-200);
  font-size: 13px;
}
.fv-rolebanner-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--fv-violet); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.fv-rolebanner-text { flex: 1; }
.fv-rolebanner-text b { font-weight: 600; }
.fv-rolebanner a { color: var(--fv-violet-deep); font-weight: 600; text-decoration: none; }
.fv-rolebanner a:hover { text-decoration: underline; }

/* === Auth screens ========================================================= */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: var(--fv-ink-900); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::before { content: ""; position: absolute; bottom: -200px; right: -200px; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, 0.5), transparent 70%); }
.auth-aside::after { content: ""; position: absolute; top: -150px; left: -150px; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, 0.4), transparent 70%); }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside img { height: 32px; }
.auth-form { padding: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--fv-ink-50); }
.auth-form-inner { width: 100%; max-width: 420px; }

/* === Decorative dot grid ================================================== */
.fv-dotgrid { background-image: radial-gradient(rgba(139,92,246,0.18) 1px, transparent 1px); background-size: 24px 24px; }

/* === Calendar / mini cal ================================================= */
.fv-mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 12px; }
.fv-mini-cal-h { font-family: var(--fv-font-display); font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--fv-fg-subtle); text-align: center; padding: 4px 0; letter-spacing: 0.06em; }
.fv-mini-cal-d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--fv-fg); cursor: pointer; position: relative; }
.fv-mini-cal-d:hover { background: var(--fv-ink-100); }
.fv-mini-cal-d.is-today { background: var(--fv-violet); color: #fff; font-weight: 700; }
.fv-mini-cal-d.is-event::after { content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--fv-blue); }
.fv-mini-cal-d.is-other { color: var(--fv-ink-300); }

/* === Donut === */
.fv-donut { position: relative; width: 140px; height: 140px; }
.fv-donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.fv-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fv-donut-n { font-family: var(--fv-font-display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; line-height: 1; }
.fv-donut-l { font-size: 11px; color: var(--fv-fg-subtle); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--fv-font-display); font-weight: 600; margin-top: 4px; }

/* === Activity feed ====================================================== */
.fv-feed { display: flex; flex-direction: column; gap: 4px; }
.fv-feed-item { display: flex; gap: 12px; padding: 12px 8px; border-radius: 10px; }
.fv-feed-item:hover { background: var(--fv-ink-50); }
.fv-feed-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fv-feed-content { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; }
.fv-feed-time { font-size: 12px; color: var(--fv-fg-subtle); margin-top: 2px; }

/* === Course thumbnail ==================================================== */
.fv-thumb {
  aspect-ratio: 16/9;
  border-radius: 14px;
  background: var(--fv-ink-900);
  background-image: radial-gradient(ellipse at 30% 30%, rgba(139,92,246,.45), transparent 60%),
                    radial-gradient(ellipse at 70% 70%, rgba(59,130,246,.35), transparent 60%);
  position: relative;
  overflow: hidden;
}
.fv-thumb--success { background-image: radial-gradient(ellipse at 30% 30%, rgba(22,163,74,.5), transparent 60%), radial-gradient(ellipse at 70% 70%, rgba(59,130,246,.3), transparent 60%); }
.fv-thumb--warm { background-image: radial-gradient(ellipse at 30% 30%, rgba(245,158,11,.5), transparent 60%), radial-gradient(ellipse at 70% 70%, rgba(244,63,94,.4), transparent 60%); }
.fv-thumb--rose { background-image: radial-gradient(ellipse at 30% 30%, rgba(244,63,94,.5), transparent 60%), radial-gradient(ellipse at 70% 70%, rgba(139,92,246,.35), transparent 60%); }
.fv-thumb--teal { background-image: radial-gradient(ellipse at 30% 30%, rgba(20,184,166,.5), transparent 60%), radial-gradient(ellipse at 70% 70%, rgba(59,130,246,.35), transparent 60%); }
.fv-thumb-tag { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.95); color: var(--fv-fg); padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.fv-thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.85); }

/* index page */
.fv-index { min-height: 100vh; background: var(--fv-ink-900); color: #fff; padding: 48px 32px; display: flex; flex-direction: column; align-items: center; gap: 32px; position: relative; overflow: hidden; }
.fv-index::before { content: ""; position: absolute; bottom: -300px; right: -200px; width: 800px; height: 800px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%); pointer-events: none; }
.fv-index::after { content: ""; position: absolute; top: -300px; left: -200px; width: 800px; height: 800px; border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, 0.28), transparent 70%); pointer-events: none; }
.fv-index > * { position: relative; z-index: 1; }
.fv-index-head { text-align: center; max-width: 720px; padding-top: 48px; }
.fv-index-head img { height: 38px; margin-bottom: 24px; }
.fv-index-head h1 { font-family: var(--fv-font-display); font-weight: 700; font-size: 48px; letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 18px; padding-bottom: 4px; }
.fv-index-head h1 .fv-gradient-text { font-size: inherit; line-height: 1.1; display: inline-block; padding: 0 0.04em; }
.fv-index-head p { color: var(--fv-ink-300); font-size: 17px; line-height: 1.6; margin: 0; }
.fv-index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1200px; width: 100%; margin-top: 32px; }
.fv-index-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; padding: 28px; text-decoration: none; color: #fff; display: flex; flex-direction: column; gap: 16px; transition: transform var(--fv-dur-base), background var(--fv-dur-base), border-color var(--fv-dur-base); position: relative; overflow: hidden; }
.fv-index-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.06); border-color: rgba(139, 92, 246, 0.5); }
.fv-index-card-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.fv-index-card h3 { font-family: var(--fv-font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
.fv-index-card p { color: var(--fv-ink-300); font-size: 14.5px; line-height: 1.55; margin: 0; flex: 1; }
.fv-index-card-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 13px; }
.fv-index-card-foot .arrow { font-family: var(--fv-font-display); font-weight: 600; color: var(--fv-violet-soft); }
.fv-index-extras { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.fv-index-extra-link { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); padding: 10px 18px; border-radius: 999px; color: #fff; text-decoration: none; font-size: 13px; font-weight: 500; transition: background var(--fv-dur-fast); }
.fv-index-extra-link:hover { background: rgba(255,255,255,0.1); }
