/* ================================================================
   MDS v1.0 — MEMORIZZA DESIGN SYSTEM — Official Design Tokens
   Source of truth for all interface components.
   docs/design-system/README.md | /design-system (visual catalog)
   ================================================================ */
:root {
  /* ── PRIMARY (Azul Principal) ───────────────────────────────── */
  --mz-primary-50:  #eff6ff;
  --mz-primary-100: #dbeafe;
  --mz-primary-200: #bfdbfe;
  --mz-primary-300: #93c5fd;
  --mz-primary-400: #60a5fa;
  --mz-primary-500: #3b82f6;
  --mz-primary-600: #2563eb;
  --mz-primary-700: #1d4ed8;
  --mz-primary-800: #1e40af;
  --mz-primary-900: #1e3a8a;

  /* ── SECONDARY (Roxo) ───────────────────────────────────────── */
  --mz-secondary-50:  #f5f3ff;
  --mz-secondary-100: #ede9fe;
  --mz-secondary-200: #ddd6fe;
  --mz-secondary-300: #c4b5fd;
  --mz-secondary-400: #a78bfa;
  --mz-secondary-500: #8b5cf6;
  --mz-secondary-600: #7c3aed;
  --mz-secondary-700: #6d28d9;
  --mz-secondary-800: #5b21b6;
  --mz-secondary-900: #4c1d95;

  /* ── SUCCESS ────────────────────────────────────────────────── */
  --mz-success-light: #dcfce7;
  --mz-success:       #22c55e;
  --mz-success-dark:  #15803d;

  /* ── WARNING ────────────────────────────────────────────────── */
  --mz-warning-light: #fef3c7;
  --mz-warning:       #f59e0b;
  --mz-warning-dark:  #b45309;

  /* ── DANGER ─────────────────────────────────────────────────── */
  --mz-danger-light:  #fee2e2;
  --mz-danger:        #ef4444;
  --mz-danger-dark:   #b91c1c;

  /* ── INFO ───────────────────────────────────────────────────── */
  --mz-info-light:    #e0f2fe;
  --mz-info:          #0ea5e9;
  --mz-info-dark:     #0369a1;

  /* ── ACCENT (Amarelo) ───────────────────────────────────────── */
  --mz-accent:        #facc15;
  --mz-accent-dark:   #ca8a04;

  /* ── NEUTRAL ────────────────────────────────────────────────── */
  --mz-neutral-0:   #ffffff;
  --mz-neutral-50:  #f8fafc;
  --mz-neutral-100: #f1f5f9;
  --mz-neutral-200: #e2e8f0;
  --mz-neutral-300: #cbd5e1;
  --mz-neutral-400: #94a3b8;
  --mz-neutral-500: #64748b;
  --mz-neutral-600: #475569;
  --mz-neutral-700: #334155;
  --mz-neutral-800: #1e293b;
  --mz-neutral-900: #0f172a;

  /* ── SURFACE & BACKGROUND ───────────────────────────────────── */
  --mz-bg:            #f5f7fc;
  --mz-bg-subtle:     var(--mz-neutral-100);
  --mz-surface:       #ffffff;
  --mz-surface-2:     var(--mz-neutral-50);
  --mz-border:        var(--mz-neutral-200);
  --mz-border-subtle: rgba(15, 23, 42, 0.07);

  /* ── TEXT ────────────────────────────────────────────────────── */
  --mz-text:          var(--mz-neutral-800);
  --mz-text-subtle:   var(--mz-neutral-500);
  --mz-text-muted:    var(--mz-neutral-400);
  --mz-text-inverse:  #ffffff;
  --mz-text-link:     var(--mz-primary-600);

  /* ── TYPOGRAPHY ─────────────────────────────────────────────── */
  --mz-font-family:    'Manrope', system-ui, -apple-system, sans-serif;
  --mz-font-mono:      'Fira Code', 'Consolas', monospace;

  --mz-text-xs:   0.67rem;
  --mz-text-sm:   0.75rem;
  --mz-text-base: 0.875rem;
  --mz-text-md:   1rem;
  --mz-text-lg:   1.125rem;
  --mz-text-xl:   1.25rem;
  --mz-text-2xl:  1.5rem;
  --mz-text-3xl:  1.875rem;
  --mz-text-4xl:  2.25rem;

  --mz-font-normal:    400;
  --mz-font-medium:    500;
  --mz-font-semibold:  600;
  --mz-font-bold:      700;
  --mz-font-extrabold: 800;

  --mz-leading-tight:   1.1;
  --mz-leading-snug:    1.25;
  --mz-leading-normal:  1.5;
  --mz-leading-relaxed: 1.625;

  /* ── SPACING ─────────────────────────────────────────────────── */
  --mz-space-1:  0.25rem;
  --mz-space-2:  0.5rem;
  --mz-space-3:  0.75rem;
  --mz-space-4:  1rem;
  --mz-space-5:  1.25rem;
  --mz-space-6:  1.5rem;
  --mz-space-8:  2rem;
  --mz-space-10: 2.5rem;
  --mz-space-12: 3rem;
  --mz-space-16: 4rem;

  /* ── RADIUS ──────────────────────────────────────────────────── */
  --mz-radius-sm:   4px;
  --mz-radius-md:   8px;
  --mz-radius-lg:   12px;
  --mz-radius-xl:   16px;
  --mz-radius-2xl:  24px;
  --mz-radius-full: 9999px;

  /* ── SHADOWS ─────────────────────────────────────────────────── */
  --mz-shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --mz-shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04);
  --mz-shadow-md: 0 4px 12px rgba(15,23,42,0.08), 0 16px 32px rgba(15,23,42,0.05);
  --mz-shadow-lg: 0 8px 24px rgba(15,23,42,0.12), 0 24px 48px rgba(15,23,42,0.07);
  --mz-shadow-xl: 0 16px 40px rgba(15,23,42,0.16), 0 40px 80px rgba(15,23,42,0.10);

  /* ── Z-INDEX ──────────────────────────────────────────────────── */
  --mz-z-base:    0;
  --mz-z-raised:  10;
  --mz-z-sticky:  20;
  --mz-z-overlay: 30;
  --mz-z-modal:   40;
  --mz-z-toast:   50;
  --mz-z-tooltip: 60;

  /* ── MOTION ──────────────────────────────────────────────────── */
  --mz-ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --mz-ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --mz-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --mz-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --mz-duration-fast:   150ms;
  --mz-duration-normal: 200ms;
  --mz-duration-slow:   300ms;

  /* ── LAYOUT ──────────────────────────────────────────────────── */
  --mz-sidebar-width:   260px;
  --mz-sidebar-compact: 64px;
  --mz-topbar-height:   56px;
  --mz-content-max:     1200px;
  --mz-panel-gap:       1.5rem;
}

/* MDS Dark Mode Overrides ───────────────────────────────────── */
html[data-theme='dark'] {
  --mz-bg:            #0d1628;
  --mz-bg-subtle:     #111c31;
  --mz-surface:       var(--mz-neutral-800);
  --mz-surface-2:     #1a2740;
  --mz-border:        rgba(255, 255, 255, 0.08);
  --mz-border-subtle: rgba(255, 255, 255, 0.05);
  --mz-text:          var(--mz-neutral-100);
  --mz-text-subtle:   var(--mz-neutral-400);
  --mz-text-muted:    var(--mz-neutral-600);
  --mz-text-link:     var(--mz-primary-400);
}

/* MDS Utility Aliases ───────────────────────────────────────── */
.mds-surface { background: var(--mz-surface); border: 1px solid var(--mz-border-subtle); border-radius: var(--mz-radius-lg); box-shadow: var(--mz-shadow-sm); }

:root {
  --bg: #f8fafc;
  --bg-2: #e5e7eb;
  --text: #1e293b;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-2: #7c3aed;
  --brand-soft: #dbeafe;
  --accent: #facc15;
  --success: #22c55e;
  --danger: #ef4444;
  --card: #ffffff;
  --panel-topbar-bg: rgba(255, 255, 255, 0.75);
  --panel-topbar-text: #1e293b;
  --panel-topbar-border: rgba(37, 99, 235, 0.12);
  --panel-topbar-tag-bg: #fef9c3;
  --panel-topbar-tag-text: #92400e;
}

html[data-theme='dark'] {
  --bg: #0b1220;
  --bg-2: #111c31;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --brand-soft: rgba(37, 99, 235, 0.2);
  --card: #18243b;
  --panel-topbar-bg: rgba(15, 23, 42, 0.96);
  --panel-topbar-text: #f8fafc;
  --panel-topbar-border: rgba(148, 163, 184, 0.16);
  --panel-topbar-tag-bg: rgba(250, 204, 21, 0.16);
  --panel-topbar-tag-text: #fde68a;
}

* {
  font-family: 'Manrope', sans-serif;
}

.app-body,
.site-standard-shell {
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 90% -100px, rgba(37, 99, 235, 0.22) 0%, transparent 45%),
    radial-gradient(900px 550px at -10% 110%, rgba(124, 58, 237, 0.18) 0%, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.75rem;
  gap: 0.45rem;
  background:
    radial-gradient(500px 400px at 10% 20%, rgba(37, 99, 235, 0.2), transparent 65%),
    radial-gradient(600px 300px at 90% 80%, rgba(124, 58, 237, 0.18), transparent 70%);
}

.site-standard-shell .card,
.site-standard-shell .auth-card {
  border-radius: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.1);
  box-shadow: 0 16px 38px rgba(30, 41, 59, 0.08);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  border-radius: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.12) !important;
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.14) !important;
}

.auth-logo {
  width: 210px;
  max-width: 100%;
  height: auto;
  display: block;
}

.hero-panel {
  background:
    radial-gradient(500px 280px at 100% 0%, rgba(250, 204, 21, 0.24) 0%, transparent 70%),
    linear-gradient(130deg, #1e293b 0%, #2563eb 48%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 22px 50px rgba(30, 41, 59, 0.3);
}

.hero-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.18));
}

.hero-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fef08a;
}

.hero-slogan {
  font-weight: 600;
  font-size: 1.05rem;
  color: #e2e8f0;
}

.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

.site-standard-shell .btn {
  border-radius: 0.7rem;
  font-weight: 700;
}

.site-standard-shell .btn-primary {
  background: linear-gradient(135deg, var(--brand), #1d4ed8);
  border-color: var(--brand);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.site-standard-shell .btn-primary:hover,
.site-standard-shell .btn-primary:focus {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border-color: #1d4ed8;
}

.site-standard-shell .btn-outline-primary {
  border-color: #9ec5fe;
  color: #2563eb;
  background: #eff6ff;
}

.site-standard-shell .btn-outline-primary:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.site-standard-shell .btn-outline-secondary {
  border-color: #cbd5e1;
  color: #64748b;
}

.site-standard-shell .btn-outline-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #334155;
}

.site-standard-shell .btn-outline-danger {
  border-color: #fecaca;
  color: #dc2626;
}

.site-standard-shell .btn-outline-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.site-standard-shell .form-control,
.site-standard-shell .form-select,
.site-standard-shell .input-group .btn {
  border-radius: 0.75rem;
  border-color: #d5dceb;
}

.site-standard-shell .form-control:focus,
.site-standard-shell .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 0.15rem rgba(59, 130, 246, 0.12);
}

.btn-outline-light:hover {
  color: #1e293b;
  background-color: #f8fafc;
}

.metric-card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.08);
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.08);
}

.metric-card h6 {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-card strong {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.25rem;
}

.dashboard-pro-shell {
  display: grid;
  gap: 0.75rem;
}

.dashboard-pro-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 0.85rem;
}

.dashboard-pro-hero-copy,
.dashboard-pro-hero-actions,
.dashboard-pro-panel,
.dashboard-pro-metric-card {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 1rem;
  box-shadow: 0 16px 38px rgba(30, 41, 59, 0.08);
}

.dashboard-pro-hero-copy {
  padding: 1rem 1.05rem;
}

.dashboard-pro-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f46e5;
}

.dashboard-pro-title {
  margin: 0.35rem 0 0.4rem;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.dashboard-pro-subtitle {
  color: #64748b;
  font-size: 0.9rem;
}

.dashboard-pro-hero-actions {
  padding: 0.85rem;
  display: grid;
  align-content: center;
  gap: 0.55rem;
}

.dashboard-pro-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
}

.dashboard-pro-metric-card {
  padding: 0.72rem 0.8rem;
}

.dashboard-pro-metric-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  font-weight: 700;
}

.dashboard-pro-metric-value {
  display: block;
  margin-top: 0.22rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.dashboard-pro-panel {
  padding: 0.95rem;
}

.dashboard-pro-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.dashboard-pro-panel-head .h6 {
  color: #334155;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.dashboard-pro-panel-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.52rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.dashboard-pro-chart-wrap {
  min-height: 220px;
}

.dashboard-pro-quick-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.42rem;
}

.dashboard-pro-quick-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 0.32rem;
  color: #64748b;
  font-size: 0.84rem;
}

.dashboard-pro-quick-list li strong {
  color: #0f172a;
  font-weight: 800;
}

.stats-pro-page {
  --stats-surface: #ffffff;
  --stats-border: rgba(15, 23, 42, 0.08);
  --stats-ink: #0f172a;
  --stats-muted: #64748b;
  --stats-accent: #0ea5e9;
  --stats-glow: rgba(14, 165, 233, 0.14);
}

.stats-pro-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 0.85rem;
  align-items: end;
}

.stats-pro-title {
  font-size: clamp(1.15rem, 1.85vw, 1.58rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--stats-ink);
  font-weight: 800;
}

.stats-pro-subtitle {
  color: var(--stats-muted);
  max-width: 66ch;
  font-size: 0.9rem;
}

.stats-pro-controls {
  background:
    radial-gradient(100px 52px at 88% 0%, rgba(37, 99, 235, 0.15), transparent 74%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.03), rgba(37, 99, 235, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 0.9rem;
  padding: 0.62rem;
}

.stats-pro-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.stats-pro-actions .btn {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stats-pro-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.stats-kpi-card {
  background: var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  padding: 0.72rem 0.8rem;
  display: grid;
  gap: 0.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stats-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.32);
  box-shadow: 0 18px 34px var(--stats-glow);
}

.stats-kpi-label {
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stats-muted);
  font-weight: 700;
}

.stats-kpi-card strong {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--stats-ink);
  letter-spacing: -0.02em;
}

.stats-pro-grid {
  display: grid;
  gap: 0.85rem;
}

.stats-pro-grid-main {
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
}

.stats-pro-grid-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-panel {
  background:
    radial-gradient(500px 180px at 100% 0%, rgba(14, 165, 233, 0.06), transparent 72%),
    var(--stats-surface);
  border: 1px solid var(--stats-border);
  border-radius: 1rem;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.07);
  padding: 0.82rem;
  min-height: 250px;
  animation: stats-fade-up 0.42s ease both;
}

.stats-panel-wide {
  min-height: 320px;
}

.stats-panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.58rem;
}

.stats-panel-header .h6 {
  color: #1e293b;
  font-weight: 800;
}

#statsEvolutionChart,
#statsDistributionChart {
  width: 100%;
  min-height: 220px;
  max-height: 320px;
}

.stats-list,
.stats-ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.34rem;
}

.stats-list li,
.stats-ranking-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.84rem;
  color: #334155;
}

.stats-list li:hover,
.stats-ranking-list li:hover {
  background: rgba(226, 232, 240, 0.3);
  border-radius: 0.45rem;
  padding-left: 0.28rem;
  padding-right: 0.28rem;
}

.stats-list li strong,
.stats-ranking-list li strong {
  color: #0f172a;
  font-weight: 800;
}

.stats-list-empty {
  color: var(--stats-muted);
  font-style: italic;
}

.stats-heatmap,
.stats-calendar {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 0.24rem;
}

.stats-calendar {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.stats-heatmap-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.24rem;
  background: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.stats-heatmap-cell:hover {
  transform: scale(1.12);
  filter: brightness(0.95);
}

.stats-heatmap-cell.level-1 {
  background: #dbeafe;
}

.stats-heatmap-cell.level-2 {
  background: #93c5fd;
}

.stats-heatmap-cell.level-3 {
  background: #60a5fa;
}

.stats-heatmap-cell.level-4 {
  background: #2563eb;
}

.stats-ranking-card {
  background: linear-gradient(155deg, rgba(37, 99, 235, 0.09), rgba(15, 23, 42, 0.04));
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 0.92rem;
  padding: 0.76rem;
  color: #1e293b;
}

.stats-ranking-position {
  margin: 0;
  font-size: clamp(1.42rem, 2.1vw, 1.9rem);
  letter-spacing: -0.03em;
  color: #0f172a;
}

.stats-ranking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: #475569;
}

@keyframes stats-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .dashboard-pro-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-pro-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-pro-grid-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .dashboard-pro-hero {
    grid-template-columns: 1fr;
  }

  .stats-pro-hero,
  .stats-pro-grid-secondary {
    grid-template-columns: 1fr;
  }

  .stats-pro-actions {
    grid-template-columns: 1fr;
  }

  .stats-heatmap,
  .stats-calendar {
    grid-template-columns: repeat(14, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-pro-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-pro-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-panel {
    min-height: 220px;
  }

  .stats-heatmap,
  .stats-calendar {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

.library-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.library-pane-row {
  width: 100%;
}

.library-workspace-tabs-root {
  margin-bottom: 0.9rem;
}

.library-workspace-tabs {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.library-workspace-tabs button {
  border: 1px solid #dbe6f6;
  background: #f8fbff;
  color: #334155;
  border-radius: 999px;
  padding: 0.36rem 0.74rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.library-workspace-tabs button.active {
  border-color: #3358e6;
  background: linear-gradient(135deg, #3358e6 0%, #5b6df5 100%);
  color: #ffffff;
}

.library-workspace-panels > section {
  min-height: 240px;
}

.library-tab-toolbar {
  margin-bottom: 0.65rem;
}

.library-workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.72rem;
}

.library-rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.72rem;
}

.library-workspace-card {
  border: 1px solid #e6ebf5;
  border-radius: 0.9rem;
  padding: 0.72rem;
  background: #ffffff;
  min-height: 120px;
}

.library-workspace-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.42rem;
}

.library-workspace-card p {
  margin: 0;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.5;
}

.library-workspace-card-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.library-question-answer-preview {
  margin-top: 0.6rem;
  padding: 0.58rem 0.62rem;
  border: 1px solid #dbe5f4;
  border-radius: 0.7rem;
  background: #f8fbff;
}

.library-question-answer-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-bottom: 0.35rem;
}

.library-question-answer-preview ol {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.2rem;
}

.library-question-answer-preview li {
  font-size: 0.8rem;
  color: #334155;
}

.library-question-answer-preview li.is-correct {
  color: #14532d;
  font-weight: 700;
}

.library-question-answer-preview p {
  margin: 0;
  font-size: 0.8rem;
  color: #334155;
}

.library-question-answer-preview.is-empty {
  background: #f8fafc;
  border-style: dashed;
}

.library-question-options-editor {
  display: grid;
  gap: 0.45rem;
}

.library-question-options-actions {
  margin-top: 0.45rem;
  display: flex;
  justify-content: flex-start;
}

.library-question-option-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
}

.library-question-option-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.73rem;
  font-weight: 800;
}

.library-question-option-correct {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.76rem;
  color: #334155;
  margin: 0;
}

.library-workspace-empty {
  border: 1px dashed #cdd9ef;
  border-radius: 0.9rem;
  padding: 0.95rem;
  background: #fbfdff;
}

.library-workspace-empty h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
}

.library-workspace-empty p {
  margin: 0;
  color: #64748b;
  font-size: 0.84rem;
}

.library-workspace-skeleton {
  display: grid;
  gap: 0.55rem;
}

.library-workspace-skeleton span {
  display: block;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eff4fb 0%, #dde8f8 48%, #eff4fb 100%);
  background-size: 240% 100%;
  animation: library-skeleton 1.2s ease-in-out infinite;
}

@keyframes library-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.library-workspace-ia {
  border: 1px solid #e6ebf5;
  border-radius: 0.9rem;
  padding: 0.75rem;
  background: #ffffff;
}

.library-workspace-ia-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.62rem;
}

.library-workspace-ia-output {
  margin-top: 0.7rem;
  padding: 0.7rem;
  border-radius: 0.72rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  white-space: pre-wrap;
  color: #334155;
  font-size: 0.83rem;
  max-height: 380px;
  overflow: auto;
}

.library-workspace-footer {
  position: sticky;
  bottom: 0.5rem;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d9e4f4;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.library-workspace-footer span {
  font-size: 0.74rem;
  color: #334155;
  font-weight: 600;
}

.library-page-shell {
  position: relative;
}

.library-page-shell::before {
  content: '';
  position: absolute;
  inset: -1rem -1rem auto;
  height: 280px;
  border-radius: 2rem;
  background:
    radial-gradient(600px 220px at 10% 35%, rgba(37, 99, 235, 0.34) 0%, transparent 70%),
    radial-gradient(520px 260px at 85% 10%, rgba(124, 58, 237, 0.28) 0%, transparent 72%),
    radial-gradient(420px 220px at 78% 72%, rgba(250, 204, 21, 0.14) 0%, transparent 70%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.01) 100%);
  pointer-events: none;
  z-index: 0;
}

.library-page-shell > * {
  position: relative;
  z-index: 1;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 0.85rem;
  align-items: start;
}

.library-hero-copy,
.library-hero-metrics {
  border-radius: 1.25rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.84)),
    rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
  color: #f8fafc;
}

.library-hero-copy {
  padding: 0.75rem 0.85rem 0.78rem;
}

.library-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #fde68a;
}

.library-hero-eyebrow::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
}

.library-hero-title {
  font-size: clamp(1.15rem, 1.45vw, 1.55rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.library-hero-text {
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.library-hero-metrics {
  display: grid;
  gap: 0.3rem;
  padding: 0.48rem;
  align-content: start;
}

.library-hero-chip {
  padding: 0.38rem 0.52rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.library-hero-chip-accent {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(124, 58, 237, 0.22));
}

.library-hero-chip-label {
  display: block;
  margin-bottom: 0.03rem;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(226, 232, 240, 0.72);
}

.library-hero-chip strong {
  font-size: 0.72rem;
  line-height: 1.05;
  font-weight: 800;
  color: #fff;
}

html[data-theme='dark'] .library-hero-copy,
html[data-theme='dark'] .library-hero-metrics {
  color: #f8fafc;
}

html[data-theme='dark'] .library-hero-title {
  color: #ffffff;
}

html[data-theme='dark'] .library-hero-text {
  color: rgba(226, 232, 240, 0.94);
}

html[data-theme='dark'] .library-hero-chip-label {
  color: rgba(226, 232, 240, 0.72);
}

.library-pane {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.25rem;
  padding: 1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  color: #e2e8f0;
}

.library-pane-left,
.library-pane-right {
  position: static;
  top: auto;
  height: auto;
  overflow: visible;
}

.library-tree-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 0.7rem;
  align-items: start;
}

.library-tree-panel-main,
.library-tree-panel-side {
  min-width: 0;
}

.library-tree-panel-side {
  display: grid;
  gap: 0.6rem;
}

.library-tree-summary,
.library-tree-shortcuts {
  border-radius: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  padding: 0.75rem;
}

.library-tree-summary-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.library-tree-summary-value {
  display: block;
  font-size: 1rem;
  color: var(--text);
}

.library-tree-summary-note {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
}

.library-tree-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.library-tree-shortcut {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand);
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-size: 0.7rem;
  font-weight: 700;
}

.library-tree {
  display: grid;
  gap: 0.5rem;
}

.library-tree-item {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.85rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.92) 100%);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #e2e8f0;
  width: 100%;
  box-sizing: border-box;
}

.library-tree-item-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}

.library-tree-item-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
  flex: 0 0 auto;
}

.library-tree-chip,
.library-content-chip,
.library-tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: #bfdbfe;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.library-tag-chip {
  background: rgba(124, 58, 237, 0.14);
  color: #ddd6fe;
  border-color: rgba(124, 58, 237, 0.18);
}

button.library-tag-chip {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  gap: 0.3rem;
}

.library-tag-chip.is-muted {
  background: rgba(100, 116, 139, 0.12);
  color: rgba(226, 232, 240, 0.72);
  border-color: rgba(148, 163, 184, 0.14);
}

.library-tag-chip.is-active {
  background: rgba(96, 165, 250, 0.18);
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.18) inset;
}

.library-tag-chip-count {
  font-size: 0.58rem;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.8;
}

.library-tree-item.active {
  border-color: rgba(96, 165, 250, 0.75);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(124, 58, 237, 0.24));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.library-tree-item:hover,
.library-content-item:hover,
.library-version-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.library-content-item {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  padding: 1rem 1rem 1rem 4.6rem;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%),
    rgba(15, 23, 42, 0.92);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  color: #e2e8f0;
}

.library-content-item:hover {
  border-color: rgba(96, 165, 250, 0.5);
}

.library-content-item::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 1rem;
  bottom: 1rem;
  width: 3rem;
  border-radius: 0.9rem;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.95), rgba(124, 58, 237, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.library-content-cover {
  position: absolute;
  left: 1rem;
  top: 1rem;
  bottom: 1rem;
  width: 3rem;
  border-radius: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 1;
}

.library-content-cover-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.library-content-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.library-content-description {
  color: rgba(226, 232, 240, 0.76);
  font-size: 0.92rem;
  line-height: 1.45;
}

.library-content-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.78rem;
}

.library-content-preview {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: rgba(241, 245, 249, 0.9);
  line-height: 1.6;
}

.library-content-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.library-version-item {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.85rem;
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.88) 100%);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  color: #e2e8f0;
}

.library-pane-center .card,
.library-pane-center .card-body {
  background: transparent;
}

.library-pane-left .h6,
.library-pane-right .h6,
.library-pane-center .h6,
.library-pane-center h3 {
  letter-spacing: -0.02em;
}

.library-pane-left,
.library-pane-right {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.library-pane-center .card {
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  border-radius: 1.25rem;
  background: rgba(15, 23, 42, 0.76) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14) !important;
}

.library-pane-center .form-control,
.library-pane-center .form-select,
.library-pane-center .input-group .form-control,
.library-pane-center .input-group .btn,
.library-pane-center .ql-toolbar,
.library-pane-center .ql-container {
  border-radius: 0.85rem;
}

.library-pane-center .form-control,
.library-pane-center .form-select,
.library-pane-center .input-group .form-control,
.library-pane-center .input-group .btn {
  background-color: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

.library-pane-center .form-control::placeholder {
  color: rgba(226, 232, 240, 0.5);
}

.library-pane-center .form-control:focus,
.library-pane-center .form-select:focus {
  border-color: rgba(96, 165, 250, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
}

.library-pane-center .ql-toolbar {
  border-color: rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.9));
}

.library-pane-center .ql-container {
  border-color: rgba(148, 163, 184, 0.16);
  min-height: 280px;
  background: rgba(15, 23, 42, 0.96);
}

.library-pane-center .ql-editor {
  min-height: 280px;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.library-pane-center .ql-editor.ql-blank::before {
  color: rgba(226, 232, 240, 0.45);
  font-style: normal;
}

html[data-theme='light'] .library-page-shell::before {
  background:
    radial-gradient(600px 220px at 10% 35%, rgba(37, 99, 235, 0.24) 0%, transparent 70%),
    radial-gradient(520px 260px at 85% 10%, rgba(124, 58, 237, 0.18) 0%, transparent 72%),
    radial-gradient(420px 220px at 78% 72%, rgba(250, 204, 21, 0.12) 0%, transparent 70%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.01) 100%);
}

html[data-theme='light'] .library-hero-copy,
html[data-theme='light'] .library-hero-metrics {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.12);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .library-hero-title,
html[data-theme='light'] .library-hero-text,
html[data-theme='light'] .library-hero-chip strong {
  color: var(--text);
}

html[data-theme='light'] .library-hero-copy {
  text-shadow: none;
}

html[data-theme='light'] .library-hero-eyebrow,
html[data-theme='light'] .library-hero-chip-label {
  color: var(--muted);
}

html[data-theme='light'] .library-hero-chip,
html[data-theme='light'] .library-pane,
html[data-theme='light'] .library-pane-center .card {
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--text);
}

html[data-theme='light'] .library-pane {
  border-color: rgba(37, 99, 235, 0.12);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .library-pane-left,
html[data-theme='light'] .library-pane-right {
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme='light'] .library-tree-summary,
html[data-theme='light'] .library-tree-shortcuts {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(37, 99, 235, 0.12);
}

html[data-theme='dark'] .library-tree-summary,
html[data-theme='dark'] .library-tree-shortcuts {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .library-tree-shortcut {
  background: rgba(255, 255, 255, 0.08);
  color: #bfdbfe;
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1199.98px) {
  .library-tree-panel {
    grid-template-columns: 1fr;
  }

  .library-tree-panel-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1399.98px) {
  .library-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

html[data-theme='light'] .library-tree-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .library-tree-chip,
html[data-theme='light'] .library-content-chip,
html[data-theme='light'] .library-tag-chip {
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand);
  border-color: rgba(37, 99, 235, 0.12);
}

html[data-theme='light'] .library-tag-chip {
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.12);
}

html[data-theme='light'] .library-tag-chip.is-muted {
  background: rgba(100, 116, 139, 0.08);
  color: var(--muted);
  border-color: rgba(100, 116, 139, 0.12);
}

html[data-theme='light'] .library-content-item,
html[data-theme='light'] .library-version-item {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .library-content-description,
html[data-theme='light'] .library-content-meta,
html[data-theme='light'] .library-content-preview {
  color: var(--muted);
}

html[data-theme='light'] .library-content-item::before {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.95), rgba(124, 58, 237, 0.95));
}

html[data-theme='light'] .library-pane-center .card {
  border-color: rgba(37, 99, 235, 0.12) !important;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme='light'] .library-pane-center .form-control,
html[data-theme='light'] .library-pane-center .form-select,
html[data-theme='light'] .library-pane-center .input-group .form-control,
html[data-theme='light'] .library-pane-center .input-group .btn {
  background-color: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

html[data-theme='light'] .library-pane-center .form-control::placeholder {
  color: var(--muted);
}

html[data-theme='light'] .library-pane-center .ql-toolbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .library-pane-center .ql-container {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme='light'] .library-pane-center .ql-editor {
  color: var(--text);
}

html[data-theme='light'] .library-pane-center .ql-editor.ql-blank::before {
  color: var(--muted);
}

.library-pane-center .btn-primary,
.library-pane-center .btn-success {
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.library-pane-center .btn-outline-secondary,
.library-pane-center .btn-outline-danger,
.library-pane-center .btn-outline-primary {
  border-width: 1.5px;
}

@media (max-width: 1199px) {
  .library-workspace {
    grid-template-columns: 1fr;
  }

  .library-pane-left,
  .library-pane-right {
    position: static;
    height: auto;
  }
}

/* library-pro fidelity overrides */
.library-pro-shell {
  background: #f5f7fc !important;
}

.library-pro-shell .panel-sidebar {
  width: 260px;
  min-width: 260px;
  background: #ffffff;
  border-right: 1px solid #e6ebf5;
}

.library-pro-shell .sidebar-nav .nav-link {
  color: #4b5563;
  font-weight: 600;
}

.library-pro-shell .sidebar-nav-pro .nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-start;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
}

.library-pro-shell .sidebar-nav-pro .nav-link.active {
  background: #eef2ff;
  color: #3358e6;
}

.library-pro-shell .sidebar-nav-pro .nav-link i {
  font-size: 0.92rem;
}

.library-pro-shell .sidebar-nav-pro .nav-link.active i {
  color: #3358e6;
}

.library-pro-shell .sidebar-nav-pro .icon-home { color: #0ea5e9; }
.library-pro-shell .sidebar-nav-pro .icon-library { color: #4f46e5; }
.library-pro-shell .sidebar-nav-pro .icon-review { color: #f59e0b; }
.library-pro-shell .sidebar-nav-pro .icon-flash { color: #16a34a; }
.library-pro-shell .sidebar-nav-pro .icon-question { color: #dc2626; }
.library-pro-shell .sidebar-nav-pro .icon-mind { color: #7c3aed; }
.library-pro-shell .sidebar-nav-pro .icon-bookmark { color: #2563eb; }
.library-pro-shell .sidebar-nav-pro .icon-note { color: #db2777; }
.library-pro-shell .sidebar-nav-pro .icon-trash { color: #ef4444; }

.library-pro-new-btn {
  border: none;
  border-radius: 0.72rem;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  font-weight: 700;
  padding: 0.52rem 0.7rem;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.library-pro-new-btn:hover {
  color: #ffffff;
  filter: brightness(1.02);
}

.sidebar-nav-badge {
  margin-left: auto;
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.42rem;
}

.library-pro-shell .sidebar-account-card {
  display: none;
}

.library-pro-shell .library-pro-side-tree h6 {
  color: #94a3b8;
  letter-spacing: 0.08em;
}

.library-pro-shell .library-pro-side-tree .library-tree-item {
  background: transparent;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  border-radius: 0.62rem;
  padding: 0.38rem 0.45rem;
  color: #334155;
}

.library-pro-shell .library-pro-side-tree .library-tree-item:hover,
.library-pro-shell .library-pro-side-tree .library-tree-item.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  transform: none;
}

.library-pro-storage-card {
  margin-top: auto;
  border: 1px solid #e6ebf5;
  background: #ffffff;
  border-radius: 0.65rem;
  padding: 0.65rem;
}

.library-pro-storage-card .progress {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
}

.library-pro-storage-card .progress-bar {
  background: linear-gradient(90deg, #4f46e5, #2563eb);
}

.library-pro-shell .library-pro-side-tree .library-tree-item-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-item-icon.subject { background: #dbeafe; color: #1d4ed8; }
.library-pro-shell .library-pro-side-tree .library-tree-item-icon.discipline { background: #ede9fe; color: #6d28d9; }
.library-pro-shell .library-pro-side-tree .library-tree-item-icon.topic { background: #fef3c7; color: #b45309; }
.library-pro-shell .library-pro-side-tree .library-tree-item-icon.subtopic { background: #dcfce7; color: #15803d; }
.library-pro-shell .library-pro-side-tree .library-tree-item-icon.folder { background: #e0f2fe; color: #0369a1; }
.library-pro-shell .library-pro-side-tree .library-tree-item-icon.collection { background: #ffe4e6; color: #be123c; }
.library-pro-shell .library-pro-side-tree .library-tree-item-icon.default { background: #e2e8f0; color: #475569; }

.library-pro-shell .library-pro-side-tree .library-tree-chip {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #dbe3ff;
  letter-spacing: 0.03em;
  text-transform: none;
}

.library-pro-shell .panel-topbar.library-pro-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e6ebf5;
}

.library-pro-shell .library-pro-search-wrap {
  background: #f8fafc;
  border-color: #e5eaf3;
  border-radius: 0.65rem;
  height: 40px;
}

.library-pro-shell .panel-content {
  padding: 0.9rem 1.1rem 1.2rem;
}

.library-pro-shell .library-pro-breadcrumb {
  font-size: 0.78rem;
  color: #94a3b8;
}

.library-pro-shell .library-workspace {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
}

.library-pro-shell .library-pro-filter-row,
.library-pro-shell .library-pro-list-row {
  display: none;
}

.library-pro-shell .library-pro-editor-row {
  display: block !important;
}

/* List-first behavior in library mode */
.library-pro-shell .library-pro-list-row {
  display: block !important;
}

.library-pro-shell #libraryWorkspace.library-content-focused .library-pro-filter-row,
.library-pro-shell #libraryWorkspace.library-content-focused .library-pro-list-row {
  display: none !important;
}

.library-pro-shell #libraryWorkspace.library-content-focused .library-pro-editor-row {
  display: block !important;
}

.library-pro-shell #libraryWorkspace:not(.library-content-focused) .library-pro-doc {
  display: none !important;
}

.library-pro-shell #libraryWorkspace.library-content-focused .library-pro-doc {
  display: block !important;
}

.library-pro-shell #libraryEditorSection.d-none {
  display: none !important;
}

.library-pro-shell .library-pane,
.library-pro-shell .library-pane-center .card,
.library-pro-shell .library-pane-center .card-body,
.library-pro-shell .library-pro-doc {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e6ebf5 !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
}

.library-pro-shell .library-pro-doc-title {
  color: #1e293b;
  font-weight: 800;
}

.library-pro-shell .library-top-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #1e293b;
  border-color: #e7ecf6;
}

.library-pro-shell .library-top-tags {
  font-size: 0.92rem;
  border-color: #e7ecf6;
}

.library-pro-shell .library-top-title::placeholder,
.library-pro-shell .library-top-tags::placeholder {
  color: #94a3b8;
}

.library-pro-shell .library-pro-chip {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #dbe3ff;
}

.library-pro-shell .library-pro-meta-row {
  color: #64748b;
}

.library-pro-shell .library-content-item,
.library-pro-shell .library-version-item {
  background: #ffffff;
  border: 1px solid #e6ebf5;
  color: #1e293b;
}

.library-pro-shell .library-content-item::before,
.library-pro-shell .library-content-cover {
  opacity: 0.9;
}

.library-pro-shell .library-content-description,
.library-pro-shell .library-content-meta,
.library-pro-shell .library-content-preview {
  color: #64748b;
}

.library-pro-shell .library-pane-center .form-control,
.library-pro-shell .library-pane-center .form-select,
.library-pro-shell .library-pane-center .input-group .form-control,
.library-pro-shell .library-pane-center .input-group .btn {
  background: #ffffff;
  border-color: #dbe3ef;
  color: #1e293b;
}

.library-pro-shell .library-pane-center .ql-toolbar,
.library-pro-shell .library-pane-center .ql-container {
  background: #ffffff;
  border-color: #dbe3ef;
}

.library-pro-shell .library-pane-center .ql-editor {
  color: #1e293b;
}

.library-pro-shell .library-pro-right .library-pane h2 {
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.library-pro-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
}

.library-pro-card-title i {
  font-size: 0.85rem;
}

.library-pro-shell .library-pane:nth-child(1) .library-pro-card-title i { color: #4f46e5; }
.library-pro-shell .library-pane:nth-child(2) .library-pro-card-title i { color: #0ea5e9; }
.library-pro-shell .library-pane:nth-child(3) .library-pro-card-title i { color: #8b5cf6; }
.library-pro-shell .library-pane:nth-child(4) .library-pro-card-title i { color: #f59e0b; }

.library-pro-shell .library-pro-editor-row h3.h6 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #223148;
}

.library-pro-shell .library-pro-editor-row .form-control,
.library-pro-shell .library-pro-editor-row .form-select {
  font-size: 0.93rem;
}

.library-pro-shell .library-pro-editor-row .form-control::placeholder {
  color: #94a3b8;
}

.library-pro-stat-item span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.library-pro-stat-item span i {
  color: #6366f1;
  font-size: 0.78rem;
}

.library-pro-shell .library-pane .small i {
  color: #0ea5e9;
}

.library-pro-shell .library-version-item {
  border-radius: 0.7rem;
  border-color: #e2e8f0;
}

.library-version-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.library-version-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.library-version-content {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.library-version-reason {
  display: inline-flex;
  width: fit-content;
  font-size: 0.66rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  border: 1px solid transparent;
}

.library-version-reason.autosave { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.library-version-reason.update { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.library-version-reason.create { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

.library-versions-toggle {
  padding: 0.1rem 0;
  color: #4f46e5;
  font-weight: 700;
  text-decoration: none;
}

.library-versions-toggle:hover {
  color: #3730a3;
  text-decoration: underline;
}

.library-editor-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.8rem;
}

.library-editor-footer-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.42rem;
}

.library-editor-footer-title i {
  color: #4f46e5;
}

.library-editor-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
}

.library-editor-action-btn i {
  font-size: 0.9rem;
  line-height: 1;
}

#libraryManualSaveBtn i {
  color: #4f46e5;
}

#librarySaveBtn i {
  color: rgba(255, 255, 255, 0.96);
}

#libraryFavoriteBtn i {
  color: #f59e0b;
}

#libraryDeleteBtn i {
  color: #dc2626;
}

.library-editor-footer .input-group .btn.library-editor-action-btn i {
  color: currentColor;
}

.library-highlight-editor-wrap {
  position: relative;
}

.library-highlight-toolbar {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.7rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.4);
  padding: 0.35rem;
}

.library-highlight-tool {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.48rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.library-highlight-tool .swatch {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  display: inline-block;
}

.library-highlight-tool .swatch.yellow { background: #fef08a; }
.library-highlight-tool .swatch.green { background: #86efac; }
.library-highlight-tool .swatch.blue { background: #93c5fd; }
.library-highlight-tool .swatch.red { background: #fca5a5; }
.library-highlight-tool .swatch.purple { background: #d8b4fe; }

.library-highlight-tool:hover {
  border-color: rgba(129, 140, 248, 0.9);
  color: #f8fafc;
}

.library-highlight-tool.is-disabled,
.library-highlight-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.library-attachment-preview {
  display: grid;
  gap: 0.75rem;
}

.library-attachment-preview-head {
  gap: 0.75rem;
}

.library-attachment-preview-text {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.85rem;
  color: #0f172a;
  line-height: 1.75;
  max-height: 340px;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.library-attachment-pdf-frame {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.85rem;
  width: 100%;
  min-height: 420px;
  background: #fff;
}

/* Toolbar sub-panels */
.lht-main,
.lht-ai {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.lht-divider {
  width: 1px;
  height: 1.1rem;
  background: rgba(148, 163, 184, 0.35);
  flex-shrink: 0;
}

.lht-ai-trigger {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.4);
}

.lht-ai-trigger:hover {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.7);
  background: rgba(139, 92, 246, 0.15);
}

.lht-ai-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.04em;
  padding: 0 0.15rem;
  white-space: nowrap;
}

.lht-back {
  border-color: rgba(148, 163, 184, 0.4);
  padding: 0.2rem 0.4rem;
}

.lht-ai-btn {
  border-color: rgba(167, 139, 250, 0.35);
  color: #e2e8f0;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.lht-ai-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(167, 139, 250, 0.7);
  color: #f8fafc;
}


.library-highlight-controls {
  display: grid;
  gap: 0.45rem;
}

.library-highlight-control-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

#libraryHighlightClearPrefs {
  border-color: #cbd5e1;
  color: #64748b;
}

#libraryHighlightClearPrefs:hover {
  background: #f8fafc;
  color: #475569;
}

.library-highlight-stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.library-highlight-stats .stat-chip {
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.66rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-weight: 700;
}

.library-highlight-export {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.library-highlight-list {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 0.45rem;
}

.library-highlight-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.7rem;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.library-highlight-item.active {
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3) inset;
}

.library-highlight-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.library-highlight-color-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

.library-highlight-color-dot.yellow { background: #facc15; }
.library-highlight-color-dot.green { background: #22c55e; }
.library-highlight-color-dot.blue { background: #3b82f6; }
.library-highlight-color-dot.red { background: #ef4444; }
.library-highlight-color-dot.purple { background: #a855f7; }

.library-highlight-item-text {
  font-size: 0.76rem;
  color: #e2e8f0;
}

.library-highlight-item-meta {
  font-size: 0.65rem;
  color: #94a3b8;
}

.library-highlight-item-tags {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.library-highlight-item-tags span {
  font-size: 0.62rem;
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.library-highlight-detail {
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  padding-top: 0.6rem;
}

.library-highlight-detail-box {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.7rem;
  padding: 0.55rem;
  background: rgba(15, 23, 42, 0.45);
}

.library-highlight-detail-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.library-highlight-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.library-highlight-pagination .btn[disabled] {
  opacity: 0.45;
}

.library-highlight-pagination #libraryHighlightPerPage {
  width: 84px;
  min-width: 84px;
}

.library-highlight-pagination #libraryHighlightCursorToggle {
  min-width: 96px;
}

.library-highlight-perf-hint {
  min-height: 1.25rem;
  font-size: 0.7rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.library-highlight-perf-hint .hint-badge {
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  padding: 0.05rem 0.4rem;
  background: #f8fafc;
  font-weight: 700;
}

.library-editor-footer .input-group .btn {
  border-color: #c7d2fe;
  color: #4338ca;
}

.library-editor-footer .input-group .btn:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
}

.library-pro-shell .library-pro-doc .btn-outline-secondary {
  border-color: #cbd5e1;
  color: #64748b;
}

#libraryNewContentBtn {
  border-radius: 0.62rem;
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
  font-weight: 700;
}

#libraryNewContentBtnSecondary {
  border-radius: 0.62rem;
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
  font-weight: 700;
  padding-inline: 0.9rem;
}

#libraryNewContentBtn:hover {
  border-color: #a5b4fc;
  background: #e0e7ff;
  color: #3730a3;
}

#libraryNewContentBtnSecondary:hover {
  border-color: #a5b4fc;
  background: #e0e7ff;
  color: #3730a3;
}

#libraryManualSaveBtn {
  border-radius: 0.62rem;
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
  font-weight: 700;
  padding-inline: 0.9rem;
}

#libraryManualSaveBtn:hover,
#libraryManualSaveBtn:focus,
#libraryManualSaveBtn:active {
  border-color: #a5b4fc;
  background: #e0e7ff;
  color: #3730a3;
}

.library-pro-shell .library-pro-doc .btn-outline-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #334155;
}

.panel-shell:not(.library-pro-shell) {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.panel-sidebar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: nowrap;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(37, 99, 235, 0.1);
  padding: 0.7rem 0.95rem;
  position: sticky;
  top: 0;
  z-index: 20;
  overflow-x: auto;
}

html[data-theme='dark'] .panel-sidebar {
  background: rgba(22, 34, 53, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme='dark'] .sidebar-user-card {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .sidebar-user-meta strong,
html[data-theme='dark'] .sidebar-user-meta span {
  color: #e2e8f0;
}

.panel-sidebar .sidebar-brand {
  margin-bottom: 0 !important;
  flex: 0 0 auto;
}

.panel-sidebar .sidebar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.4rem;
  white-space: nowrap;
}

.sidebar-nav .nav-link {
  color: var(--text);
  border-radius: 0.7rem;
  padding: 0.6rem 0.75rem;
}

.sidebar-nav {
  flex-direction: row !important;
  flex-wrap: nowrap;
  gap: 0.3rem !important;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-nav .nav-link {
  padding: 0.5rem 0.65rem;
  white-space: nowrap;
  font-size: 0.94rem;
}

.sidebar-nav .nav-link:hover {
  background: var(--brand-soft);
}

.sidebar-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  color: #fff;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-2) 100%);
}

.sidebar-logo {
  width: 48px;
  max-width: 100%;
  height: auto;
  display: block;
}

.sidebar-brand-wrap {
  padding: 0.32rem 0.42rem;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.06) 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.sidebar-brand-sub {
  display: none;
}

.sidebar-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  margin-left: 0.25rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(37, 99, 235, 0.06);
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.sidebar-user-card-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
  flex: 0 0 auto;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-meta strong {
  font-size: 0.88rem;
  line-height: 1.1;
}

.sidebar-user-meta span {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sidebar-user-badges .badge {
  padding: 0.32rem 0.48rem;
  font-size: 0.67rem;
}

.sidebar-account-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-account-actions .btn {
  white-space: nowrap;
}

@media (max-width: 992px) {
  .sidebar-account-card {
    align-items: flex-start;
  }

  .sidebar-account-actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .sidebar-account-actions .btn,
  .sidebar-logout-form {
    width: 100%;
  }
}

.panel-topbar-title {
  min-width: 0;
  flex: 1 1 auto;
}

.panel-topbar-user-inline {
  margin-left: 0.45rem;
  padding: 0.32rem 0.5rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  flex-wrap: nowrap;
}

.panel-topbar-user-inline .panel-topbar-user-info strong {
  font-size: 0.88rem;
}

.panel-topbar-user-inline .panel-topbar-user-info span {
  font-size: 0.72rem;
  max-width: 16rem;
}

.panel-topbar-user-inline .panel-topbar-badges {
  flex-wrap: nowrap;
}

.panel-topbar-user-inline .panel-topbar-badges .badge {
  padding: 0.3rem 0.5rem;
  font-size: 0.67rem;
}

.panel-main {
  padding: 1rem 1.2rem 1.2rem;
  min-width: 0;
}

.panel-topbar {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 0.9rem;
  padding: 0.42rem 0.68rem;
  margin-bottom: 0.7rem;
  gap: 0.45rem;
}

.panel-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.panel-topbar-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
  flex: 0 0 auto;
}

.panel-topbar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-topbar-user-info strong {
  font-size: 0.95rem;
  line-height: 1.1;
}

.panel-topbar-user-info span {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22rem;
}

.panel-topbar-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.panel-topbar-badges .badge {
  letter-spacing: 0.03em;
  padding: 0.45rem 0.7rem;
}

.memorizza-tag {
  background: #fef9c3;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  flex: 0 0 auto;
}

.panel-topbar-title {
  min-width: 0;
  flex: 1 1 auto;
}

.panel-topbar-title .d-flex {
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap !important;
}

.panel-topbar-title h1,
.panel-topbar-title h1.h5 {
  font-size: 1.12rem !important;
  line-height: 1.1 !important;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme='dark'] .panel-topbar {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  color: #f8fafc !important;
}

html[data-theme='dark'] .panel-topbar,
html[data-theme='dark'] .panel-topbar-title,
html[data-theme='dark'] .panel-topbar-title h1 {
  color: #f8fafc !important;
}

html[data-theme='dark'] .memorizza-tag {
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
}

html[data-theme='dark'] .panel-topbar .btn-outline-secondary {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.35);
}

html[data-theme='dark'] .panel-topbar .btn-outline-secondary:hover {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.5);
}

html[data-theme='dark'] .panel-topbar-user-info strong,
html[data-theme='dark'] .panel-topbar-user-info span {
  color: #e2e8f0;
}

.panel-content {
  animation: fadeUp 350ms ease;
}

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

/* Library Pro layout (reference-like) */
.library-pro-shell {
  display: grid;
  background: #ffffff;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 1fr;
  min-height: 100vh;
}

.library-pro-shell,
.library-pro-shell .panel-main,
.library-pro-shell .panel-content,
.library-pro-shell .library-page-shell {
  background: #ffffff !important;
}

.library-pro-shell .panel-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 1rem 0.85rem;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: none;
  background: #ffffff;
}

.sidebar-brand-head {
  position: relative;
  width: 100%;
}

.sidebar-collapse-btn {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid #dbe5f7;
  border-radius: 8px;
  background: #f8fbff;
  color: #5870de;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sidebar-collapse-btn:hover {
  background: #eef3ff;
  border-color: #c9d8fb;
}

@media (min-width: 1200px) {
  .library-pro-shell.sidebar-collapsed {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .library-pro-shell.sidebar-collapsed .panel-sidebar {
    width: 88px;
    min-width: 88px;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    align-items: center;
  }

  .library-pro-shell.sidebar-collapsed .sidebar-brand-wrap {
    justify-content: center;
    width: 100%;
    gap: 0;
    padding: 0.28rem 0.2rem;
  }

  .library-pro-shell.sidebar-collapsed .sidebar-brand-sub,
  .library-pro-shell.sidebar-collapsed .sidebar-brand-text,
  .library-pro-shell.sidebar-collapsed .sidebar-group-title,
  .library-pro-shell.sidebar-collapsed .sidebar-plan-card {
    display: none !important;
  }

  .library-pro-shell.sidebar-collapsed .sidebar-collapse-btn {
    position: absolute;
    right: -12px;
    top: 8px;
    z-index: 3;
    border-radius: 999px;
    width: 28px;
    height: 28px;
    background: #f2f5ff;
    box-shadow: 0 6px 16px rgba(79, 108, 247, 0.18);
  }

  .library-pro-shell.sidebar-collapsed .sidebar-nav {
    width: 100%;
    align-items: center;
    gap: 0.45rem !important;
  }

  .library-pro-shell.sidebar-collapsed .sidebar-nav .nav-link {
    width: 44px;
    min-width: 44px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0;
    border-radius: 10px;
  }

  .library-pro-shell.sidebar-collapsed .sidebar-nav .nav-link i {
    margin: 0;
    font-size: 1rem;
  }
}

.library-pro-shell .panel-main {
  padding: 0;
  background: transparent;
}

.library-pro-shell .panel-content {
  padding: 0 1rem 1rem;
}

.library-pro-shell .panel-topbar.library-pro-topbar {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 0.9rem;
  padding: 0.54rem 0.9rem;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.library-pro-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.7rem;
  padding: 0.32rem 0.58rem;
  width: min(100%, 560px);
}

.library-pro-search-wrap > i {
  color: #64748b;
}

.library-pro-search-input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.88rem;
  color: #1e293b;
}

.library-pro-shortcut {
  font-size: 0.72rem;
  color: #94a3b8;
}

.library-pro-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.library-pro-icon-btn {
  color: #64748b;
  padding: 0.2rem 0.35rem;
}

.library-pro-icon-btn:hover {
  color: #1e293b;
}

.library-pro-user-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-left: 0.35rem;
}

.library-pro-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #4f46e5, #2563eb);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.library-pro-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.library-pro-user-meta strong {
  font-size: 0.83rem;
  color: #1e293b;
}

.library-pro-user-meta small {
  font-size: 0.72rem;
  color: #64748b;
}

.library-pro-shell .sidebar-brand {
  margin-bottom: 0.7rem !important;
  display: flex;
  justify-content: flex-start;
}

.library-pro-shell .sidebar-brand-wrap {
  width: auto;
  height: auto;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.library-pro-shell .sidebar-logo {
  width: 146px;
  max-width: 100%;
  max-height: 46px;
  object-fit: contain;
}

.library-pro-shell .sidebar-brand-sub {
  display: none;
}

.library-pro-shell .sidebar-nav {
  flex-direction: column !important;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.2rem !important;
}

.library-pro-shell .sidebar-nav .nav-link {
  font-size: 0.89rem;
  padding: 0.43rem 0.58rem;
  border-radius: 0.55rem;
}

.library-pro-shell .library-pro-side-tree {
  margin-top: 0.35rem;
}

.library-pro-shell .library-pro-side-tree .library-tree {
  max-height: 320px;
  overflow: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-item {
  white-space: normal;
  word-break: break-word;
}

.library-pro-shell .sidebar-account-card {
  margin-top: auto;
  width: 100%;
  margin-left: 0;
}

.library-pro-shell .library-hero {
  display: none;
}

.library-pro-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: #7b8ba1;
}

.library-pro-breadcrumb-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.library-pro-applied-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-left: 0.2rem;
}

.library-pro-applied-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
}

.library-pro-applied-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  font-size: 0.66rem;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.library-pro-applied-chip strong {
  font-weight: 800;
}

.library-pro-applied-chip.is-muted {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.library-pro-breadcrumb i {
  font-size: 0.65rem;
}

.library-pro-shell .library-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 0.85rem;
}

.library-pro-main,
.library-pro-right {
  min-width: 0;
}

.library-pro-doc-title {
  font-size: clamp(1.28rem, 1.58vw, 1.78rem);
  letter-spacing: -0.03em;
  color: #0f172a;
}

.library-pro-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.library-pro-chip {
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.2rem 0.52rem;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid rgba(79, 70, 229, 0.2);
  font-weight: 700;
}

.library-pro-chip-action {
  border: 1px dashed rgba(79, 70, 229, 0.28);
  background: #f8faff;
  cursor: pointer;
}

.library-pro-chip-action:hover {
  background: #eef2ff;
  color: #312e81;
}

.library-pro-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: #64748b;
  font-size: 0.73rem;
}

.library-pro-meta-row i {
  margin-right: 0.22rem;
}

.library-pro-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.22);
  font-size: 0.83rem;
}

.library-pro-stat-item:last-child {
  border-bottom: none;
}

.library-pro-stat-item strong {
  color: #2563eb;
}

@media (max-width: 1199px) {
  .library-pro-shell {
    grid-template-columns: 1fr;
  }

  .library-pro-shell .panel-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .library-pro-shell .library-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .panel-sidebar {
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
  }

  .panel-sidebar .sidebar-brand-sub {
    display: none;
  }

  .sidebar-nav {
    gap: 0.2rem !important;
  }

  .sidebar-nav .nav-link {
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
  }

  .panel-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel-sidebar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .panel-topbar {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  .panel-topbar-user {
    width: 100%;
    margin-right: 0 !important;
    flex-wrap: wrap;
  }

  .panel-topbar-user-inline {
    margin-left: 0;
    width: 100%;
    border-radius: 0.9rem;
  }

  .panel-topbar-user-info span {
    max-width: 100%;
  }

  .panel-topbar-badges {
    width: 100%;
    flex-wrap: wrap;
  }

  .panel-topbar > #themeToggle {
    justify-self: start;
  }

  .panel-sidebar .btn {
    flex: 0 0 auto;
  }
}

/* Biblioteca fidelity pass */
.library-pro-shell .panel-sidebar {
  width: 260px;
  min-width: 260px;
  padding: 0.7rem 0.65rem 0.6rem;
  background: #ffffff;
  border-right: 1px solid #e8edf6;
}

.library-pro-shell .sidebar-brand {
  margin-bottom: 0.5rem !important;
}

.library-pro-shell .sidebar-brand-wrap {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  border: 2px solid #4f46e5;
  background: #ffffff;
  padding: 0.25rem;
}

.library-pro-shell .sidebar-logo.sidebar-logo-pro {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
}

.library-pro-shell .sidebar-nav .nav-link {
  border-radius: 0.62rem;
  padding: 0.48rem 0.62rem;
  font-size: 0.89rem;
}

.library-pro-shell .sidebar-nav-pro .nav-link {
  font-size: 0.88rem;
}

.library-pro-shell .sidebar-nav-pro .nav-link i {
  width: 1rem;
  text-align: center;
}

.library-pro-shell .panel-content {
  padding: 0.7rem 0.85rem 0.95rem;
}

.library-pro-shell .library-workspace {
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 0.7rem;
}

.library-pro-shell .library-pro-doc,
.library-pro-shell .library-pane,
.library-pro-shell .library-pane-center .card {
  border-radius: 0.88rem;
  border-color: #e5ebf5 !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.07) !important;
}

.library-pro-shell .library-pro-doc .card-body,
.library-pro-shell .library-pane .card-body {
  padding: 0.88rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-item {
  border-radius: 0.78rem;
  padding: 0.42rem 0.5rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-item .fw-semibold {
  font-size: 0.96rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-item small {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.library-pro-shell .library-pro-editor-row .form-control,
.library-pro-shell .library-pro-editor-row .form-select {
  min-height: 2.15rem;
  border-radius: 0.66rem;
}

.library-pro-shell .ql-toolbar {
  border-top-left-radius: 0.72rem;
  border-top-right-radius: 0.72rem;
}

.library-pro-shell .ql-container {
  border-bottom-left-radius: 0.72rem;
  border-bottom-right-radius: 0.72rem;
}

.library-pro-shell .library-pro-right .library-pane {
  padding: 0.15rem;
}

.library-pro-shell .library-pro-right .library-pane .small {
  line-height: 1.35;
}

.library-pro-shell .library-pro-doc-title {
  font-size: clamp(1.18rem, 1.4vw, 1.58rem);
  letter-spacing: -0.02em;
}

.library-pro-shell .library-pro-chip {
  font-size: 0.68rem;
  padding: 0.18rem 0.48rem;
}

.library-pro-shell .library-pro-meta-row {
  font-size: 0.71rem;
  gap: 0.45rem;
}

@media (min-width: 1200px) {
  .library-pro-shell #libraryWorkspace.library-content-focused #libraryEditorSection {
    min-height: calc(100vh - 170px);
  }

  .library-pro-shell #libraryWorkspace.library-content-focused #libraryEditorSection > .card {
    height: 100%;
  }

  .library-pro-shell #libraryWorkspace.library-content-focused #libraryEditorSection > .card > .card-body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  .library-pro-shell #libraryWorkspace.library-content-focused #libraryHighlightEditorWrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .library-pro-shell #libraryWorkspace.library-content-focused .library-quill-editor {
    height: 100% !important;
    min-height: 340px;
    display: flex;
    flex-direction: column;
  }

  .library-pro-shell #libraryWorkspace.library-content-focused .library-quill-editor .ql-toolbar {
    flex: 0 0 auto;
  }

  .library-pro-shell #libraryWorkspace.library-content-focused .library-quill-editor .ql-container {
    flex: 1 1 auto;
    min-height: 0;
  }
}

.library-pro-shell .panel-topbar.library-pro-topbar {
  padding: 0.48rem 0.82rem;
  gap: 0.65rem;
}

.library-pro-shell .library-pro-search-wrap {
  height: 36px;
  border-radius: 0.62rem;
}

.library-pro-shell .library-pro-search-input {
  font-size: 0.85rem;
}

.library-pro-shell .sidebar-nav-pro .nav-link {
  font-size: 0.86rem;
  padding: 0.45rem 0.56rem;
}

.library-pro-shell .library-pro-stat-item {
  font-size: 0.81rem;
  padding: 0.37rem 0;
}

.library-pro-shell #libraryVersions .library-version-item {
  border-radius: 0.74rem;
}

/* Biblioteca print parity v2 */
.library-pro-shell .sidebar-brand-wrap {
  gap: 0.55rem;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.05rem 0.2rem;
  width: 100%;
  white-space: nowrap;
}

.library-pro-shell .sidebar-logo.sidebar-logo-pro {
  width: 38px;
  height: 38px;
  max-width: 38px;
  max-height: 38px;
  border: 2px solid #4f46e5;
  border-radius: 0.8rem;
  padding: 0.18rem;
  background: #ffffff;
}

.sidebar-brand-text {
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  color: #4f46e5;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.library-pro-new-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.library-tree-action-btn {
  color: #64748b;
}

.library-tree-action-btn:hover {
  color: #4f46e5;
}

.library-tree-action-btn.is-disabled,
.library-tree-action-btn:disabled {
  color: #cbd5e1;
  pointer-events: none;
}

.library-node-editor-modal {
  border-radius: 1.1rem !important;
  padding: 1.15rem 1.15rem 1rem !important;
  border: 1px solid #e6ebf5 !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14) !important;
}

.library-node-editor-title {
  text-align: left !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  padding: 0 0 0.35rem !important;
}

.library-node-editor-html {
  margin: 0 !important;
  padding: 0 !important;
}

.library-node-editor-shell {
  display: grid;
  gap: 0.9rem;
}

.library-node-editor-hero {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  border: 1px solid #dbe3ff;
}

.library-node-editor-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: #4f46e5;
  color: #ffffff;
  flex: 0 0 auto;
}

.library-node-editor-subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
}

.library-node-editor-note {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.12rem;
}

.library-node-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.9rem;
}

.library-node-editor-field {
  display: grid;
  gap: 0.35rem;
}

.library-node-editor-field-wide {
  grid-column: 1 / -1;
}

.library-node-editor-field .form-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.library-node-editor-input.swal2-input,
.library-node-editor-input.swal2-select {
  width: 100% !important;
  height: 2.75rem !important;
  margin: 0 !important;
  border-radius: 0.85rem !important;
  border: 1px solid #dbe3ff !important;
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  padding: 0.75rem 0.9rem !important;
  font-size: 0.92rem !important;
}

.library-node-editor-input.swal2-input:focus,
.library-node-editor-input.swal2-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12) !important;
}

.library-node-editor-help {
  font-size: 0.76rem;
  color: #64748b;
}

.library-node-editor-actions {
  margin: 1rem 0 0 !important;
  padding: 0 !important;
  justify-content: flex-end !important;
  gap: 0.55rem !important;
}

.library-node-editor-actions .btn {
  min-width: 108px;
  border-radius: 0.8rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
}

.library-flashcard-editor-modal {
  border-radius: 1.35rem !important;
  padding: 1rem 1rem 0.25rem !important;
}

.library-flashcard-editor {
  padding-top: 0.25rem;
}

.library-flashcard-editor-head {
  margin-bottom: 0.9rem;
}

.library-flashcard-editor-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-flashcard-editor-copy {
  margin: 0.65rem 0 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

.library-flashcard-editor-status {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border-radius: 0.95rem;
  padding: 0.8rem 0.9rem;
  margin-bottom: 0.95rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.library-flashcard-editor-status i {
  font-size: 0.95rem;
  margin-top: 0.1rem;
}

.library-flashcard-editor-status-detail {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  opacity: 0.9;
}

.library-flashcard-editor-status.is-ai {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.library-flashcard-editor-status.is-fallback {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.library-flashcard-editor-status.is-unavailable {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.library-flashcard-suggestion-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.95rem;
}

.library-flashcard-suggestion-wrap {
  margin-bottom: 0.95rem;
}

.library-flashcard-suggestion-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.55rem;
}

.library-flashcard-suggestion-head strong {
  font-size: 0.88rem;
  color: #1e293b;
}

.library-flashcard-suggestion-head small {
  font-size: 0.74rem;
  color: #64748b;
}

.library-flashcard-suggestion-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  border: 1px solid #dbe3ff;
  border-radius: 0.95rem;
  background: #f8fbff;
  color: #1e293b;
  padding: 0.8rem 0.9rem;
  text-align: left;
  transition: all 150ms ease;
}

.library-flashcard-suggestion-check {
  width: 1rem;
  height: 1rem;
  margin-bottom: 0.25rem;
  accent-color: #2563eb;
}

.library-flashcard-suggestion-btn strong {
  font-size: 0.88rem;
  line-height: 1.35;
}

.library-flashcard-suggestion-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.library-flashcard-suggestion-btn.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.library-flashcard-suggestion-btn.is-selected:not(.is-active) {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.library-flashcard-suggestion-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.library-flashcard-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.library-flashcard-editor-field {
  min-width: 0;
}

.library-flashcard-editor-field.is-wide {
  grid-column: 1 / -1;
}

.library-node-editor-input.library-flashcard-editor-textarea.swal2-textarea {
  width: 100% !important;
  min-height: 8rem !important;
  height: 8rem !important;
  margin: 0 !important;
  border-radius: 0.95rem !important;
  border: 1px solid #dbe3ff !important;
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  padding: 0.9rem 1rem !important;
  font-size: 0.96rem !important;
  line-height: 1.5 !important;
  resize: vertical !important;
}

.library-node-editor-input.library-flashcard-editor-textarea.swal2-textarea.is-answer {
  min-height: 9.5rem !important;
  height: 9.5rem !important;
}

.library-node-editor-input.library-flashcard-editor-textarea.swal2-textarea:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12) !important;
}

@media (max-width: 768px) {
  .library-flashcard-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.library-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.library-pro-meta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: #64748b;
  padding: 0;
}

.library-pro-meta-button.is-active {
  color: #d97706;
}

.library-pro-meta-button:hover {
  color: #4f46e5;
}

.library-header-favorite-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #dbe3ff;
  border-radius: 0.85rem;
  background: #ffffff;
  color: #334155;
  font-size: 0.92rem;
}

.library-header-favorite-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: #4f46e5;
}

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

  .library-node-editor-actions {
    justify-content: stretch !important;
  }

  .library-node-editor-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.library-pro-shell .library-pro-side-tree .library-tree-item {
  border: none;
  border-radius: 0.45rem;
  padding: 0.25rem 0.32rem;
  margin-bottom: 0.08rem;
  background: transparent;
  box-shadow: none !important;
  width: auto;
  position: relative;
  cursor: grab;
}

.library-pro-shell .library-pro-side-tree .library-tree-item:hover,
.library-pro-shell .library-pro-side-tree .library-tree-item.active {
  background: #eef2ff;
  border-color: transparent;
}

.library-pro-shell .library-pro-side-tree .library-tree-item.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.library-pro-shell .library-pro-side-tree .library-tree-item.drag-over-inside {
  background: #dbeafe;
}

.library-pro-shell .library-pro-side-tree .library-tree-item.drag-over-before::before,
.library-pro-shell .library-pro-side-tree .library-tree-item.drag-over-after::after {
  content: '';
  position: absolute;
  left: 0.18rem;
  right: 0.18rem;
  height: 2px;
  border-radius: 999px;
  background: #2563eb;
}

.library-pro-shell .library-pro-side-tree .library-tree-item.drag-over-before::before {
  top: -1px;
}

.library-pro-shell .library-pro-side-tree .library-tree-item.drag-over-after::after {
  bottom: -1px;
}

.library-pro-shell .library-pro-side-tree .library-tree-item .fw-semibold {
  font-size: 0.82rem;
  font-weight: 600 !important;
}

.library-pro-shell .library-pro-side-tree .library-tree-item-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.library-pro-shell .library-pro-side-tree .library-tree-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-pro-shell .library-pro-side-tree .library-tree-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.04rem 0.32rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  background: #eef2ff;
  border: 1px solid #dbe3ff;
  flex: 0 0 auto;
}

.library-pro-shell .library-pro-side-tree .library-tree-item small {
  font-size: 0.64rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-item-icon {
  width: 1.02rem;
  height: 1.02rem;
  border-radius: 0.32rem;
  font-size: 0.64rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-chip {
  font-size: 0.61rem;
  width: 1.5rem;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  line-height: 1;
  flex: 0 0 1.5rem;
}

.library-pro-shell .library-pro-side-tree .library-tree-chip i {
  font-size: 0.68rem;
  display: block;
  line-height: 1;
}

.library-pro-shell .library-editor-fields {
  display: none;
}

.library-pro-shell .library-pro-editor-row .ql-toolbar {
  margin-top: 0.22rem;
}

.library-pro-shell .library-pro-right .library-pane h2,
.library-pro-shell .library-pro-right .library-pane .h6 {
  font-size: 0.73rem;
  letter-spacing: 0.08em;
}

.library-version-row {
  cursor: pointer;
}

.library-version-author {
  font-size: 0.72rem;
  color: #475569;
  white-space: nowrap;
}

/* Right column card parity */
.library-pro-shell .library-pro-right {
  display: grid;
  gap: 0.72rem;
  align-content: start;
}

.library-pro-shell .library-pro-right .library-pane {
  background: #ffffff !important;
  border: 1px solid #e7ecf6 !important;
  border-radius: 1rem !important;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06) !important;
  padding: 0.86rem 0.9rem !important;
}

.library-pro-shell .library-pro-right .library-pane h2,
.library-pro-shell .library-pro-right .library-pane .h6 {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a96aa;
  margin-bottom: 0.65rem !important;
}

.library-pro-shell .library-pro-right .library-pane .small,
.library-pro-shell .library-pro-right .library-pane p.small {
  font-size: 0.79rem;
  color: #5d6b82;
}

.library-pro-shell .library-pro-right .library-pro-stat-item {
  padding: 0.46rem 0;
  border-bottom: 1px dashed #e6ebf5;
  font-size: 0.84rem;
}

.library-pro-shell .library-pro-right .library-pro-stat-item:last-of-type {
  border-bottom: none;
}

.library-pro-shell .library-pro-right .library-pro-stat-item strong {
  color: #2563eb;
  font-weight: 700;
}

.library-pro-shell .library-pro-right .btn-outline-primary {
  border-color: #9ec5fe;
  color: #2563eb;
  border-radius: 0.56rem;
  font-weight: 600;
}

.library-pro-shell .library-pro-right .btn-outline-primary:hover {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.library-pro-shell .library-pro-right .library-content-tags {
  gap: 0.35rem;
}

.library-pro-shell .library-pro-right .library-tag-chip {
  font-size: 0.67rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
}

.library-pro-shell .library-pro-right #libraryVersions {
  gap: 0.5rem !important;
}

.library-pro-shell .library-pro-right .library-version-item {
  border: 1px solid #e7ecf6;
  border-radius: 0.86rem;
  padding: 0.62rem 0.65rem;
  box-shadow: none;
}

.library-pro-shell .library-pro-right .library-version-content strong {
  font-size: 0.82rem;
}

.library-pro-shell .library-pro-right .library-version-content small {
  font-size: 0.72rem;
}

.library-pro-shell .library-pro-right .library-version-author {
  font-size: 0.74rem;
  color: #6b7280;
}

/* Remove decorative background to match reference */
.library-pro-shell .library-page-shell::before {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* Center content: remove visible borders to match reference */
.library-pro-shell .library-pro-main .library-pro-doc,
.library-pro-shell .library-pro-main .library-pane,
.library-pro-shell .library-pro-main .library-pane-center .card,
.library-pro-shell .library-pro-main .library-pane-center .card-body {
  border: none !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04) !important;
}

.library-pro-shell .library-pro-main .ql-toolbar,
.library-pro-shell .library-pro-main .ql-container {
  border-color: #eef2f7 !important;
}

/* Single center panel like reference */
.library-pro-shell .library-pro-main {
  background: #ffffff;
  border: 1px solid #e7ecf6;
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 0.8rem 0.9rem;
}

.library-pro-shell .library-pro-main .library-pro-doc,
.library-pro-shell .library-pro-main .library-pro-editor-row,
.library-pro-shell .library-pro-main .library-pro-editor-row .card,
.library-pro-shell .library-pro-main .library-pro-editor-row .card-body {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.library-pro-shell .library-pro-main .library-pro-doc {
  margin-bottom: 0.6rem !important;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #eef2f7 !important;
}

.library-pro-shell .library-pro-main .library-pro-editor-row {
  margin-bottom: 0 !important;
}

.library-pro-shell .library-pro-main .library-editor-footer {
  border-top: 1px solid #eef2f7;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.library-content-table-wrap {
  overflow: hidden;
  border-radius: 0.9rem;
  border: 1px solid #e7ecf6;
}

.library-content-table {
  margin: 0;
  background: #ffffff;
}

.library-content-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #e7ecf6;
  padding: 0.45rem 0.65rem;
}

.library-content-row {
  cursor: pointer;
}

.library-content-row td {
  padding: 0.32rem 0.65rem;
  vertical-align: middle;
  border-color: #eef2f7;
  line-height: 1.05;
}

.library-content-row:hover {
  background: #f8fafc;
}

.library-content-title-cell {
  min-width: 0;
}

.library-content-row-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-content-node,
.library-content-status,
.library-content-visibility {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.08rem 0.35rem;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.library-content-node {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #dbe3ff;
}

.library-content-status {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.library-content-visibility {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  min-width: 28px;
  justify-content: center;
}

.library-content-visibility i,
.library-pro-meta-row #libraryVisibilityDisplay i {
  font-size: 0.72rem;
}

.library-content-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.library-table-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.05rem 0.32rem;
  font-size: 0.58rem;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #dbe3ff;
}

.library-content-table tbody tr {
  height: 30px;
}

.library-table-tag.is-muted {
  color: #64748b;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.review-layout-grid {
  align-items: start;
}

.library-pro-shell .flashcards-page .library-workspace.review-layout-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
}

@media (max-width: 1500px) {
  .library-pro-shell .flashcards-page .library-workspace.review-layout-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.review-session-box .progress {
  height: 10px;
}

.review-card {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 0.9rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme='dark'] .review-card {
  background: rgba(18, 30, 48, 0.82);
  border-color: rgba(148, 163, 184, 0.2);
}

.review-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.22rem 0.58rem;
  margin-right: 0.35rem;
}

.review-highlight-text {
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 0 0 0.8rem;
  padding-left: 0.8rem;
  border-left: 4px solid #f59e0b;
}

.review-context-box {
  border: 1px dashed rgba(100, 116, 139, 0.45);
  border-radius: 0.7rem;
  padding: 0.75rem;
  background: rgba(241, 245, 249, 0.75);
  margin-bottom: 0.9rem;
  white-space: pre-wrap;
}

html[data-theme='dark'] .review-context-box {
  background: rgba(15, 23, 42, 0.65);
}

.review-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.review-feedback-grid button:last-child {
  grid-column: span 2;
}

.flashcards-page #flashcardFocusToggleBtn {
  --bs-btn-color: #64748b;
  --bs-btn-border-color: #cbd5e1;
  --bs-btn-hover-color: #334155;
  --bs-btn-hover-bg: #f1f5f9;
  --bs-btn-hover-border-color: #94a3b8;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #334155;
  --bs-btn-active-border-color: #334155;
}

.flashcards-page #flashcardFocusToggleBtn.active {
  color: #ffffff;
  background-color: #334155;
  border-color: #334155;
}

.admin-enterprise-page {
  display: grid;
  gap: 0.9rem;
}

.admin-enterprise-hero {
  background: linear-gradient(135deg, #102a43, #1d4ed8 54%, #0ea5e9);
  color: #ffffff;
  border-radius: 1rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 0.8rem;
  align-items: end;
}

.admin-enterprise-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #dbeafe;
  font-weight: 700;
}

.admin-enterprise-hero h1 {
  margin: 0;
  font-size: 1.45rem;
}

.admin-enterprise-hero p {
  margin: 0.25rem 0 0;
  color: rgba(255, 255, 255, 0.88);
}

.admin-enterprise-hero-actions {
  display: grid;
  gap: 0.5rem;
}

.admin-enterprise-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0.8rem;
}

.admin-enterprise-sidebar {
  background: #ffffff;
  border: 1px solid #dbe6f3;
  border-radius: 1rem;
  padding: 0.7rem;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

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

.admin-enterprise-sidebar h2 {
  font-size: 0.9rem;
  margin: 0;
}

.admin-enterprise-module-nav {
  display: grid;
  gap: 0.35rem;
  max-height: 64vh;
  overflow: auto;
}

.admin-module-link {
  border: 1px solid #d5dfed;
  background: #f8fbff;
  color: #1e3a5f;
  border-radius: 0.7rem;
  text-align: left;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-module-link.is-active {
  background: #dbeafe;
  border-color: #93c5fd;
}

.admin-enterprise-sidebar-foot {
  border-top: 1px dashed #dbe6f3;
  padding-top: 0.5rem;
  display: grid;
  gap: 0.3rem;
  color: #5f6c80;
}

.admin-favorite-modules {
  font-size: 0.75rem;
}

.admin-enterprise-content {
  display: grid;
  gap: 0.75rem;
}

.admin-pane-card {
  background: #ffffff;
  border: 1px solid #dbe6f3;
  border-radius: 1rem;
  padding: 0.85rem;
}

.admin-pane-card.is-hidden {
  display: none;
}

.admin-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.admin-pane-head h2 {
  margin: 0;
  font-size: 1rem;
}

.admin-inline-actions {
  display: flex;
  gap: 0.45rem;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.admin-kpi-card {
  border: 1px solid #dbe6f3;
  border-radius: 0.8rem;
  padding: 0.55rem;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  display: grid;
  gap: 0.1rem;
}

.admin-kpi-card strong {
  font-size: 1rem;
  color: #0f172a;
}

.admin-kpi-card span {
  color: #64748b;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-settings-accordion,
.admin-providers-grid,
.admin-templates-grid,
.admin-maintenance-grid,
.admin-audit-list {
  display: grid;
  gap: 0.5rem;
}

.admin-setting-group {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.5rem;
}

.admin-setting-group summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
}

.admin-setting-body {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.5rem;
}

.admin-setting-row {
  display: grid;
  gap: 0.2rem;
}

.admin-setting-row span {
  font-size: 0.74rem;
  color: #64748b;
}

.admin-providers-grid,
.admin-templates-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-provider-card,
.admin-template-card {
  border: 1px solid #dbe6f3;
  border-radius: 0.75rem;
  padding: 0.6rem;
  background: #f8fbff;
}

.admin-provider-card h3,
.admin-template-card h3 {
  margin: 0;
  font-size: 0.86rem;
}

.admin-provider-card p,
.admin-template-card p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.75rem;
}

.admin-template-card small {
  color: #5f6c80;
  display: block;
  margin-top: 0.25rem;
}

.admin-maintenance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-maintenance-grid h3 {
  font-size: 0.84rem;
  margin: 0 0 0.3rem;
}

.admin-simple-list,
.admin-audit-list {
  margin: 0;
  padding-left: 1rem;
  color: #334155;
  font-size: 0.8rem;
}

.admin-enterprise-page.is-collapsed .admin-enterprise-shell {
  grid-template-columns: 82px minmax(0, 1fr);
}

.admin-enterprise-page.is-collapsed .admin-module-link {
  text-indent: -999px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.admin-enterprise-page.is-collapsed .admin-module-link::after {
  content: '\2022';
  text-indent: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
}

@media (max-width: 1200px) {
  .admin-enterprise-hero {
    grid-template-columns: 1fr;
  }

  .admin-enterprise-shell {
    grid-template-columns: 1fr;
  }

  .admin-kpi-grid,
  .admin-providers-grid,
  .admin-templates-grid,
  .admin-maintenance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-inline-actions {
    flex-wrap: wrap;
  }

  .admin-kpi-grid,
  .admin-providers-grid,
  .admin-templates-grid,
  .admin-maintenance-grid {
    grid-template-columns: 1fr;
  }
}

.flashcards-page #flashcardFocusToggleBtn.active:hover {
  color: #ffffff;
  background-color: #1e293b;
  border-color: #1e293b;
}

.reviews-page #reviewFocusToggleBtn {
  --bs-btn-color: #64748b;
  --bs-btn-border-color: #cbd5e1;
  --bs-btn-hover-color: #334155;
  --bs-btn-hover-bg: #f1f5f9;
  --bs-btn-hover-border-color: #94a3b8;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #334155;
  --bs-btn-active-border-color: #334155;
}

.reviews-page #reviewFocusToggleBtn.active {
  color: #ffffff;
  background-color: #334155;
  border-color: #334155;
}

.reviews-page #reviewFocusToggleBtn.active:hover {
  color: #ffffff;
  background-color: #1e293b;
  border-color: #1e293b;
}

body.review-focus-mode .reviews-page #reviewFocusToggleBtn {
  color: #ffffff !important;
  background-color: #334155 !important;
  border-color: #334155 !important;
}

body.review-focus-mode .reviews-page #reviewFocusToggleBtn:hover {
  color: #ffffff !important;
  background-color: #1e293b !important;
  border-color: #1e293b !important;
}

.review-memory-map {
  display: grid;
  gap: 0.4rem;
}

.review-memory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0.6rem;
  padding: 0.38rem 0.52rem;
}

.review-memory-item.safe {
  background: rgba(34, 197, 94, 0.18);
}

.review-memory-item.warn {
  background: rgba(245, 158, 11, 0.2);
}

.review-memory-item.risk {
  background: rgba(239, 68, 68, 0.18);
}

.review-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 0.26rem;
}

.review-heat-cell {
  width: 100%;
  padding-top: 100%;
  border-radius: 3px;
  display: block;
  background: rgba(148, 163, 184, 0.2);
}

.review-heat-cell.l1 { background: #d1fae5; }
.review-heat-cell.l2 { background: #86efac; }
.review-heat-cell.l3 { background: #22c55e; }
.review-heat-cell.l4 { background: #15803d; }

html[data-theme='dark'] .review-heat-cell.l1 { background: #14532d; }
html[data-theme='dark'] .review-heat-cell.l2 { background: #166534; }
html[data-theme='dark'] .review-heat-cell.l3 { background: #15803d; }
html[data-theme='dark'] .review-heat-cell.l4 { background: #22c55e; }

.review-achievement-list {
  padding-left: 1.1rem;
}

body.review-focus-mode .panel-sidebar,
body.review-focus-mode #reviewRightPanel,
body.review-focus-mode .panel-topbar,
body.review-focus-mode .library-pro-breadcrumb {
  display: none !important;
}

body.review-focus-mode.library-pro-shell {
  grid-template-columns: 1fr !important;
}

body.review-focus-mode .flashcards-page .review-right-panel {
  display: none !important;
}

body.review-focus-mode .flashcards-page .library-workspace.review-layout-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* ===== FLASHCARD STUDY SYSTEM (fc-*) ===== */

@keyframes fc-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fc-bar-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fc-footer-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fc-answer-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fc-mem-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Session Bar */
.fc-session-bar {
  display: none;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border-bottom: 1.5px solid #e6ebf5;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.07);
  padding: 0.72rem 1.25rem;
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  z-index: 300;
  animation: fc-bar-in 0.3s ease;
}

.fc-sb-left { flex: 0 0 auto; }
.fc-sb-deck-info { display: grid; gap: 0.1rem; }
.fc-sb-meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.fc-sb-deck-name { font-size: 0.95rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.fc-sb-subject { font-size: 0.75rem; color: #64748b; }

.fc-sb-center { flex: 1; min-width: 0; max-width: 300px; }
.fc-sb-progress-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}
.fc-sb-progress-text { white-space: nowrap; }
.fc-sb-bar-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.fc-sb-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 450ms cubic-bezier(0.4, 0, 0.2, 1);
}
.fc-sb-percent { font-size: 0.8rem; font-weight: 700; color: #2563eb; white-space: nowrap; }

.fc-sb-metrics { display: flex; align-items: center; gap: 1.2rem; flex: 0 0 auto; }
.fc-sb-metric {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.fc-sb-metric i { color: #94a3b8; font-size: 0.88rem; }
.fc-sb-metric--xp { color: #d97706; }
.fc-sb-metric--xp i { color: #f59e0b; }
.fc-sb-delta {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  color: #15803d;
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
  font-size: 0.67rem;
  font-weight: 800;
  margin-left: 0.2rem;
}
.fc-end-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.42rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
  flex-shrink: 0;
}
.fc-end-btn:hover { border-color: #fca5a5; color: #dc2626; background: #fef2f2; }

/* Tools Shell */
.fc-tools-shell { padding: 0.6rem 0; margin-bottom: 0.8rem; }
.fc-tools-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.55rem; }
.fc-tools-search { display: flex; align-items: center; gap: 0.45rem; flex: 1; min-width: 0; flex-wrap: wrap; }

.fc-search-input,
.fc-select {
  border: 1.5px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.4rem 0.72rem;
  font-size: 0.84rem;
  background: #ffffff;
  color: #334155;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  outline: none;
  font-family: inherit;
}
.fc-search-input { flex: 1; min-width: 180px; }
.fc-select { min-width: 130px; cursor: pointer; }
.fc-search-input:focus,
.fc-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.fc-tools-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.fc-tools-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.4rem 0.78rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}
.fc-tools-btn:hover { border-color: #cbd5e1; background: #f8fafc; color: #0f172a; }
.fc-tools-btn--primary { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.fc-tools-btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #ffffff; }
.fc-tools-btn .spin,
.fc-start-btn .spin {
  animation: memorizza-spin 0.9s linear infinite;
}
.fc-tools-export-group { display: flex; border: 1.5px solid #e2e8f0; border-radius: 0.65rem; overflow: hidden; }
.fc-tools-export-group .fc-tools-btn { border: none; border-radius: 0; border-right: 1px solid #e2e8f0; }
.fc-tools-export-group .fc-tools-btn:last-child { border-right: none; }
.fc-stats-strip { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.fc-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.76rem;
  background: #f1f5f9;
  color: #475569;
}
.fc-stat-pill--pending { background: #eff6ff; color: #1d4ed8; }
.fc-stat-pill--mastered { background: #f0fdf4; color: #15803d; }
.fc-stat-pill--hard { background: #fff7ed; color: #c2410c; }

@keyframes memorizza-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Study Main Layout */
.fc-study-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.fc-card-column { display: grid; gap: 0; }

/* Intro Card */
.fc-intro-card {
  background: #ffffff;
  border: 1px solid #e6ebf5;
  border-radius: 1.5rem;
  padding: 3.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.05);
  animation: fc-in 0.4s ease;
}
.fc-intro-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c3aed;
  margin-bottom: 0.6rem;
}
.fc-intro-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; color: #0f172a; margin-bottom: 0.5rem; line-height: 1.15; }
.fc-intro-copy { color: #64748b; font-size: 0.95rem; margin-bottom: 2rem; line-height: 1.6; }
.fc-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  border: none;
  border-radius: 1rem;
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  font-family: inherit;
}
.fc-start-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(37, 99, 235, 0.4); }
.fc-start-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* Flashcard */
.fc-card {
  background: #ffffff;
  border: 1px solid #e6ebf5;
  border-radius: 1.5rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  padding: 2rem;
  animation: fc-in 0.35s ease;
  display: grid;
  gap: 1.5rem;
}
.fc-card-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.fc-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 150ms ease;
  flex-shrink: 0;
  font-family: inherit;
}
.fc-nav-btn:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.fc-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.fc-card-position { font-size: 0.82rem; font-weight: 700; color: #64748b; white-space: nowrap; }

.fc-card-face { min-height: 280px; display: grid; align-content: start; gap: 1.5rem; }
.fc-card-badges { display: flex; align-items: center; justify-content: center; }
.fc-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.32rem 0.95rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}
.fc-card-question {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.55;
  text-align: center;
  padding: 0 0.5rem;
}
.fc-card-answer { animation: fc-answer-in 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.fc-answer-divider { height: 1px; background: linear-gradient(90deg, transparent, #e2e8f0, transparent); margin-bottom: 1.25rem; }
.fc-answer-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; text-align: center; margin-bottom: 0.7rem; }
.fc-card-answer-text {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 700;
  color: #1e3a8a;
  line-height: 1.6;
  text-align: center;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(124, 58, 237, 0.06));
  border-radius: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

/* Show Answer Button */
.fc-card-cta { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.fc-show-answer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border: none;
  border-radius: 1rem;
  padding: 0.88rem 2.5rem;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.fc-show-answer-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}
.fc-show-answer-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37, 99, 235, 0.38); }
.fc-shortcut-label { font-size: 0.72rem; color: #94a3b8; margin: 0; }

/* Memory Buttons */
.fc-memory-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.55rem; animation: fc-mem-in 0.4s ease; }
.fc-mem-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 1.5px solid transparent;
  border-radius: 1.1rem;
  padding: 1rem 0.45rem;
  cursor: pointer;
  background: #ffffff;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 180ms ease;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  font-family: inherit;
}
.fc-mem-btn:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12); }
.fc-mem-btn:active { transform: translateY(-1px); }
.fc-mem-emoji { font-size: 1.5rem; line-height: 1; display: block; }
.fc-mem-num { font-size: 0.62rem; font-weight: 900; opacity: 0.55; margin-top: -0.1rem; }
.fc-mem-label { font-size: 0.72rem; font-weight: 800; text-align: center; line-height: 1.25; }
.fc-mem-sub { font-size: 0.62rem; font-weight: 500; text-align: center; opacity: 0.7; line-height: 1.3; }
.fc-mem-very-easy { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.fc-mem-easy      { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.fc-mem-medium    { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
.fc-mem-hard      { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.fc-mem-forgot    { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.fc-mem-very-easy:hover { box-shadow: 0 12px 26px rgba(22, 101, 52, 0.15); }
.fc-mem-easy:hover      { box-shadow: 0 12px 26px rgba(30, 64, 175, 0.15); }
.fc-mem-hard:hover      { box-shadow: 0 12px 26px rgba(146, 64, 14, 0.15); }
.fc-mem-forgot:hover    { box-shadow: 0 12px 26px rgba(153, 27, 27, 0.15); }

/* Card Footer Nav */
.fc-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 0.6rem; border-top: 1px solid #f1f5f9; }
.fc-footer-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 0.55rem;
  transition: all 150ms ease;
  font-family: inherit;
}
.fc-footer-nav-btn:hover:not(:disabled) { color: #2563eb; background: #eff6ff; }
.fc-footer-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.fc-keyboard-hint { font-size: 0.7rem; color: #94a3b8; text-align: center; }

/* Session Summary */
.fc-summary-card {
  background: #ffffff;
  border: 1px solid #e6ebf5;
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.05);
  animation: fc-in 0.4s ease;
}
.fc-summary-icon { font-size: 3.5rem; line-height: 1; margin-bottom: 1rem; }
.fc-summary-title { font-size: 1.8rem; font-weight: 900; color: #0f172a; margin-bottom: 0.5rem; }
.fc-summary-text { color: #64748b; margin-bottom: 1.5rem; font-size: 0.95rem; }
.fc-summary-meta { color: #64748b; font-size: 0.88rem; margin-bottom: 1.5rem; }
.fc-summary-actions { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

/* Context Sidebar */
.fc-context-sidebar {
  display: grid;
  gap: 0.8rem;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.fc-context-sidebar::-webkit-scrollbar { width: 4px; }
.fc-context-sidebar::-webkit-scrollbar-track { background: transparent; }
.fc-context-sidebar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 999px; }

.fc-ctx-section,
.fc-ai-section {
  background: #ffffff;
  border: 1px solid #e6ebf5;
  border-radius: 1.15rem;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.fc-ctx-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.82rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.01em;
}
.fc-ctx-header > i { color: #2563eb; font-size: 0.92rem; }
.fc-ctx-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: #f1f5f9;
  border-radius: 0.4rem;
  cursor: pointer;
  color: #64748b;
  transition: all 150ms ease;
  flex-shrink: 0;
  font-family: inherit;
}
.fc-ctx-toggle:hover { background: #e2e8f0; color: #334155; }
.fc-ctx-toggle i { transition: transform 220ms ease; }
.fc-ctx-toggle[aria-expanded="false"] i { transform: rotate(180deg); }

.fc-ctx-body { padding: 0.9rem; display: grid; gap: 0.75rem; }
.fc-ctx-source-row,
.fc-ctx-highlight-row { display: grid; gap: 0.35rem; }
.fc-ctx-row-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.fc-ctx-source-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  background: #f8fafc;
  border-radius: 0.7rem;
  border: 1px solid #f1f5f9;
}
.fc-ctx-source-item > i { color: #2563eb; font-size: 0.82rem; margin-top: 0.12rem; flex-shrink: 0; }
.fc-ctx-source-item strong { display: block; font-size: 0.8rem; font-weight: 700; color: #0f172a; line-height: 1.3; }
.fc-ctx-source-item small { display: block; font-size: 0.72rem; color: #64748b; margin-top: 0.08rem; }
.fc-ctx-highlight-text {
  font-size: 0.8rem;
  line-height: 1.7;
  color: #334155;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(124, 58, 237, 0.04));
  border-radius: 0.7rem;
  border: 1px solid rgba(37, 99, 235, 0.1);
  padding: 0.65rem 0.82rem;
  margin: 0;
}
.fc-ctx-value { font-size: 0.8rem; color: #475569; margin: 0; }
.fc-ctx-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.58rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
  border-radius: 0.7rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
  text-decoration: none;
  transition: all 150ms ease;
}
.fc-ctx-link-btn:hover { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; text-decoration: none; }

/* AI Actions */
.fc-ai-body { padding: 0.82rem; display: grid; gap: 0.6rem; }
.fc-ai-actions-list { display: grid; gap: 0.35rem; }
.fc-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.fc-ai-btn:hover { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.fc-ai-btn > i { color: #7c3aed; font-size: 0.82rem; flex-shrink: 0; }
.fc-ai-output {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.7rem 0.82rem;
  font-size: 0.8rem;
  line-height: 1.68;
  color: #334155;
  min-height: 2.5rem;
  white-space: pre-wrap;
}
.fc-ai-output:empty { display: none; }

/* Session Footer */
.fc-session-footer {
  position: fixed;
  bottom: 0;
  left: 260px;
  right: 0;
  z-index: 200;
  display: none;
  align-items: center;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1.5px solid #e6ebf5;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
  padding: 0.6rem 1.5rem;
  animation: fc-footer-in 0.3s ease;
}
.fc-sf-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  flex-shrink: 0;
}
.fc-sf-brand i { color: #2563eb; }
.fc-sf-stats { display: flex; align-items: center; gap: 1.2rem; flex: 1; flex-wrap: wrap; }
.fc-sf-stat { display: flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: #475569; white-space: nowrap; }
.fc-sf-stat strong { color: #0f172a; }
.fc-sf-xp { color: #d97706; font-weight: 800; }
.fc-sf-icon-success { color: #16a34a; }
.fc-timeline-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #2563eb;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.3rem 0;
  transition: color 150ms ease;
  flex-shrink: 0;
  font-family: inherit;
}
.fc-timeline-btn:hover { color: #1d4ed8; }

/* State-driven visibility */
body.fc-session-active .fc-tools-shell { display: none !important; }
body.fc-session-active .library-pro-topbar { display: none !important; }
body.fc-session-active .fc-session-bar { display: flex !important; }
body.fc-session-active .fc-session-footer { display: flex !important; }
body.fc-session-active .panel-content { padding-top: 72px !important; padding-bottom: 64px !important; }

/* Focus Mode */
body.flashcards-focus-mode .panel-sidebar { display: none !important; }
body.flashcards-focus-mode .fc-tools-shell { display: none !important; }
body.flashcards-focus-mode .fc-context-sidebar { display: none !important; }
body.flashcards-focus-mode .fc-session-bar { left: 0 !important; }
body.flashcards-focus-mode .fc-session-footer { left: 0 !important; }
body.flashcards-focus-mode .fc-study-main { grid-template-columns: minmax(0, 1fr) !important; }
body.flashcards-focus-mode .fc-card-column { max-width: 820px; margin: 0 auto; width: 100%; }

/* Responsive */
@media (max-width: 1100px) {
  .fc-study-main { grid-template-columns: minmax(0, 1fr); }
  .fc-context-sidebar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow-y: visible; }
}
@media (max-width: 900px) {
  .fc-session-footer { left: 0; }
  .fc-session-bar { left: 0; }
}
@media (max-width: 800px) {
  .fc-session-bar { flex-wrap: wrap; gap: 0.55rem; padding: 0.6rem 1rem; }
  .fc-sb-center { order: 4; flex: 0 0 100%; max-width: 100%; }
  .fc-sb-metrics { gap: 0.7rem; }
  .fc-memory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fc-context-sidebar { grid-template-columns: minmax(0, 1fr); }
  .fc-session-footer { flex-wrap: wrap; gap: 0.45rem; padding: 0.5rem 1rem; }
  .fc-sf-stats { gap: 0.65rem; }
}
@media (max-width: 600px) {
  .fc-session-bar { padding: 0.55rem 0.85rem; }
  .fc-sb-metrics { display: none; }
  .fc-card { padding: 1.25rem; gap: 1.2rem; }
  .fc-card-question { font-size: 1.2rem; padding: 0; }
  .fc-memory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-intro-card, .fc-summary-card { padding: 2rem 1.25rem; }
  .fc-tools-row { flex-direction: column; align-items: stretch; }
  .fc-tools-search { flex-direction: column; }
  .fc-tools-export-group { width: 100%; }
}


.knowledge-page-shell {
  display: grid;
  gap: 0.72rem;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0.72rem;
}

.knowledge-main,
.knowledge-side {
  border-radius: 0.95rem;
  border: 1px solid #e5ebf5;
}

.knowledge-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.knowledge-toolbar-subtitle {
  color: #64748b;
  font-size: 0.83rem;
}

.knowledge-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.knowledge-canvas-wrap {
  margin-top: 0.7rem;
  border: 1px solid #dbe5f5;
  border-radius: 0.9rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.08), transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(34, 197, 94, 0.08), transparent 45%),
    #f8fbff;
}

#knowledgeCanvas {
  width: 100%;
  min-height: 560px;
  display: block;
  cursor: grab;
}

#knowledgeCanvas:active {
  cursor: grabbing;
}

.knowledge-edge-label {
  font-size: 11px;
  fill: #475569;
  pointer-events: none;
  font-weight: 600;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 2px;
}

.knowledge-node-title {
  font-size: 12px;
  fill: #0f172a;
  font-weight: 700;
  pointer-events: none;
}

.knowledge-node-circle {
  transition: transform 140ms ease, stroke-width 140ms ease;
}

.knowledge-node-ring {
  transition: opacity 160ms ease;
}

.knowledge-node.is-selected .knowledge-node-circle {
  filter: drop-shadow(0 8px 12px rgba(37, 99, 235, 0.28));
}

.knowledge-side-section {
  padding-bottom: 0.78rem;
  margin-bottom: 0.78rem;
  border-bottom: 1px dashed #dbe3f5;
}

.knowledge-side-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.knowledge-status-legend {
  display: grid;
  gap: 0.35rem;
}

.knowledge-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  border: 1px solid #dbe3f5;
  width: fit-content;
}

.knowledge-status-chip strong {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 0.02rem 0.4rem;
  font-size: 0.68rem;
  line-height: 1.2;
}

.knowledge-status-chip.dominated {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.knowledge-status-chip.evolving {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.knowledge-status-chip.needs-review {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.knowledge-node-info {
  display: grid;
  gap: 0.42rem;
}

.knowledge-status-pill {
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.16rem 0.52rem;
  border: 1px solid transparent;
}

.knowledge-status-pill.dominated {
  color: #166534;
  border-color: #86efac;
  background: #dcfce7;
}

.knowledge-status-pill.evolving {
  color: #92400e;
  border-color: #fcd34d;
  background: #fef3c7;
}

.knowledge-status-pill.needs-review {
  color: #991b1b;
  border-color: #fca5a5;
  background: #fee2e2;
}

.knowledge-node-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.36rem;
}

.knowledge-node-kpis span {
  border: 1px solid #dbe3f5;
  background: #f8fbff;
  border-radius: 0.55rem;
  padding: 0.26rem 0.42rem;
  font-size: 0.72rem;
  color: #1e293b;
}

.knowledge-node-title-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.knowledge-node-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  display: inline-block;
}

.knowledge-node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.knowledge-node-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  color: #334155;
  border: 1px solid #d7e3f5;
  background: #f8fafc;
}

.knowledge-search-results {
  display: grid;
  gap: 0.4rem;
  max-height: 210px;
  overflow: auto;
}

.knowledge-search-item {
  text-align: left;
  border: 1px solid #dbe3f5;
  border-radius: 0.62rem;
  background: #ffffff;
  padding: 0.44rem 0.5rem;
  font-size: 0.78rem;
  color: #1e293b;
}

.knowledge-search-item:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.knowledge-search-item.is-static {
  background: #f8fafc;
  border-style: dashed;
}

@media (max-width: 1100px) {
  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  #knowledgeCanvas {
    min-height: 460px;
  }

  .knowledge-node-kpis {
    grid-template-columns: 1fr;
  }
}

body.review-focus-mode .panel-shell {
  grid-template-columns: 1fr;
}

body.review-focus-mode .panel-main {
  padding: 0;
}

body.review-focus-mode .panel-content {
  padding: 1.2rem;
}

@media (max-width: 991.98px) {
  .review-feedback-grid {
    grid-template-columns: 1fr;
  }

  .review-feedback-grid button:last-child {
    grid-column: auto;
  }
}

/* Dashboard phase 10 inspired layout */
.dashboard-v10-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: dashboardV10In 260ms ease-out;
}

.dashboard-v10-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(120deg, #f9f5eb 0%, #fff9ef 50%, #f4efe2 100%);
  border: 1px solid #eadfcb;
  border-radius: 20px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 1px 0 rgba(19, 31, 23, 0.04);
}

.dashboard-v10-head h1 {
  margin: 0;
  color: #1f2f24;
  font-size: 1.55rem;
  font-weight: 700;
}

.dashboard-v10-head p {
  margin: 0.35rem 0 0;
  color: #52614f;
}

.dashboard-v10-head-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 0.7rem;
}

.dashboard-v10-head-stats article {
  background: #fff;
  border: 1px solid #e6ddcc;
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  text-align: center;
  min-width: 95px;
}

.dashboard-v10-head-stats strong {
  display: block;
  color: #24352a;
  font-size: 1.42rem;
  line-height: 1.05;
  font-weight: 800;
}

.dashboard-v10-head-stats span {
  color: #6f7a70;
  font-size: 0.92rem;
}

.dashboard-v10-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1rem;
}

.dashboard-v10-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-v10-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e9e0d0;
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: 0 1px 0 rgba(19, 31, 23, 0.04);
}

.dashboard-v10-hero .kicker {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  color: #8a7757;
}

.dashboard-v10-hero h2 {
  margin: 0;
  color: #1f3026;
  font-size: 2rem;
  line-height: 1.05;
}

.dashboard-v10-hero p {
  margin: 0.45rem 0;
  color: #4e5f50;
  font-size: 1.07rem;
}

.dashboard-v10-hero-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.dashboard-v10-hero-chips span {
  display: block;
  background: #f6f1e5;
  border: 1px solid #e8ddca;
  border-radius: 10px;
  padding: 0.48rem 0.55rem;
  color: #5f6f60;
  font-size: 1rem;
}

.dashboard-v10-hero-cta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(145deg, #f1f8f0 0%, #eff6ea 100%);
  border: 1px solid #d8e4d3;
  border-radius: 14px;
  padding: 0.8rem;
  justify-content: flex-start;
}

.dashboard-v10-hero-cta p {
  margin: 0;
  font-size: 0.95rem;
  color: #6a7469;
}

.dashboard-v10-hero-cta a:not(.btn) {
  font-size: 0.84rem;
  color: #2c5f33;
  text-decoration: none;
  font-weight: 600;
}

.dashboard-v10-hero-cta .btn,
.side-plan-card .btn {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(92deg, #1f4fd8 0%, #3566f1 100%);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.62rem 0.8rem;
  box-shadow: 0 5px 14px rgba(45, 92, 230, 0.28);
}

.dashboard-v10-hero-cta .btn:hover,
.side-plan-card .btn:hover {
  filter: brightness(1.03);
  color: #ffffff;
}

.dashboard-v10-prioridades,
.dashboard-v10-progresso,
.dashboard-v10-atividades,
.dashboard-v10-semana,
.side-plan-card,
.side-list-card {
  background: #fff;
  border: 1px solid #eadfcf;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 1px 0 rgba(19, 31, 23, 0.04);
}

.dashboard-v10-prioridades h3,
.dashboard-v10-progresso h3,
.dashboard-v10-atividades h3,
.dashboard-v10-semana h3,
.side-plan-card h3,
.side-list-card h3 {
  margin: 0 0 0.75rem;
  color: #2a3a2f;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dashboard-v10-prioridades-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.prio-card {
  border: 1px solid #e7ddcc;
  border-radius: 14px;
  padding: 0.75rem;
  background: #fffdf7;
}

.prio-card .tag {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 0.16rem 0.45rem;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.prio-card h4 {
  margin: 0 0 0.15rem;
  color: #26372c;
  font-size: 2rem;
  line-height: 1;
}

.prio-card p {
  margin: 0;
  color: #4f6153;
  font-size: 1.32rem;
}

.prio-card small {
  display: block;
  margin: 0.3rem 0 0.45rem;
  color: #7a857b;
  font-size: 1rem;
}

.prio-card a {
  text-decoration: none;
  font-weight: 600;
  color: #1f5f2e;
  font-size: 1.15rem;
}

.prio-card.urgente .tag {
  background: #ffe5e3;
  color: #b73f3a;
}

.prio-card.atencao .tag {
  background: #fff2dc;
  color: #ad6b19;
}

.prio-card.em-dia .tag {
  background: #e7f8ea;
  color: #2f8546;
}

.prio-card.plano .tag {
  background: #ececfc;
  color: #4b4cb8;
}

.dashboard-v10-progresso-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.dashboard-v10-progresso-grid article {
  border: 1px solid #e6dece;
  border-radius: 12px;
  padding: 0.75rem;
}

.dashboard-v10-progresso-grid span {
  display: block;
  color: #6d766d;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}

.dashboard-v10-progresso-grid strong {
  display: block;
  color: #223428;
  font-size: 1.65rem;
}

.dashboard-v10-progresso-grid small {
  color: #6e7d6f;
  font-size: 0.95rem;
}

.dashboard-v10-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 265px;
  gap: 1rem;
}

.dashboard-v10-atividades ul,
.side-plan-card ul,
.side-list-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dashboard-v10-atividades li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px dashed #ece3d4;
  padding-bottom: 0.45rem;
}

.dashboard-v10-atividades li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dashboard-v10-atividades li span {
  color: #7f8a80;
  font-size: 0.78rem;
}

.dashboard-v10-atividades li p {
  margin: 0;
  color: #2d3d32;
  font-size: 0.95rem;
}

.dashboard-v10-atividades li strong {
  color: #2f7c3f;
  font-size: 0.9rem;
}

.dashboard-v10-atividades > a,
.dashboard-v10-semana > a,
.side-list-card > a {
  display: inline-block;
  margin-top: 0.55rem;
  color: #2a6f35;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 600;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.heat {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: #edf2ec;
}

.heat.l1 { background: #e8f2e6; }
.heat.l2 { background: #d9ebd6; }
.heat.l3 { background: #b9dcba; }
.heat.l4 { background: #8dc695; }
.heat.l5 { background: #61a86d; }

.dashboard-v10-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.side-plan-card li,
.side-list-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  border-bottom: 1px dashed #ebe1d1;
  padding-bottom: 0.45rem;
}

.side-plan-card li:last-child,
.side-list-card li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.side-plan-card li span,
.side-list-card li span {
  color: #324238;
  font-size: 0.97rem;
}

.side-plan-card li small,
.side-list-card li small {
  color: #7a847b;
  font-size: 0.9rem;
}

.side-plan-card .total {
  margin: 0.65rem 0;
  color: #5b675c;
  font-size: 1rem;
}

.side-plan-card .total strong {
  color: #1f3226;
}

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

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

  .dashboard-v10-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .dashboard-v10-head,
  .dashboard-v10-hero,
  .dashboard-v10-bottom-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dashboard-v10-head {
    display: flex;
    flex-direction: column;
  }

  .dashboard-v10-head-stats,
  .dashboard-v10-prioridades-grid,
  .dashboard-v10-progresso-grid,
  .dashboard-v10-side {
    grid-template-columns: 1fr;
  }
}

/* Dashboard v10 final fidelity pass (colors, cards, icons, fonts) */
.dashboard-v10-shell {
  --v10-bg-soft: #f8f4eb;
  --v10-border: #ebe2d2;
  --v10-text: #1f2f24;
  --v10-muted: #667267;
  --v10-link: #2e6b3f;
  --v10-link-hover: #1f5330;
  --v10-blue-a: #1f4fd8;
  --v10-blue-b: #3f70f2;
  font-family: "Manrope", "Segoe UI", sans-serif;
  animation: none;
}

.dashboard-v10-head,
.dashboard-v10-hero,
.dashboard-v10-prioridades,
.dashboard-v10-progresso,
.dashboard-v10-atividades,
.dashboard-v10-semana,
.side-plan-card,
.side-list-card {
  border-color: var(--v10-border);
  box-shadow: 0 1px 0 rgba(18, 30, 22, 0.04), 0 8px 18px rgba(31, 44, 33, 0.03);
}

.dashboard-v10-head {
  background: linear-gradient(128deg, #faf6ed 0%, #f7f1e4 58%, #f5efdf 100%);
}

.dashboard-v10-head h1 {
  color: var(--v10-text);
  font-size: 2.6rem;
  line-height: 1.04;
  font-weight: 800;
}

.dashboard-v10-head p {
  color: #435345;
  font-size: 1.1rem;
}

.dashboard-v10-head-stats article {
  border-color: #e4d9c5;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 #ffffff;
}

.dashboard-v10-head-stats strong {
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}

.dashboard-v10-head-stats span {
  font-size: 1.05rem;
}

.dashboard-v10-hero .kicker {
  color: #756649;
  font-size: 0.92rem;
}

.dashboard-v10-hero h2 {
  font-size: 3.2rem;
  letter-spacing: -0.015em;
}

.dashboard-v10-hero p {
  font-size: 1.2rem;
  color: #3f4f42;
}

.dashboard-v10-hero-copy p strong {
  color: #24382a;
}

.dashboard-v10-hero-chips span {
  background: #f8f2e7;
  border-color: #e9e0d0;
  color: #495a4d;
  font-size: 1.02rem;
}

.dashboard-v10-hero-cta {
  background: linear-gradient(150deg, #eef8ed 0%, #e8f3e5 100%);
}

.dashboard-v10-hero-cta .btn,
.side-plan-card .btn {
  background: linear-gradient(92deg, var(--v10-blue-a) 0%, var(--v10-blue-b) 100%);
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(45, 92, 230, 0.34);
}

.dashboard-v10-hero-cta .btn:focus,
.side-plan-card .btn:focus {
  box-shadow: 0 8px 20px rgba(45, 92, 230, 0.34), 0 0 0 0.18rem rgba(58, 105, 245, 0.24);
}

.dashboard-v10-hero-cta a:not(.btn),
.dashboard-v10-atividades > a,
.dashboard-v10-semana > a,
.side-list-card > a,
.prio-card a {
  color: var(--v10-link);
}

.dashboard-v10-hero-cta a:not(.btn):hover,
.dashboard-v10-atividades > a:hover,
.dashboard-v10-semana > a:hover,
.side-list-card > a:hover,
.prio-card a:hover {
  color: var(--v10-link-hover);
}

.dashboard-v10-prioridades h3,
.dashboard-v10-progresso h3,
.dashboard-v10-atividades h3,
.dashboard-v10-semana h3,
.side-plan-card h3,
.side-list-card h3 {
  color: #223429;
  font-size: 1.28rem;
  font-weight: 800;
}

.prio-card {
  background: #fffef9;
}

.prio-card h4 {
  font-size: 3rem;
}

.prio-card p {
  font-size: 1.55rem;
}

.dashboard-v10-progresso-grid article {
  background: #fffefb;
}

.dashboard-v10-progresso-grid strong {
  font-size: 2rem;
}

.dashboard-v10-progresso-grid span,
.dashboard-v10-progresso-grid small,
.side-plan-card li span,
.side-plan-card li small,
.side-list-card li span,
.side-list-card li small {
  font-size: 1rem;
  color: #49594c;
}

.dashboard-v10-atividades li p,
.dashboard-v10-atividades li strong,
.prio-card p,
.prio-card small,
.side-list-card h3,
.side-plan-card h3 {
  color: #26362a;
}

.sidebar-nav-pro .nav-link i {
  width: 1rem;
}

.sidebar-nav-pro .icon-home,
.sidebar-nav-pro .icon-library {
  color: #536be5;
}

.sidebar-nav-pro .icon-review {
  color: #e4b13b;
}

.sidebar-nav-pro .icon-flash {
  color: #40a574;
}

.sidebar-nav-pro .icon-question {
  color: #d76a5c;
}

.sidebar-nav-pro .icon-mind {
  color: #8f6adf;
}

.sidebar-nav-pro .icon-bookmark {
  color: #5f7ce6;
}

.sidebar-nav-pro .icon-note {
  color: #d8568f;
}

.sidebar-nav-pro .icon-trash {
  color: #d36a6a;
}

@media (max-width: 1450px) {
  .dashboard-v10-head h1 {
    font-size: 2.15rem;
  }

  .dashboard-v10-hero h2 {
    font-size: 2.35rem;
  }

  .prio-card h4 {
    font-size: 2.35rem;
  }

  .prio-card p {
    font-size: 1.3rem;
  }
}

/* Sidebar + typography fidelity tweaks */
.library-pro-shell .panel-sidebar {
  background: #ffffff;
  border-right: 1px solid #e7ebf4;
}

.sidebar-brand-text {
  color: #4d63de;
  font-weight: 800;
}

.sidebar-nav-pro .nav-link {
  border-radius: 12px;
  color: #2f3f56;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0.68rem 0.78rem;
}

.sidebar-nav-pro .nav-link i {
  margin-right: 0.45rem;
  font-size: 0.92rem;
}

.sidebar-nav-pro .nav-link:hover {
  background: #eef2ff;
  color: #3c4fc0;
}

.sidebar-nav-pro .nav-link.active {
  background: #e4ebff;
  color: #3d54c9;
  box-shadow: inset 0 0 0 1px #d8e2ff;
}

.sidebar-nav-pro .nav-link[href*='dashboard'] i { color: #6a7bf0; }
.sidebar-nav-pro .nav-link[href*='library'] i { color: #6073ea; }
.sidebar-nav-pro .nav-link[href*='knowledge'] i { color: #6b7280; }
.sidebar-nav-pro .nav-link[href*='community'] i { color: #374151; }
.sidebar-nav-pro .nav-link[href*='marketplace'] i { color: #6b7280; }
.sidebar-nav-pro .nav-link[href*='stats'] i { color: #6b7280; }
.sidebar-nav-pro .nav-link[href*='admin'] i { color: #6b7280; }
.sidebar-nav-pro .nav-link[href*='reviews'] i { color: #f0b33c; }
.sidebar-nav-pro .nav-link[href*='flashcards'] i { color: #48a677; }
.sidebar-nav-pro .nav-link[href*='questions'] i { color: #e06c5e; }
.sidebar-nav-pro .nav-link[href*='ai'] i { color: #6c73e9; }

.sidebar-nav-pro .nav-link[href='#'] i {
  color: #8a6be0;
}

.sidebar-nav-pro .nav-link:nth-last-child(3) i { color: #6e83ef; }
.sidebar-nav-pro .nav-link:nth-last-child(2) i { color: #d95e93; }
.sidebar-nav-pro .nav-link:last-child i { color: #db7373; }

.dashboard-v10-head h1,
.dashboard-v10-hero h2,
.prio-card h4,
.prio-card p {
  text-rendering: geometricPrecision;
}

/* Reference dashboard layout */
.dashboard-ref-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-ref-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.4rem 0.2rem;
}

.dashboard-ref-top h1 {
  margin: 0;
  font-size: 2.05rem;
  font-weight: 800;
  color: #1f2f47;
}

.dashboard-ref-top p {
  margin: 0.25rem 0 0;
  color: #5f6e86;
  font-size: 0.98rem;
}

.dashboard-ref-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 0.65rem;
}

.dashboard-ref-kpis article {
  border: 1px solid #e5eaf5;
  border-radius: 15px;
  padding: 0.52rem 0.7rem;
  text-align: center;
  background: #fff;
}

.dashboard-ref-kpis i {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.12rem;
}

.dashboard-ref-kpis article:nth-child(1) i { color: #ef4444; }
.dashboard-ref-kpis article:nth-child(2) i { color: #6366f1; }
.dashboard-ref-kpis article:nth-child(3) i { color: #475569; }

.dashboard-ref-kpis strong {
  display: block;
  color: #243449;
  font-size: 1.85rem;
  line-height: 1;
}

.dashboard-ref-kpis span {
  color: #6f7b8f;
  font-size: 0.92rem;
}

.dashboard-ref-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0.9rem;
}

.dashboard-ref-main {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.dashboard-ref-card,
.dashboard-ref-hero {
  border: 1px solid #e6ebf5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31, 47, 71, 0.04);
}

.dashboard-ref-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 228px;
  gap: 0.85rem;
  padding: 1rem;
  background-image:
    radial-gradient(circle at 72% -10%, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 36%),
    linear-gradient(126deg, #322ca7 0%, #3a2fb6 40%, #28208f 100%);
  background-repeat: no-repeat;
  background-size: auto, auto;
  background-position: left top, left top;
  color: #ffffff;
}

.dashboard-ref-hero .hero-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-ref-hero h2 {
  margin: 0.2rem 0;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.06;
}

.dashboard-ref-hero p {
  margin: 0.2rem 0;
  color: rgba(236, 239, 255, 0.94);
  font-size: 1.04rem;
}

.dashboard-ref-hero p strong {
  color: #ffd84d;
}

.hero-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
  margin-top: 0.58rem;
}

.hero-chips span {
  display: flex;
  align-items: center;
  gap: 0.33rem;
  font-size: 0.8rem;
  color: #d8defd;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0.35rem 0.48rem;
  background: rgba(8, 12, 51, 0.22);
}

.hero-side {
  border-radius: 13px;
  background: linear-gradient(155deg, #eef8ed 0%, #e3f1e0 100%);
  border: 1px solid #d6e7d1;
  padding: 0.62rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hero-side .btn,
.side-plan .btn {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(92deg, #4f6cf7 0%, #5a49de 100%);
  color: #fff;
  font-weight: 800;
  padding: 0.58rem 0.7rem;
}

.hero-side p {
  margin: 0;
  color: #4e6070;
  font-size: 0.93rem;
}

.hero-side a:not(.btn) {
  color: #365eaa;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.93rem;
}

.dashboard-ref-card {
  padding: 0.9rem;
}

.dashboard-ref-card h3 {
  margin: 0 0 0.72rem;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  color: #2e3f58;
  font-weight: 800;
}

.prioridades-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.prio-item {
  border: 1px solid #e7ecf7;
  border-radius: 13px;
  padding: 0.72rem;
  text-align: center;
  background: #fff;
}

.prio-item .badge {
  margin: 0;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
}

.prio-item .badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 4px;
}

.prio-item .prio-icon {
  width: 50px;
  height: 50px;
  margin: 0.5rem auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.prio-item h4 {
  margin: 0;
  color: #28384e;
  font-size: 2.05rem;
  line-height: 1.03;
}

.prio-item .sub {
  margin: 0.2rem 0;
  color: #5f6d84;
  font-size: 0.92rem;
}

.prio-item small {
  display: block;
  color: #7e8ca1;
  margin-bottom: 0.45rem;
}

.prio-item a {
  display: block;
  border: 1px solid #d9e2f3;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  padding: 0.34rem;
}

.prio-item.urgente .badge,
.prio-item.urgente a { color: #ef4444; }
.prio-item.urgente .badge .dot { background: #ef4444; }
.prio-item.urgente .prio-icon { background: #fff1f2; color: #ef4444; }

.prio-item.atencao .badge,
.prio-item.atencao a { color: #f59e0b; }
.prio-item.atencao .badge .dot { background: #f59e0b; }
.prio-item.atencao .prio-icon { background: #fff7e8; color: #f59e0b; }

.prio-item.emdia .badge,
.prio-item.emdia a { color: #22c55e; }
.prio-item.emdia .badge .dot { background: #22c55e; }
.prio-item.emdia .prio-icon { background: #ecfdf3; color: #22c55e; }

.prio-item.plano .badge,
.prio-item.plano a { color: #4f46e5; }
.prio-item.plano .badge .dot { background: #4f46e5; }
.prio-item.plano .prio-icon { background: #eef2ff; color: #4f46e5; }

.progresso-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.progresso-grid article {
  border: 1px solid #e8edf8;
  border-radius: 12px;
  padding: 0.66rem;
}

.progresso-grid span { color: #6f7e95; font-size: 0.72rem; display: block; }
.progresso-grid strong { color: #26374d; font-size: 2rem; line-height: 1.05; display: block; }
.progresso-grid small { color: #72849c; font-size: 0.8rem; }

.bar {
  height: 6px;
  border-radius: 999px;
  background: #ebeff9;
  margin-top: 0.42rem;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar-blue span { background: #5c6ef5; }
.bar-purple span { background: #7c3aed; }
.bar-orange span { background: #f59e0b; }
.bar-green span { background: #22c55e; }

.dashboard-ref-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0.7rem;
}

.atividade ul,
.side-plan ul,
.side-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.atividade li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  border-bottom: 1px dashed #e8edf8;
  padding: 0.28rem 0;
}

.atividade li:last-child { border-bottom: 0; }
.atividade li span { color: #6e7d93; }
.atividade li p { margin: 0; color: #2f4058; }
.atividade li strong { color: #5a52db; font-size: 0.84rem; }

.atividade > a,
.semana > a,
.side-list > a {
  display: inline-block;
  margin-top: 0.5rem;
  color: #4e58d8;
  text-decoration: none;
  font-weight: 700;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.38rem;
}

.week-grid span {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
}

.week-grid .lv1 { background: #eff7ef; }
.week-grid .lv2 { background: #dbf1dc; }
.week-grid .lv3 { background: #b8e5bc; }
.week-grid .lv4 { background: #89d494; }
.week-grid .lv5 { background: #4dbf6b; }

.dashboard-ref-side {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.side-plan li,
.side-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0;
  border-bottom: 1px dashed #e8edf8;
}

.side-plan li:last-child,
.side-list li:last-child { border-bottom: 0; }

.side-plan li span,
.side-list li span { color: #34455e; }
.side-plan li small,
.side-list li small { color: #75839a; }

.side-plan .ok { color: #22c55e; margin-right: 0.26rem; }
.side-plan .atn { color: #f59e0b; margin-right: 0.26rem; }
.side-plan .pen { color: #94a3b8; margin-right: 0.26rem; }

.side-plan .total {
  margin: 0.55rem 0;
  color: #64748b;
}

.side-plan .total strong { color: #26364c; }

.sidebar-nav-ref .sidebar-group-title {
  margin: 0.34rem 0 0.12rem;
  color: #8a95a9;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.sidebar-plan-card {
  margin-top: 0.8rem;
  border: 1px solid #e5ebf9;
  border-radius: 12px;
  padding: 0.58rem;
  background: #f8faff;
}

.sidebar-plan-card .plan-title {
  margin: 0;
  color: #8a95a9;
  font-size: 0.75rem;
}

.sidebar-plan-card strong {
  display: block;
  color: #f59e0b;
  margin-top: 0.1rem;
}

.sidebar-plan-card > a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
}

.sidebar-plan-logout {
  margin-top: 0.3rem;
}

.sidebar-plan-logout .btn {
  padding: 0;
  font-size: 0.8rem;
  color: #64748b;
  text-decoration: none;
}

@media (max-width: 1360px) {
  .dashboard-ref-hero h2 { font-size: 2rem; }
  .prioridades-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .dashboard-ref-grid,
  .dashboard-ref-bottom {
    grid-template-columns: 1fr;
  }

  .dashboard-ref-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .progresso-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .dashboard-ref-top {
    flex-direction: column;
  }

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

  .hero-chips,
  .progresso-grid,
  .prioridades-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Dashboard v11 – topbar, icons, heatmap, fidelity ───────────────────── */

/* Fix: prio-item h4 was inflated */
.prio-item h4 { font-size: 1.05rem !important; font-weight: 800 !important; line-height: 1.2 !important; margin: 0 0 0.1rem !important; }
.prio-item .sub { font-size: 0.84rem !important; }
.prio-item .prio-status { font-size: 0.78rem; display: block; margin-bottom: 0.35rem; }
.prio-btn { display: block; border: 1.5px solid currentColor; border-radius: 7px; padding: 0.3rem 0.5rem; font-size: 0.82rem; font-weight: 600; text-decoration: none; text-align: center; margin-top: auto; }
.prio-item.urgente .prio-btn { color: #ef4444; }
.prio-item.atencao .prio-btn { color: #f59e0b; }
.prio-item.emdia  .prio-btn { color: #22c55e; }
.prio-item.plano  .prio-btn { color: #6366f1; }
.prio-item.urgente .prio-btn:hover { background: #fff1f2; }
.prio-item.atencao .prio-btn:hover { background: #fff7e8; }
.prio-item.emdia  .prio-btn:hover { background: #ecfdf3; }
.prio-item.plano  .prio-btn:hover { background: #eef2ff; }

/* Dashboard custom topbar */
.db-topbar-shell { display: flex !important; align-items: center; gap: 1rem; padding: 0.6rem 1.2rem !important; min-height: 66px; background: #fff !important; }
.db-tb-greeting { flex: 0 0 auto; }
.db-tb-greeting h1 { margin: 0; font-size: 1.38rem; font-weight: 800; color: #1f2f47; line-height: 1.15; }
.db-tb-greeting p  { margin: 0; color: #6e7d93; font-size: 0.82rem; }
.db-tb-kpis { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.db-tb-kpis article { display: flex; align-items: center; gap: 0.38rem; border: 1px solid #e5eaf5; border-radius: 12px; padding: 0.28rem 0.6rem; background: #fafbff; }
.db-tb-kpis .bi-fire { color: #ef4444; font-size: 1rem; }
.db-tb-kpis .bi-gem  { color: #6366f1; font-size: 1rem; }
.db-tb-kpis .bi-clock { color: #64748b; font-size: 1rem; }
.db-tb-kpis strong { display: block; font-size: 1.28rem; font-weight: 800; color: #1f2f47; line-height: 1; }
.db-tb-kpis span   { display: block; font-size: 0.68rem; color: #8a96a8; }
.db-tb-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 0.6rem; }
.db-tb-bell-btn { position: relative; background: none; border: none; padding: 0.25rem 0.4rem; cursor: pointer; color: #475569; font-size: 1rem; line-height: 1; }
.db-tb-badge { position: absolute; top: 0; right: 0; background: #ef4444; color: #fff; border-radius: 999px; font-size: 0.52rem; font-weight: 800; min-width: 13px; height: 13px; display: flex; align-items: center; justify-content: center; padding: 0 2px; }
.db-tb-userpill { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.db-tb-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#3b5bdb,#5c7cfa); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.74rem; font-weight: 800; flex-shrink: 0; }
.db-tb-userinfo strong { display: block; font-size: 0.86rem; font-weight: 700; color: #1e293b; }
.db-tb-userinfo small  { display: block; color: #64748b; font-size: 0.69rem; }
.db-tb-chevron { color: #94a3b8; font-size: 0.66rem; }

/* Progresso value row */
.prog-val { display: flex; align-items: baseline; gap: 0.35rem; margin-bottom: 0.1rem; }
.prog-val strong { font-size: 1.82rem; font-weight: 800; color: #1f2f47; line-height: 1; }

/* Hero CTA panel */
.hero-side { background: rgba(255,255,255,0.96) !important; border: 1px solid rgba(255,255,255,0.85) !important; border-radius: 14px !important; padding: 1.1rem !important; display: flex !important; flex-direction: column !important; gap: 0.55rem !important; align-items: stretch !important; }
.hero-cta-btn { font-weight: 800 !important; letter-spacing: 0.03em; border-radius: 10px !important; }
.hero-cta-sub  { margin: 0; font-size: 0.8rem; color: #475569; text-align: center; }
.hero-cta-link { font-size: 0.8rem; color: #4f46e5; text-decoration: none; text-align: center; }
.hero-pct-goal { color: #fbbf24 !important; }

/* Activity icons */
.atividade ul li { display: grid !important; grid-template-columns: 40px 26px minmax(0,1fr) auto !important; gap: 0 0.4rem !important; align-items: center; padding: 0.32rem 0; border-bottom: 1px solid #f0f3fa; }
.atividade ul li:last-child { border-bottom: 0; }
.act-time { font-size: 0.77rem; color: #6e7d93; }
.act-ico { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.88rem; flex-shrink: 0; }
.act-ico-green { color: #22c55e; }
.act-ico-purple { background: #7c3aed; color: #fff; }
.act-ico-blue   { background: #3b82f6; color: #fff; }
.act-ico-avatar { font-size: 0.57rem; font-weight: 800; }

/* Week heatmap with labels */
.week-table { display: grid; grid-template-columns: 44px repeat(7,1fr); gap: 4px; margin-bottom: 0.4rem; }
.wt-head, .wt-row { display: contents; }
.wt-head span { text-align: center; font-size: 0.67rem; color: #8a96a8; font-weight: 700; padding-bottom: 2px; }
.wt-lbl { font-size: 0.69rem; color: #8a96a8; font-weight: 600; display: flex; align-items: center; }
.wt-row span:not(.wt-lbl) { aspect-ratio: 1; border-radius: 5px; min-height: 20px; }
.wt-row .lv1 { background: #f0faf1; }
.wt-row .lv2 { background: #d4edda; }
.wt-row .lv3 { background: #a5d6ae; }
.wt-row .lv4 { background: #6abe7a; }
.wt-row .lv5 { background: #3da657; }
.wt-legend { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.wt-legend > span:first-child, .wt-legend > span:last-child { font-size: 0.69rem; color: #94a3b8; }
.wt-lv { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Proximas revisoes / Conquistas items */
.side-list ul li { display: flex !important; justify-content: space-between; align-items: flex-start; gap: 0.4rem; padding: 0.42rem 0; border-bottom: 1px solid #f3f5fa; }
.side-list ul li:last-child { border-bottom: 0; }
.ritem-left { display: flex; align-items: flex-start; gap: 0.42rem; flex: 1; min-width: 0; }
.prio-dot { font-size: 1.05rem; flex-shrink: 0; margin-top: 2px; }
.prio-danger { color: #ef4444; }
.prio-warning { color: #f59e0b; }
.prio-success { color: #22c55e; }
.ritem-wrap { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; font-size: 0.86rem; font-weight: 500; color: #28384e; }
.ritem-tag { font-style: normal; font-size: 0.7rem; font-weight: 700; }
.tag-danger  { color: #ef4444; }
.tag-warning { color: #f59e0b; }
.tag-success { color: #22c55e; }
.ritem-sub { font-style: normal; font-size: 0.71rem; color: #8a96a8; }
.conq-ico { width: 30px; min-width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.84rem; }
.conq-blue   { background: #dbeafe; color: #2563eb; }
.conq-yellow { background: #fef3c7; color: #d97706; }
.conq-purple { background: #ede9fe; color: #7c3aed; }

/* Dashboard UX 2.0 */
.dashboard-ref-shell {
  --ux-space-1: 4px;
  --ux-space-2: 8px;
  --ux-space-3: 12px;
  --ux-space-4: 16px;
  --ux-space-5: 24px;
  --ux-space-6: 32px;
  --ux-space-7: 48px;
  --ux-r-sm: 10px;
  --ux-r-md: 14px;
  --ux-r-lg: 18px;
  --ux-card-border: #e8edf7;
  --ux-card-bg: #ffffff;
  --ux-text-strong: #1f2f47;
  --ux-text: #314257;
  --ux-muted: #7c8ca2;
  --ux-shadow-1: 0 10px 28px rgba(19, 38, 74, 0.06);
  --ux-shadow-2: 0 14px 34px rgba(34, 52, 92, 0.11);
  --ux-fast: 150ms;
  --ux-mid: 250ms;
  --ux-slow: 300ms;
}

.dashboard-ref-shell a,
.dashboard-ref-shell button,
.dashboard-ref-shell article,
.dashboard-ref-shell .bar span,
.sidebar-nav-ref .nav-link {
  transition: transform var(--ux-fast) ease, box-shadow var(--ux-mid) ease, background-color var(--ux-mid) ease, color var(--ux-fast) ease, border-color var(--ux-mid) ease, opacity var(--ux-fast) ease;
}

.dashboard-ref-shell .dashboard-ref-card,
.dashboard-ref-shell .dashboard-ref-hero,
.dashboard-ref-shell .side-plan,
.dashboard-ref-shell .side-list {
  border-radius: var(--ux-r-lg);
  border-color: var(--ux-card-border);
  box-shadow: var(--ux-shadow-1);
}

.dashboard-ref-shell .dashboard-ref-card:hover,
.dashboard-ref-shell .side-plan:hover,
.dashboard-ref-shell .side-list:hover,
.dashboard-ref-shell .prio-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--ux-shadow-2);
}

.dashboard-ref-shell .dashboard-ref-card:focus-within,
.dashboard-ref-shell .prio-item:focus-visible,
.dashboard-ref-shell .timeline-item:focus-visible,
.dashboard-ref-shell .plan-open:focus-visible,
.dashboard-ref-shell .hero-cta-btn:focus-visible,
.db-topbar-shell .db-tb-userpill:focus-visible,
.db-topbar-shell .db-tb-bell-btn:focus-visible,
.sidebar-nav-ref .nav-link:focus-visible {
  outline: 2px solid #4f6cf7;
  outline-offset: 2px;
}

.dashboard-ref-grid {
  gap: var(--ux-space-4);
}

/* Hero as true mission center */
.dashboard-ref-hero.mission-hero {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  padding: var(--ux-space-5);
  grid-template-columns: minmax(0, 1fr) 250px;
  border: 1px solid #dbe6f3;
  border-radius: 18px;
  background:
    radial-gradient(900px 500px at 0% -40%, rgba(14, 165, 233, 0.18) 0%, transparent 54%),
    radial-gradient(900px 480px at 100% 120%, rgba(37, 99, 235, 0.16) 0%, transparent 56%),
    linear-gradient(140deg, #f8fbff 0%, #eef5ff 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.dashboard-ref-hero.mission-hero::after {
  content: '';
  position: absolute;
  right: -48px;
  top: -56px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  filter: none;
  opacity: 1;
  pointer-events: none;
}

.focus-pill {
  position: absolute;
  right: var(--ux-space-4);
  top: var(--ux-space-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
}

.dashboard-ref-hero .hero-kicker {
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  opacity: 1;
  color: #0369a1;
  font-weight: 800;
}

.dashboard-ref-hero h2 {
  font-size: clamp(1.7rem, 2.4vw, 2.8rem);
  margin: 0 0 var(--ux-space-2);
  color: #0f172a;
}

.hero-evolution {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 var(--ux-space-3);
  font-weight: 800;
}

.hero-evolution .ev-from,
.hero-evolution .ev-to {
  font-size: 1.35rem;
  color: #0f172a;
}

.hero-evolution .ev-arrow,
.hero-evolution .ev-delta {
  color: #1d4ed8;
  font-size: 0.95rem;
}

.hero-chips {
  gap: var(--ux-space-2);
}

.hero-chips span {
  min-height: 34px;
  font-size: 0.79rem;
  background: #ffffff;
  border: 1px solid #dbe6f3;
  color: #1e293b;
}

.hero-side {
  position: relative;
  z-index: 1;
  padding: var(--ux-space-4) !important;
  background: rgba(255, 255, 255, 0.97) !important;
}

.hero-cta-btn {
  min-height: 60px;
  font-size: 1.02rem;
  box-shadow: 0 10px 26px rgba(68, 83, 225, 0.35);
}

.hero-cta-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 30px rgba(68, 83, 225, 0.42);
}

/* Visual hierarchy blocks */
.dashboard-priorities,
.dashboard-progress {
  padding: var(--ux-space-4);
}

.dashboard-priorities h3,
.dashboard-progress h3,
.timeline-card h3,
.contrib-card h3,
.mission-plan h3,
.side-list h3 {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f7f95;
}

.prioridades-grid {
  gap: var(--ux-space-3);
}

.prio-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 240px;
  border-radius: var(--ux-r-md);
  padding: var(--ux-space-4);
  text-align: left;
}

.prio-item .prio-icon {
  margin: 0;
  width: 44px;
  height: 44px;
}

.prio-item h4 {
  font-size: 1.06rem !important;
  color: var(--ux-text-strong);
}

.prio-item .sub,
.prio-item .prio-status {
  font-size: 0.82rem !important;
}

.prio-item .badge {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.prio-item.urgente {
  background: #fff6f7;
  border-color: #ffdfe3;
}

.prio-item.atencao {
  background: #fffaf1;
  border-color: #ffeccc;
}

.prio-item.emdia {
  background: #f4fcf7;
  border-color: #d8f0e0;
}

.prio-item.plano {
  background: #f5f8ff;
  border-color: #dfe8ff;
}

.prio-btn {
  margin-top: auto;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Larger progress bars + subtle fill animation */
.progresso-grid {
  gap: var(--ux-space-3);
}

.progresso-grid article {
  padding: 14px;
}

.progresso-grid .bar {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}

.progresso-grid .bar span {
  animation: uxProgressFill var(--ux-slow) ease both;
}

.trend-up {
  color: #16a34a;
  font-weight: 700;
  font-size: 0.78rem;
}

.trend-down {
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.78rem;
}

/* Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 46px 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #eef2f8;
  padding: 8px 0;
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-time {
  color: var(--ux-muted);
  font-size: 0.78rem;
}

.timeline-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #16a34a;
  background: #ebf9ef;
}

.timeline-content {
  min-width: 0;
}

.timeline-title,
.timeline-desc {
  margin: 0;
}

.timeline-title {
  color: var(--ux-text-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.timeline-desc {
  color: var(--ux-muted);
  font-size: 0.76rem;
  margin-top: 2px;
}

.timeline-xp {
  color: #4f46e5;
  font-size: 0.78rem;
}

/* Contribution heatmap */
.contrib-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-columns: 12px;
  gap: 4px;
  margin-bottom: 10px;
}

.contrib-day {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #edf2f7;
}

.contrib-day.lv1 { background: #d9f0df; }
.contrib-day.lv2 { background: #9dd8ac; }
.contrib-day.lv3 { background: #5ebf78; }
.contrib-day.lv4 { background: #2f9f53; }

.contrib-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.contrib-summary span {
  font-size: 0.74rem;
  color: var(--ux-muted);
}

.contrib-summary strong {
  display: block;
  color: var(--ux-text-strong);
  font-size: 1rem;
}

/* Today plan with quick actions */
.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f5fa;
  border-radius: 0;
  padding: 0.42rem 0;
  background: transparent;
}

.plan-row:last-child {
  border-bottom: 0;
}

.mission-plan .plan-row {
  border-bottom: 1px solid #f3f5fa;
  padding: 0.42rem 0;
}

.plan-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.plan-main strong,
.plan-main small,
.plan-status {
  display: block;
}

.plan-main strong {
  font-size: 0.88rem;
  color: var(--ux-text-strong);
}

.plan-main small {
  font-size: 0.74rem;
  color: var(--ux-muted);
}

.plan-status {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.plan-status.ok { color: #16a34a; }
.plan-status.warn { color: #d97706; }

.plan-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid #d8e1f6;
  color: #3e55c7;
  background: #f6f9ff;
  text-decoration: none;
  font-size: 0.77rem;
  font-weight: 700;
}

.plan-open:hover {
  transform: translateY(-1px);
  background: #edf3ff;
}

.mission-plan .plan-list {
  margin-bottom: 0.85rem;
}

.mission-plan .total {
  margin: 0.85rem 0 0.8rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #e3eaf6;
  line-height: 1.35;
}

.mission-plan .btn.w-100 {
  margin-top: 0 !important;
}

/* Sidebar micro interactions */
.sidebar-nav-ref .nav-link:hover {
  transform: translateX(2px);
}

/* Focus mode: hide secondary information and amplify mission + progress */
.dashboard-focus-mode .dashboard-priorities,
.dashboard-focus-mode .timeline-card,
.dashboard-focus-mode .contrib-card,
.dashboard-focus-mode .side-list {
  display: none;
}

.dashboard-focus-mode .dashboard-ref-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.dashboard-focus-mode .mission-hero {
  min-height: 280px;
}

.dashboard-focus-mode .dashboard-progress {
  border: 1px solid #d9e3ff;
}

/* Responsive */
@media (max-width: 1280px) {
  .dashboard-ref-hero.mission-hero {
    background-size: auto, auto, 30% auto;
    background-position: left top, left top, right 8% center;
  }

  .prioridades-grid,
  .progresso-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .db-topbar-shell {
    flex-wrap: wrap;
    gap: 10px;
  }

  .db-tb-kpis {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-ref-grid,
  .dashboard-ref-bottom,
  .dashboard-focus-mode .dashboard-ref-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-ref-hero.mission-hero {
    grid-template-columns: 1fr;
    background-size: auto, auto, 40% auto;
    background-position: left top, left top, right 12px top 12px;
  }

  .hero-side {
    margin-top: 10px;
  }
}

@media (max-width: 640px) {
  .prioridades-grid,
  .progresso-grid,
  .contrib-summary {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 42px 22px minmax(0, 1fr);
  }

  .timeline-xp {
    grid-column: 3;
    justify-self: start;
  }
}

@keyframes uxProgressFill {
  from { transform: scaleX(0); transform-origin: left center; opacity: 0.6; }
  to { transform: scaleX(1); transform-origin: left center; opacity: 1; }
}

/* Study session page 2.0 */
.study-session-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0.9rem;
}

.study-session-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.study-session-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.study-session-head h1 {
  margin: 0;
  font-size: 2rem;
  color: #1f2f47;
  font-weight: 800;
}

.study-session-head p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.study-session-head-actions {
  display: inline-flex;
  gap: 0.45rem;
}

.study-hero-card {
  border: 1px solid #dfe7fa;
  border-radius: 16px;
  padding: 1rem;
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(122deg, #463ab8 0%, #4f45d0 55%, #3d34a3 100%);
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 0.9rem;
  position: relative;
  overflow: hidden;
}

.study-hero-card::after {
  content: '';
  position: absolute;
  right: 9%;
  top: 20%;
  width: 26%;
  height: 62%;
  background: url('../img/dashboard-hero-mountain.svg') no-repeat center / contain;
  opacity: 0.55;
  pointer-events: none;
}

.study-hero-copy,
.study-hero-cta {
  position: relative;
  z-index: 1;
}

.study-hero-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.82);
}

.study-hero-card h2 {
  margin: 0.22rem 0;
  font-size: 2.35rem;
  line-height: 1.05;
  font-weight: 800;
}

.study-hero-card p {
  margin: 0 0 0.35rem;
  color: #e6e9ff;
}

.study-hero-card.mz-module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: stretch;
  border: 1px solid #dbe6f3;
  background:
    radial-gradient(900px 500px at 0% -40%, rgba(14, 165, 233, 0.18) 0%, transparent 54%),
    radial-gradient(900px 480px at 100% 120%, rgba(37, 99, 235, 0.16) 0%, transparent 56%),
    linear-gradient(140deg, #f8fbff 0%, #eef5ff 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.study-hero-card.mz-module-hero::after {
  content: none;
}

.study-hero-card.mz-module-hero .study-hero-kicker {
  color: #0369a1;
}

.study-hero-card.mz-module-hero h2 {
  color: #0f172a;
}

.study-hero-card.mz-module-hero p {
  color: #475569;
}

.study-hero-card.mz-module-hero .study-hero-goal {
  color: #1d4ed8;
}

.study-hero-card.mz-module-hero .study-hero-stats span {
  border: 1px solid #dbe6f3;
  background: #ffffff;
  color: #1e293b;
}

.study-hero-goal {
  color: #f7da56;
}

.study-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.study-hero-stats span {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(18, 20, 68, 0.26);
  padding: 0.38rem 0.5rem;
  font-size: 0.82rem;
}

.study-hero-cta {
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e7ecf7;
  padding: 0.9rem;
  color: #475569;
}

.study-hero-cta .btn {
  font-weight: 800;
  border-radius: 10px;
  min-height: 54px;
}

.study-hero-cta small {
  margin-top: 0.45rem;
  display: block;
  text-align: center;
  font-size: 0.83rem;
}

.study-plan-card,
.study-progress-card,
.study-activity-card,
.study-performance-card,
.study-side-card {
  border: 1px solid #e6ebf6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.study-plan-card,
.study-progress-card,
.study-activity-card,
.study-performance-card {
  padding: 0.82rem;
}

.study-plan-head,
.study-bottom-head,
.study-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}

.study-plan-head h3,
.study-bottom-head h3,
.study-progress-head h3,
.study-side-card h4 {
  margin: 0;
  color: #2b3d57;
  font-size: 1rem;
  font-weight: 800;
}

.study-plan-head a,
.study-bottom-head a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
}

.study-plan-list {
  margin: 0.52rem 0 0;
  padding: 0;
  list-style: none;
}

.study-plan-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 90px auto;
  align-items: center;
  gap: 0.58rem;
  padding: 0.62rem 0;
  border-bottom: 1px dashed #e7ebf3;
}

.study-plan-list li:last-child {
  border-bottom: 0;
}

.study-plan-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.study-plan-item-icon.red {
  color: #ef4444;
  background: #fff1f2;
}

.study-plan-item-icon.yellow {
  color: #f59e0b;
  background: #fff7e8;
}

.study-plan-item-icon.green {
  color: #22c55e;
  background: #ecfdf3;
}

.study-plan-item-copy strong {
  display: block;
  color: #2a3b53;
}

.study-plan-item-copy small {
  display: block;
  color: #73839a;
  font-size: 0.78rem;
}

.study-plan-item-time {
  color: #607088;
  font-size: 0.82rem;
  white-space: nowrap;
}

.study-plan-item-time i {
  margin-right: 2px;
}

.study-progress-head span {
  font-size: 0.83rem;
  color: #64748b;
}

.study-progress-card .progress {
  margin-top: 0.28rem;
  height: 10px;
}

.study-metrics-grid {
  margin-top: 0.62rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.study-metric-item {
  border: 1px solid #ebeff6;
  border-radius: 10px;
  padding: 0.45rem;
}

.study-metric-item span {
  display: block;
  color: #76869e;
  font-size: 0.73rem;
}

.study-metric-item strong {
  display: block;
  color: #23344c;
  font-size: 1.55rem;
  line-height: 1.03;
}

.study-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.72rem;
}

.study-history-list {
  list-style: none;
  margin: 0.55rem 0 0.7rem;
  padding: 0;
}

.study-history-list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 72px;
  gap: 0.5rem;
  align-items: center;
  border-bottom: 1px dashed #e8edf6;
  padding: 0.45rem 0;
}

.study-history-list li:last-child {
  border-bottom: 0;
}

.history-time {
  color: #7a8aa0;
  font-size: 0.78rem;
}

.history-copy strong {
  display: block;
  color: #2a3b53;
  font-size: 0.86rem;
  line-height: 1.25;
}

.history-copy small {
  display: block;
  color: #7a8aa0;
  font-size: 0.75rem;
}

.history-result {
  color: #4f46e5;
  font-weight: 700;
  font-size: 0.78rem;
  text-align: right;
}

.study-session-side {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.study-side-card {
  padding: 0.82rem;
}

.study-side-card h4 {
  margin-bottom: 0.62rem;
}

.study-side-card .review-achievement-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.study-side-card .review-achievement-list li {
  border: 1px solid #edf1f8;
  border-radius: 10px;
  padding: 0.42rem 0.5rem;
  background: #fafcff;
  color: #41556f;
}

.study-side-card .review-achievement-list li strong {
  color: #2b3d57;
  font-size: 0.84rem;
}

.study-side-card .review-achievement-list li small {
  color: #7b8ca2;
  font-size: 0.74rem;
}

.study-side-card .review-memory-map,
.study-side-card .review-heatmap-grid {
  margin-top: 0.15rem;
}

/* Library page aligned with study session layout */
.library-page-shell--study-like .library-workspace {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0.9rem;
  align-items: start;
}

.library-page-shell--study-like .library-pro-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.library-page-shell--study-like .library-pro-main .card,
.library-page-shell--study-like .library-pro-main .library-pane,
.library-page-shell--study-like .library-pro-doc {
  border: 1px solid #e6ebf6 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04) !important;
}

.library-page-shell--study-like .library-pro-right {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.library-page-shell--study-like .library-pro-right .library-pane {
  border: 1px solid #e6ebf6 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04) !important;
  padding: 0.82rem;
  overflow: hidden;
}

.library-page-shell--study-like .library-pro-right .library-pane h2,
.library-page-shell--study-like .library-pro-right .library-pane .h6 {
  margin: 0 0 0.62rem;
  color: #2b3d57;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.library-page-shell--study-like .library-pro-right .library-highlight-item {
  background: #eef3fb;
  border-color: #d9e3f2;
}

.library-page-shell--study-like .library-pro-right .library-highlight-item.active {
  border-color: #7d8fdd;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.library-page-shell--study-like .library-pro-right .library-highlight-item-text {
  color: #1f2f47;
}

.library-page-shell--study-like .library-pro-right .library-highlight-item-meta {
  color: #4e627d;
}

.library-page-shell--study-like .library-pro-right .library-highlight-item-tags span {
  color: #31455f;
  border-color: #c9d6ea;
  background: #f7faff;
}

.library-page-shell--study-like .library-pro-right .library-highlight-detail {
  border-top-color: #d9e3f2;
}

.library-page-shell--study-like .library-pro-right .library-highlight-detail-box {
  border-color: #d9e3f2;
  background: #f3f7fe;
}

.library-page-shell--study-like .library-pro-right .library-highlight-perf-hint,
.library-page-shell--study-like .library-pro-right .library-highlight-page-info,
.library-page-shell--study-like .library-pro-right .library-highlight-empty {
  color: #4e627d;
}

.library-right-tree-pane #libraryTree {
  display: grid;
  gap: 2px;
}

.library-right-tree-pane .library-tree-item {
  background: transparent;
  border: 0;
  color: #1f2f47;
  border-radius: 6px;
  padding: 0.34rem 0.5rem;
  align-items: center;
}

.library-right-tree-pane .library-tree-item:hover {
  background: #eef2f6;
  box-shadow: none;
  transform: none;
}

.library-right-tree-pane .library-tree-item.active {
  background: #e7ecf3;
  box-shadow: inset 0 0 0 1px #d4dde8;
  transform: none;
}

.library-right-tree-pane .library-tree-chip {
  background: transparent;
  color: #6a7890;
  border-color: transparent;
}

.library-right-tree-pane .library-tree-item .fw-semibold {
  font-size: 0.82rem;
  font-weight: 600 !important;
}

.library-right-tree-pane .library-tree-item-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.library-right-tree-pane .library-tree-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-right-tree-pane .library-tree-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 0;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8a96aa;
  background: transparent;
  border: 0;
  flex: 0 0 auto;
}

.library-right-tree-pane .library-tree-item small {
  font-size: 0.64rem;
}

.library-right-tree-pane .library-tree-item-icon {
  width: 0.86rem;
  height: 0.86rem;
  border-radius: 0.2rem;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b6b86;
  line-height: 1;
  flex: 0 0 auto;
}

.library-right-tree-pane .library-tree-item-icon i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.library-right-tree-pane .library-tree-chip {
  font-size: 0.7rem;
  width: 1.28rem;
  min-width: 1.28rem;
  height: 1.28rem;
  padding: 0;
  margin-left: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: visible;
  background: #f3f4f6;
  border: 1px solid #d5dbe3;
  color: #334155;
}

.library-right-tree-pane .library-tree-chip i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.72rem;
  line-height: 1;
  color: #334155 !important;
  opacity: 1;
  visibility: visible;
  font-family: "bootstrap-icons" !important;
}

.library-right-tree-pane .library-tree-chip i::before {
  color: #334155 !important;
  font-size: 0.72rem !important;
}

.library-right-tree-pane .library-tree-item-head {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.library-right-tree-pane .library-tree-item {
  overflow: visible;
}

.library-right-tree-pane .library-tree-action-btn {
  color: #4b5e7c;
}

.library-right-tree-pane .library-tree-action-btn:hover {
  color: #31455f;
}

.library-page-shell--study-like .library-content-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.library-page-shell--study-like .library-pro-list-row > .card {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.library-page-shell--study-like .library-pro-list-row {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0;
}

.library-page-shell--study-like .library-pro-main .library-pro-list-row {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.library-page-shell--study-like .library-pro-list-row > .card > .card-body {
  padding: 0;
}

.library-page-shell--study-like .library-pro-main .library-pro-list-row > .card {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.library-page-shell--study-like .library-pro-main .library-pro-list-row > .card > .card-body {
  background: transparent !important;
}

.library-page-shell--study-like .library-pro-list-row .library-content-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.library-page-shell--study-like .library-pro-list-row .card,
.library-page-shell--study-like .library-pro-list-row .card-body,
.library-page-shell--study-like .library-pro-list-row .library-content-table,
.library-page-shell--study-like .library-pro-list-row .library-content-table thead,
.library-page-shell--study-like .library-pro-list-row .library-content-table tbody,
.library-page-shell--study-like .library-pro-list-row .library-content-table tr,
.library-page-shell--study-like .library-pro-list-row .library-content-table th,
.library-page-shell--study-like .library-pro-list-row .library-content-table td {
  border: 0 !important;
  box-shadow: none !important;
}

.library-page-shell--study-like .library-content-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.library-page-shell--study-like .library-content-table thead th {
  border-bottom: 0;
}

.library-page-shell--study-like .library-content-row td {
  border-top: 0;
  border-bottom: 0;
}

.library-page-shell--study-like .library-content-table th:nth-child(1),
.library-page-shell--study-like .library-content-table td:nth-child(1) {
  width: 49%;
}

.library-page-shell--study-like .library-content-table th:nth-child(2),
.library-page-shell--study-like .library-content-table td:nth-child(2) {
  width: 14%;
}

.library-page-shell--study-like .library-content-table th:nth-child(3),
.library-page-shell--study-like .library-content-table td:nth-child(3) {
  width: 18%;
}

.library-page-shell--study-like .library-content-table th:nth-child(4),
.library-page-shell--study-like .library-content-table td:nth-child(4),
.library-page-shell--study-like .library-content-table th:nth-child(5),
.library-page-shell--study-like .library-content-table td:nth-child(5) {
  width: 9.5%;
}

.library-page-shell--study-like .library-content-table thead th:nth-child(4),
.library-page-shell--study-like .library-content-table thead th:nth-child(5) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.64rem;
  letter-spacing: 0.03em;
}

.library-page-shell--study-like .library-content-node {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-page-shell--study-like #libraryTagsSidebar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.library-page-shell--study-like #libraryTagsSidebar .library-tag-chip {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.library-page-shell--study-like .library-content-tag-row .library-table-tag {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1430px) {
  .library-page-shell--study-like .library-workspace {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
}

@media (max-width: 1200px) {
  .library-page-shell--study-like .library-workspace {
    grid-template-columns: 1fr;
  }

  .library-page-shell--study-like .library-pro-right {
    order: -1;
  }
}

.reviews-page #reviewStartSessionBtn,
.reviews-page #reviewStartSessionCta {
  transition: transform 150ms ease, box-shadow 250ms ease;
}

.reviews-page #reviewStartSessionBtn:hover,
.reviews-page #reviewStartSessionCta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

@media (max-width: 1430px) {
  .study-session-shell {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .study-hero-card h2 {
    font-size: 2rem;
  }
}

@media (max-width: 1200px) {
  .study-session-shell,
  .study-bottom-grid {
    grid-template-columns: 1fr;
  }

  .study-session-side {
    order: -1;
  }
}

@media (max-width: 920px) {
  .study-session-head {
    flex-direction: column;
  }

  .study-hero-card {
    grid-template-columns: 1fr;
  }

  .study-hero-stats {
    grid-template-columns: 1fr;
  }

  .study-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-plan-list li {
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas:
      'icon copy'
      'icon time'
      'icon action';
  }

  .study-plan-list li .study-plan-item-icon { grid-area: icon; }
  .study-plan-list li .study-plan-item-copy { grid-area: copy; }
  .study-plan-list li .study-plan-item-time { grid-area: time; }
  .study-plan-list li .btn { grid-area: action; justify-self: start; }
}

.highlights-central-page {
  display: grid;
  gap: 1rem;
}

.mz-module-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-radius: 18px;
  border: 1px solid #dbe6f3;
  background:
    radial-gradient(900px 500px at 0% -40%, rgba(14, 165, 233, 0.16) 0%, transparent 54%),
    radial-gradient(900px 480px at 100% 120%, rgba(37, 99, 235, 0.14) 0%, transparent 56%),
    linear-gradient(140deg, #f8fbff 0%, #eef5ff 100%);
  padding: 1.15rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.mz-module-hero .mz-hero-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0369a1;
  font-weight: 800;
}

.mz-module-hero .mz-hero-title {
  margin: 0.2rem 0 0.42rem;
  color: #0f172a;
  font-weight: 800;
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
}

.mz-module-hero .mz-hero-subtitle {
  margin: 0;
  color: #475569;
}

.mz-module-hero .mz-hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.highlights-central-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem;
  border-radius: 18px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(34, 197, 94, 0.08));
}

.highlights-central-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #0369a1;
  font-weight: 700;
}

.highlights-central-hero h1 {
  margin: 0.15rem 0 0.4rem;
  font-size: 1.65rem;
}

.highlights-central-hero p {
  margin: 0;
  color: #475569;
}

.highlights-central-hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.highlights-central-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0.7rem;
}

.highlights-kpi-card {
  border: 1px solid #dbe6f3;
  border-radius: 14px;
  background: #fff;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.highlights-kpi-card span {
  display: block;
  font-size: 0.76rem;
  color: #64748b;
}

.highlights-kpi-card strong {
  font-size: 1.2rem;
  color: #0f172a;
}

.highlights-central-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 1rem;
}

.highlights-central-column {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.highlights-panel-card {
  border: 1px solid #dbe6f3;
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.highlights-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.highlights-panel-head h2 {
  margin: 0;
  font-size: 1rem;
}

.highlights-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.7rem;
}

.highlights-filter-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.55rem;
}

.highlights-central-list {
  display: grid;
  gap: 0.7rem;
}

.highlights-list-empty,
.highlights-empty-block {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 0.8rem;
  color: #64748b;
  font-size: 0.92rem;
}

.highlight-central-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem;
  display: grid;
  gap: 0.6rem;
  background: #ffffff;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.highlight-central-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.highlight-central-card.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25), 0 12px 26px rgba(37, 99, 235, 0.16);
}

.highlight-central-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.highlight-central-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

.highlight-central-card p {
  margin: 0;
  color: #0f172a;
}

.highlight-central-card footer {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
}

.highlight-central-meta {
  font-size: 0.85rem;
  color: #334155;
}

.highlight-central-actions {
  display: flex;
  gap: 0.45rem;
}

.highlight-central-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.highlight-central-tags span {
  font-size: 0.72rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.15rem 0.46rem;
  color: #1e3a8a;
}

.highlights-load-more-wrap {
  margin-top: 0.7rem;
}

.highlights-coverage-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.7rem;
  background: #eff6ff;
}

.highlights-coverage-score strong {
  font-size: 1.15rem;
  color: #1d4ed8;
}

.highlights-coverage-signals {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.highlights-coverage-signals span {
  font-size: 0.86rem;
  color: #334155;
}

.highlights-mini-list-wrap h3 {
  font-size: 0.86rem;
  margin: 0.45rem 0;
}

.highlights-mini-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.35rem;
}

.highlights-mini-list li small {
  display: block;
  color: #64748b;
}

.highlights-timeline-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.55rem;
}

.highlights-timeline-list li {
  display: grid;
  gap: 0.15rem;
}

.highlights-timeline-list span,
.highlights-timeline-list small {
  color: #64748b;
}

.highlights-recommendation-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.highlights-recommendation-list li {
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  padding: 0.6rem;
}

.highlights-recommendation-list button {
  text-decoration: none;
}

.highlights-recommendation-list small {
  display: block;
  color: #64748b;
}

@media (max-width: 1200px) {
  .highlights-central-kpis {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .highlights-central-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mz-module-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .highlights-central-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .highlights-central-kpis {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .highlights-filter-grid {
    grid-template-columns: 1fr;
  }

  .highlight-central-card footer {
    flex-direction: column;
  }
}

.achievements-page {
  display: grid;
  gap: 1rem;
}

.achievements-hero {
  border-radius: 18px;
  border: 1px solid #dbe6f3;
  background:
    radial-gradient(900px 500px at 0% -40%, rgba(14, 165, 233, 0.18) 0%, transparent 54%),
    radial-gradient(900px 480px at 100% 120%, rgba(37, 99, 235, 0.16) 0%, transparent 56%),
    linear-gradient(140deg, #f8fbff 0%, #eef5ff 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  padding: 1.15rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.achievements-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: #0369a1;
}

.achievements-hero h1 {
  margin: 0.35rem 0 0.45rem;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  color: #0f172a;
  font-weight: 800;
}

.achievements-hero p {
  margin: 0;
  color: #334155;
}

.achievements-hero-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.achievements-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0.65rem;
}

.achievements-kpi-card {
  border-radius: 14px;
  border: 1px solid #dbe6f3;
  background: #fff;
  padding: 0.75rem;
  display: grid;
  gap: 0.3rem;
}

.achievements-kpi-card span {
  color: #64748b;
  font-size: 0.75rem;
}

.achievements-kpi-card strong {
  font-size: 1.25rem;
  color: #0f172a;
}

.achievements-mountain {
  border-radius: 14px;
  border: 1px solid #dbe6f3;
  background: #fff;
  padding: 0.85rem;
}

.achievements-mountain header {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
}

.achievements-mountain header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.achievements-mountain header span {
  color: #64748b;
  font-size: 0.78rem;
}

.achievements-mountain-bar {
  height: 11px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.achievements-mountain-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b 0%, #eab308 33%, #2563eb 100%);
  transition: width 0.25s ease;
}

.achievements-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 0.8rem;
}

.achievements-main-column,
.achievements-side-column {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.achievements-panel-card {
  border-radius: 14px;
  border: 1px solid #dbe6f3;
  background: #fff;
  padding: 0.9rem;
}

.achievements-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.achievements-panel-head h2 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.achievements-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.65rem;
}

.achievements-filter-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.55rem;
}

.achievements-list {
  display: grid;
  gap: 0.65rem;
}

.achievement-card {
  border-radius: 12px;
  border: 1px solid #dbe6f3;
  background: #f8fafc;
  padding: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.achievement-card.is-unlocked {
  background: #f8fffb;
}

.achievement-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.achievement-rarity,
.achievement-category {
  font-size: 0.72rem;
  font-weight: 700;
}

.achievement-card h3 {
  margin: 0;
  font-size: 0.96rem;
}

.achievement-card p {
  margin: 0;
  color: #334155;
  font-size: 0.86rem;
}

.achievement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: #475569;
  font-size: 0.76rem;
}

.achievement-progress {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.achievement-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.2s ease;
}

.achievement-card small {
  color: #64748b;
  font-size: 0.73rem;
}

.rarity-common .achievement-rarity { color: #64748b; }
.rarity-common .achievement-progress span { background: #94a3b8; }
.rarity-uncommon .achievement-rarity { color: #15803d; }
.rarity-uncommon .achievement-progress span { background: #22c55e; }
.rarity-rare .achievement-rarity { color: #1d4ed8; }
.rarity-rare .achievement-progress span { background: #3b82f6; }
.rarity-epic .achievement-rarity { color: #be185d; }
.rarity-epic .achievement-progress span { background: #ec4899; }
.rarity-legendary .achievement-rarity { color: #b45309; }
.rarity-legendary .achievement-progress span { background: linear-gradient(90deg, #f59e0b 0%, #eab308 100%); }

.achievements-mini-list,
.achievements-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.achievements-mini-list li,
.achievements-timeline-list li {
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  padding: 0.55rem;
  display: grid;
  gap: 0.15rem;
}

.achievements-mini-list li strong,
.achievements-timeline-list li strong {
  font-size: 0.84rem;
}

.achievements-mini-list li small,
.achievements-timeline-list li small,
.achievements-empty {
  color: #64748b;
  font-size: 0.76rem;
}

@media (max-width: 1200px) {
  .achievements-kpis {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

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

@media (max-width: 768px) {
  .achievements-hero {
    flex-direction: column;
  }

  .achievements-kpis {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .achievements-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   MEMORIZZA DESIGN SYSTEM v2 — Sidebar · Topbar · Dashboard · DS
   ================================================================ */

/* ── DS v2 Tokens ─────────────────────────────────────────────── */
:root {
  --mz-sidebar-w:          260px;
  --mz-sidebar-collapsed:  64px;
  --mz-sidebar-bg:         #ffffff;
  --mz-sidebar-border:     rgba(15, 23, 42, 0.07);
  --mz-sidebar-radius:     0;
  --mz-sidebar-pad-h:      0.75rem;

  --mz-nav-item-h:         36px;
  --mz-nav-item-radius:    8px;
  --mz-nav-item-color:     #475569;
  --mz-nav-item-hover-bg:  #f1f5f9;
  --mz-nav-item-active-bg: #eef2ff;
  --mz-nav-item-active-fg: #4f46e5;
  --mz-nav-accent:         #4f46e5;

  --mz-topbar-h:           56px;
  --mz-topbar-bg:          #ffffff;
  --mz-topbar-border:      rgba(15, 23, 42, 0.07);

  --mz-card-radius:        12px;
  --mz-card-bg:            #ffffff;
  --mz-card-border:        rgba(15, 23, 42, 0.07);
  --mz-card-shadow:        0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --mz-card-shadow-hover:  0 4px 12px rgba(15, 23, 42, 0.10), 0 16px 32px rgba(15, 23, 42, 0.06);

  --mz-transition:         0.18s cubic-bezier(0.4, 0, 0.2, 1);

  --mz-font-label:         0.67rem;
  --mz-font-body:          0.875rem;
  --mz-font-title:         1rem;
}

html[data-theme='dark'] {
  --mz-sidebar-bg:         #0f172a;
  --mz-sidebar-border:     rgba(255, 255, 255, 0.06);
  --mz-nav-item-color:     #94a3b8;
  --mz-nav-item-hover-bg:  #1e293b;
  --mz-nav-item-active-bg: rgba(99, 102, 241, 0.14);
  --mz-nav-item-active-fg: #818cf8;
  --mz-nav-accent:         #6366f1;
  --mz-topbar-bg:          #0f172a;
  --mz-topbar-border:      rgba(255, 255, 255, 0.06);
  --mz-card-bg:            #1e293b;
  --mz-card-border:        rgba(255, 255, 255, 0.06);
  --mz-card-shadow:        0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
}

/* ── Override: library-pro-shell layout ──────────────────────── */
.library-pro-shell {
  display: grid;
  grid-template-columns: var(--mz-sidebar-w) minmax(0, 1fr);
  grid-template-rows: 100vh;
  background: #f5f7fc !important;
  overflow: hidden;
}

html[data-theme='dark'] .library-pro-shell {
  background: #0d1628 !important;
}

/* Sidebar panel container */
.library-pro-shell .panel-sidebar {
  width: var(--mz-sidebar-w);
  min-width: var(--mz-sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  background: var(--mz-sidebar-bg);
  border-right: 1px solid var(--mz-sidebar-border);
  display: flex;
  flex-direction: column;
  transition: width var(--mz-transition), min-width var(--mz-transition);
  z-index: 30;
  padding: 0;
}

/* Panel main */
.library-pro-shell .panel-main {
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
}

/* Collapsed state */
@media (min-width: 1200px) {
  .library-pro-shell.sidebar-collapsed {
    grid-template-columns: var(--mz-sidebar-collapsed) minmax(0, 1fr);
  }
  .library-pro-shell.sidebar-collapsed .panel-sidebar {
    width: var(--mz-sidebar-collapsed);
    min-width: var(--mz-sidebar-collapsed);
    overflow: visible;
  }
  .library-pro-shell.sidebar-collapsed .mz-brand-wordmark,
  .library-pro-shell.sidebar-collapsed .mz-search-trigger span,
  .library-pro-shell.sidebar-collapsed .mz-search-trigger kbd,
  .library-pro-shell.sidebar-collapsed .mz-nav-group-label,
  .library-pro-shell.sidebar-collapsed .mz-nav-label,
  .library-pro-shell.sidebar-collapsed .mz-nav-badge,
  .library-pro-shell.sidebar-collapsed .mz-user-info,
  .library-pro-shell.sidebar-collapsed .mz-user-badges,
  .library-pro-shell.sidebar-collapsed .mz-user-stat-val,
  .library-pro-shell.sidebar-collapsed .mz-user-actions-spacer {
    display: none !important;
  }
  .library-pro-shell.sidebar-collapsed .mz-sidebar-header {
    padding: 0.875rem 0;
    justify-content: center;
  }
  .library-pro-shell.sidebar-collapsed .mz-brand {
    display: none;
  }
  .library-pro-shell.sidebar-collapsed .mz-collapse-btn {
    margin: 0 auto;
  }
  .library-pro-shell.sidebar-collapsed .mz-sidebar-search {
    padding: 0 0.5rem 0.5rem;
  }
  .library-pro-shell.sidebar-collapsed .mz-search-trigger {
    justify-content: center;
    padding: 0.45rem;
  }
  .library-pro-shell.sidebar-collapsed .mz-nav-item {
    justify-content: center;
    padding: 0.5rem;
  }
  .library-pro-shell.sidebar-collapsed .mz-nav-item::before {
    display: none;
  }
  .library-pro-shell.sidebar-collapsed .mz-sidebar-footer {
    padding: 0.5rem;
  }
  .library-pro-shell.sidebar-collapsed .mz-user-card {
    justify-content: center;
  }
  .library-pro-shell.sidebar-collapsed .mz-user-actions {
    justify-content: center;
  }
}

/* ── MZ SIDEBAR HEADER ───────────────────────────────────────── */
.mz-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem var(--mz-sidebar-pad-h) 0.5rem;
  flex-shrink: 0;
  gap: 0.5rem;
}

.mz-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  min-width: 0;
}

.mz-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.mz-brand-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.mz-brand-wordmark {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--mz-transition), max-width var(--mz-transition);
}

html[data-theme='dark'] .mz-brand-wordmark {
  color: #f1f5f9;
}

.mz-collapse-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--mz-sidebar-border);
  background: transparent;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--mz-transition);
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0;
}

.mz-collapse-btn:hover {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

html[data-theme='dark'] .mz-collapse-btn {
  border-color: rgba(255,255,255,0.08);
  color: #475569;
}
html[data-theme='dark'] .mz-collapse-btn:hover {
  background: #1e293b;
  color: #94a3b8;
}

/* ── MZ SIDEBAR SEARCH ───────────────────────────────────────── */
.mz-sidebar-search {
  padding: 0 var(--mz-sidebar-pad-h) 0.375rem;
  flex-shrink: 0;
}

.mz-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--mz-sidebar-border);
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--mz-transition);
  text-align: left;
  min-width: 0;
}

.mz-search-trigger:hover {
  border-color: #c7d2fe;
  background: #f5f3ff;
  color: #6366f1;
}

.mz-search-placeholder {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mz-search-kbd {
  font-size: 0.65rem;
  font-family: monospace;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 4px;
  padding: 0.08rem 0.32rem;
  border: none;
  flex-shrink: 0;
}

html[data-theme='dark'] .mz-search-trigger {
  background: #1e293b;
  border-color: rgba(255,255,255,0.06);
  color: #475569;
}
html[data-theme='dark'] .mz-search-trigger:hover {
  border-color: #4f46e5;
  background: rgba(99,102,241,0.08);
  color: #818cf8;
}
html[data-theme='dark'] .mz-search-kbd {
  background: #334155;
  color: #64748b;
}

/* ── MZ SIDEBAR NAV ──────────────────────────────────────────── */
.mz-sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.mz-sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.mz-sidebar-nav::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 3px;
}
html[data-theme='dark'] .mz-sidebar-nav::-webkit-scrollbar-thumb {
  background: #1e293b;
}

.mz-nav-group {
  padding-top: 0.125rem;
  margin-bottom: 0.125rem;
}

.mz-nav-group-label {
  font-size: var(--mz-font-label);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.625rem 0.5rem 0.25rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
}

html[data-theme='dark'] .mz-nav-group-label {
  color: #334155;
}

.mz-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 0.5rem;
  border-radius: var(--mz-nav-item-radius);
  color: var(--mz-nav-item-color);
  font-size: var(--mz-font-body);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--mz-transition), color var(--mz-transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  min-height: var(--mz-nav-item-h);
}

.mz-nav-item:hover {
  background: var(--mz-nav-item-hover-bg);
  color: #1e293b;
  text-decoration: none;
}

html[data-theme='dark'] .mz-nav-item:hover {
  color: #e2e8f0;
}

.mz-nav-item.active {
  background: var(--mz-nav-item-active-bg);
  color: var(--mz-nav-item-active-fg);
  font-weight: 600;
}

.mz-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  background: var(--mz-nav-accent);
  border-radius: 0 3px 3px 0;
}

.mz-nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.mz-nav-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mz-nav-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 999px;
  padding: 0.1rem 0.38rem;
  flex-shrink: 0;
}

html[data-theme='dark'] .mz-nav-badge {
  background: rgba(109,40,217,0.2);
  color: #a78bfa;
}

/* ── MZ SIDEBAR FOOTER ───────────────────────────────────────── */
.mz-sidebar-footer {
  flex-shrink: 0;
  padding: 0.625rem var(--mz-sidebar-pad-h);
  border-top: 1px solid var(--mz-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.mz-user-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  transition: background var(--mz-transition);
  cursor: default;
  min-width: 0;
}

.mz-user-card:hover {
  background: var(--mz-nav-item-hover-bg);
}

.mz-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mz-user-info {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.mz-user-info strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.mz-user-info span {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mz-user-token-label {
  margin-top: 0.14rem;
  font-size: 0.62rem;
  color: #64748b;
  line-height: 1.2;
}

.mz-user-token-unlimited {
  color: #16a34a;
}

.mz-user-token-bar {
  margin-top: 0.15rem;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.mz-user-token-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

html[data-theme='dark'] .mz-user-info strong { color: #e2e8f0; }
html[data-theme='dark'] .mz-user-info span   { color: #475569; }

.mz-user-badges {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.mz-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mz-badge-plan {
  background: #dbeafe;
  color: #1e40af;
}

html[data-theme='dark'] .mz-badge-plan {
  background: rgba(37,99,235,0.18);
  color: #60a5fa;
}

/* Actions row */
.mz-user-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.mz-user-stat {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  padding: 0.22rem 0.3rem;
}

.mz-user-stat i {
  font-size: 0.78rem;
}

.mz-user-stat-val {
  font-size: 0.72rem;
}

.mz-user-actions-spacer {
  flex: 1 1 auto;
}

.mz-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--mz-sidebar-border);
  background: transparent;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--mz-transition);
  flex-shrink: 0;
  text-decoration: none;
  padding: 0;
}

.mz-icon-btn:hover {
  background: var(--mz-nav-item-hover-bg);
  color: #475569;
  border-color: #cbd5e1;
}

.mz-logout-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

html[data-theme='dark'] .mz-icon-btn {
  border-color: rgba(255,255,255,0.06);
  color: #475569;
}
html[data-theme='dark'] .mz-icon-btn:hover {
  background: #1e293b;
  color: #94a3b8;
}
html[data-theme='dark'] .mz-logout-btn:hover {
  background: rgba(239,68,68,0.12);
  color: #f87171;
}

.mz-logout-form {
  margin: 0;
  line-height: 0;
}

/* ── MZ TOPBAR ───────────────────────────────────────────────── */
.mz-topbar {
  height: var(--mz-topbar-h);
  min-height: var(--mz-topbar-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: var(--mz-topbar-bg);
  border-bottom: 1px solid var(--mz-topbar-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Dashboard topbar with custom greeting */
.mz-topbar.mz-topbar-dashboard {
  padding: 0 1.25rem;
  gap: 1rem;
}

.mz-topbar-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mz-topbar-center {
  flex: 0 1 400px;
}

.mz-topbar-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Breadcrumb */
.mz-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.mz-breadcrumb-root {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--mz-transition);
}

.mz-breadcrumb-root:hover {
  color: #475569;
  text-decoration: none;
}

.mz-breadcrumb-sep {
  color: #cbd5e1;
  font-size: 0.65rem;
}

.mz-breadcrumb-current {
  color: #1e293b;
  font-weight: 600;
}

html[data-theme='dark'] .mz-breadcrumb-root   { color: #475569; }
html[data-theme='dark'] .mz-breadcrumb-root:hover { color: #94a3b8; }
html[data-theme='dark'] .mz-breadcrumb-current { color: #e2e8f0; }

/* Topbar search */
.mz-topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--mz-topbar-border);
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--mz-transition);
  text-align: left;
}

.mz-topbar-search span {
  flex: 1 1 auto;
}

.mz-topbar-search kbd {
  font-size: 0.65rem;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 4px;
  padding: 0.08rem 0.3rem;
  border: none;
  font-family: monospace;
}

.mz-topbar-search:hover {
  border-color: #c7d2fe;
  background: #f5f3ff;
  color: #6366f1;
}

html[data-theme='dark'] .mz-topbar-search {
  background: #1e293b;
  border-color: rgba(255,255,255,0.06);
  color: #475569;
}
html[data-theme='dark'] .mz-topbar-search:hover {
  border-color: #4f46e5;
  background: rgba(99,102,241,0.08);
  color: #818cf8;
}

/* Topbar icon buttons */
.mz-topbar-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--mz-topbar-border);
  background: transparent;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--mz-transition);
  padding: 0;
}

.mz-topbar-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

html[data-theme='dark'] .mz-topbar-btn {
  border-color: rgba(255,255,255,0.06);
  color: #475569;
}
html[data-theme='dark'] .mz-topbar-btn:hover {
  background: #1e293b;
  color: #94a3b8;
}

/* Topbar user pill */
.mz-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  border-radius: 8px;
  border: 1px solid var(--mz-topbar-border);
  cursor: pointer;
  transition: background var(--mz-transition);
}

.mz-topbar-user:hover {
  background: #f1f5f9;
}

html[data-theme='dark'] .mz-topbar-user {
  border-color: rgba(255,255,255,0.06);
}
html[data-theme='dark'] .mz-topbar-user:hover {
  background: #1e293b;
}

.mz-topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mz-topbar-userinfo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.mz-topbar-userinfo strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
}

.mz-topbar-userinfo small {
  font-size: 0.68rem;
  color: #94a3b8;
}

html[data-theme='dark'] .mz-topbar-userinfo strong { color: #e2e8f0; }
html[data-theme='dark'] .mz-topbar-userinfo small  { color: #475569; }

/* Topbar title (non-library-pro) */
.mz-topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0;
}

html[data-theme='dark'] .mz-topbar-title { color: #f1f5f9; }

/* Dashboard topbar (greeting layout) */
.mz-topbar-dashboard .db-tb-greeting {
  flex: 1 1 auto;
  min-width: 0;
}

.mz-topbar-dashboard .db-tb-greeting h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme='dark'] .mz-topbar-dashboard .db-tb-greeting h1 { color: #f1f5f9; }

.mz-topbar-dashboard .db-tb-greeting p {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mz-topbar-dashboard .db-tb-kpis {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex-shrink: 0;
}

.mz-topbar-dashboard .db-tb-kpis article {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.65rem;
  border-radius: 8px;
  transition: background var(--mz-transition);
}

.mz-topbar-dashboard .db-tb-kpis article:hover {
  background: #f1f5f9;
}

html[data-theme='dark'] .mz-topbar-dashboard .db-tb-kpis article:hover {
  background: #1e293b;
}

.mz-topbar-dashboard .db-tb-kpis article i {
  font-size: 0.9rem;
  color: #94a3b8;
}

.mz-topbar-dashboard .db-tb-kpis article strong {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e293b;
  display: block;
  line-height: 1;
}

html[data-theme='dark'] .mz-topbar-dashboard .db-tb-kpis article strong { color: #e2e8f0; }

.mz-topbar-dashboard .db-tb-kpis article span {
  font-size: 0.65rem;
  color: #94a3b8;
  display: block;
  line-height: 1;
}

.mz-topbar-dashboard .db-tb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mz-topbar-dashboard .db-tb-bell-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--mz-topbar-border);
  background: transparent;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--mz-transition);
  padding: 0;
}

.mz-topbar-dashboard .db-tb-bell-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

.mz-topbar-dashboard .db-tb-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mz-topbar-dashboard .db-tb-userpill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  border-radius: 8px;
  border: 1px solid var(--mz-topbar-border);
  cursor: pointer;
  transition: background var(--mz-transition);
}

.mz-topbar-dashboard .db-tb-userpill:hover {
  background: #f1f5f9;
}

.mz-topbar-dashboard .db-tb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mz-topbar-dashboard .db-tb-userinfo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.mz-topbar-dashboard .db-tb-userinfo strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
}

.mz-topbar-dashboard .db-tb-userinfo small {
  font-size: 0.68rem;
  color: #94a3b8;
}

html[data-theme='dark'] .mz-topbar-dashboard .db-tb-userpill:hover { background: #1e293b; }
html[data-theme='dark'] .mz-topbar-dashboard .db-tb-userinfo strong { color: #e2e8f0; }

.mz-topbar-dashboard .db-tb-chevron {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* ── MZ PANEL CONTENT ────────────────────────────────────────── */
.mz-panel-content {
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem 2rem;
}

/* ── DS v2: CARD ─────────────────────────────────────────────── */
.mz-card {
  background: var(--mz-card-bg);
  border: 1px solid var(--mz-card-border);
  border-radius: var(--mz-card-radius);
  box-shadow: var(--mz-card-shadow);
  transition: box-shadow var(--mz-transition);
}

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

/* Override dashboard-ref-card for v2 polish */
.library-pro-shell .dashboard-ref-card {
  background: var(--mz-card-bg);
  border: 1px solid var(--mz-card-border);
  border-radius: var(--mz-card-radius);
  box-shadow: var(--mz-card-shadow);
}

.library-pro-shell .dashboard-ref-hero {
  border-radius: var(--mz-card-radius);
}

.library-pro-shell .prio-item {
  border-radius: var(--mz-card-radius) !important;
  border: 1px solid var(--mz-card-border) !important;
  box-shadow: var(--mz-card-shadow) !important;
  transition: box-shadow var(--mz-transition), transform var(--mz-transition) !important;
}

.library-pro-shell .prio-item:hover {
  box-shadow: var(--mz-card-shadow-hover) !important;
  transform: translateY(-2px);
}

/* ── DS v2: SCROLLBAR ────────────────────────────────────────── */
.library-pro-shell .panel-main::-webkit-scrollbar {
  width: 5px;
}

.library-pro-shell .panel-main::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 5px;
}

html[data-theme='dark'] .library-pro-shell .panel-main::-webkit-scrollbar-thumb {
  background: #1e293b;
}

/* ── DS v2: RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .library-pro-shell {
    grid-template-columns: var(--mz-sidebar-collapsed) minmax(0, 1fr);
  }
  .library-pro-shell .panel-sidebar {
    width: var(--mz-sidebar-collapsed);
    min-width: var(--mz-sidebar-collapsed);
  }
  .library-pro-shell .mz-brand-wordmark,
  .library-pro-shell .mz-search-placeholder,
  .library-pro-shell .mz-search-kbd,
  .library-pro-shell .mz-nav-group-label,
  .library-pro-shell .mz-nav-label,
  .library-pro-shell .mz-nav-badge,
  .library-pro-shell .mz-user-info,
  .library-pro-shell .mz-user-badges,
  .library-pro-shell .mz-user-stat-val {
    display: none !important;
  }
  .library-pro-shell .mz-sidebar-header {
    justify-content: center;
    padding: 0.875rem 0;
  }
  .library-pro-shell .mz-brand { display: none; }
  .library-pro-shell .mz-collapse-btn { margin: 0 auto; }
  .library-pro-shell .mz-search-trigger {
    justify-content: center;
    padding: 0.45rem;
  }
  .library-pro-shell .mz-nav-item {
    justify-content: center;
    padding: 0.5rem;
  }
  .library-pro-shell .mz-nav-item.active::before { display: none; }
  .library-pro-shell .mz-user-card { justify-content: center; }
  .library-pro-shell .mz-user-actions { justify-content: center; flex-wrap: wrap; }
  .library-pro-shell .mz-user-actions-spacer { display: none; }
  .mz-topbar-center { display: none; }
}

@media (max-width: 640px) {
  .library-pro-shell {
    grid-template-columns: 0 minmax(0, 1fr);
  }
  .library-pro-shell .panel-sidebar {
    position: fixed;
    left: -260px;
    z-index: 100;
    transition: left var(--mz-transition), width var(--mz-transition);
    width: var(--mz-sidebar-w) !important;
    min-width: var(--mz-sidebar-w) !important;
  }
  .library-pro-shell .mz-brand-wordmark,
  .library-pro-shell .mz-nav-group-label,
  .library-pro-shell .mz-nav-label,
  .library-pro-shell .mz-user-info,
  .library-pro-shell .mz-user-badges,
  .library-pro-shell .mz-user-stat-val {
    display: block !important;
  }
  .library-pro-shell.sidebar-mobile-open .panel-sidebar {
    left: 0;
  }
  .mz-topbar-right .mz-topbar-userinfo {
    display: none;
  }
}

/* ── DS v2: ANIMATIONS ───────────────────────────────────────── */
@keyframes mz-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mz-panel-content > * {
  animation: mz-fade-in 0.22s ease both;
}

/* ── DS v2: FOCUS / A11Y ─────────────────────────────────────── */
.mz-nav-item:focus-visible,
.mz-collapse-btn:focus-visible,
.mz-icon-btn:focus-visible,
.mz-topbar-btn:focus-visible,
.mz-search-trigger:focus-visible,
.mz-topbar-search:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* ── Dark mode: panel background ────────────────────────────── */
html[data-theme='dark'] .library-pro-shell .panel-main {
  background: transparent;
}

/* ================================================================
   ADMIN CENTER ENTERPRISE v2 — Component Library
   Prefix: adm-*  |  Uses MDS tokens (--mz-*)
   ================================================================ */

/* ── Shell layout ────────────────────────────────────────────── */
.adm-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: calc(100vh - var(--mz-topbar-height));
  overflow: hidden;
}

.adm-sidebar {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--mz-surface);
  border-right: 1px solid var(--mz-border);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--mz-neutral-200) transparent;
  flex-shrink: 0;
  transition: width 0.2s var(--mz-ease-in-out);
}

.adm-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  background: var(--mz-bg);
}

/* ── Admin Sidebar ───────────────────────────────────────────── */
.adm-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.875rem 0.875rem 0.75rem;
  border-bottom: 1px solid var(--mz-border);
}

.adm-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, #1e40af, #4f46e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.adm-brand-title { font-size: 0.82rem; font-weight: 800; color: var(--mz-text); line-height: 1.1; }
.adm-brand-sub   { font-size: 0.62rem; color: var(--mz-text-muted); font-weight: 500; }

.adm-sidebar-search {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--mz-border);
}

.adm-search-input {
  width: 100%;
  padding: 0.35rem 0.6rem;
  background: var(--mz-bg-subtle);
  border: 1px solid var(--mz-border);
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: var(--mz-font-family);
  color: var(--mz-text);
  outline: none;
  transition: border-color 150ms;
}
.adm-search-input:focus { border-color: var(--mz-primary-400); }
.adm-search-input::placeholder { color: var(--mz-text-muted); }

.adm-sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.375rem 0.5rem;
}

.adm-nav-group { margin-bottom: 0.125rem; }

.adm-nav-group-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mz-text-muted);
  padding: 0.5rem 0.5rem 0.2rem;
}

.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.38rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: var(--mz-font-family);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--mz-text-subtle);
  cursor: pointer;
  text-align: left;
  transition: all 150ms;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.adm-nav-item i { font-size: 0.85rem; flex-shrink: 0; }
.adm-nav-item:hover { background: var(--mz-bg-subtle); color: var(--mz-text); }
.adm-nav-item.is-active { background: var(--mz-primary-50); color: var(--mz-primary-700); font-weight: 600; }
.adm-nav-item.is-active::before { content:''; position:absolute; left:0; top:18%; bottom:18%; width:3px; background:var(--mz-primary-600); border-radius:0 3px 3px 0; }
.adm-nav-badge { margin-left: auto; font-size: 0.6rem; font-weight: 700; background: var(--mz-neutral-100); color: var(--mz-text-muted); border-radius: 999px; padding: 0.08rem 0.32rem; flex-shrink: 0; }
.adm-nav-item.is-active .adm-nav-badge { background: var(--mz-primary-100); color: var(--mz-primary-700); }

.adm-sidebar-footer {
  padding: 0.625rem;
  border-top: 1px solid var(--mz-border);
}
.adm-fav-section-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mz-text-muted); margin-bottom: 0.375rem; }
.adm-fav-hint { font-size: 0.72rem; color: var(--mz-text-muted); }
.adm-fav-item { display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0; font-size: 0.75rem; color: var(--mz-text-subtle); cursor: pointer; }
.adm-fav-item:hover { color: var(--mz-text); }

/* ── Admin Topbar ────────────────────────────────────────────── */
.adm-topbar {
  height: var(--mz-topbar-height);
  min-height: var(--mz-topbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  background: var(--mz-surface);
  border-bottom: 1px solid var(--mz-border);
  flex-shrink: 0;
}

.adm-breadcrumb { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; }
.adm-breadcrumb-root { color: var(--mz-text-muted); font-weight: 500; }
.adm-breadcrumb-sep  { color: var(--mz-neutral-300); font-size: 0.6rem; }
.adm-breadcrumb-current { color: var(--mz-text); font-weight: 700; }

.adm-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.adm-topbar-btn {
  width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--mz-border);
  background: transparent; color: var(--mz-text-subtle); display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 0.85rem; transition: all 150ms; padding: 0;
}
.adm-topbar-btn:hover { background: var(--mz-bg-subtle); color: var(--mz-text); }

/* ── Admin Content ───────────────────────────────────────────── */
.adm-content { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 1.25rem 1.5rem 2rem; }

/* ── Module Pane ─────────────────────────────────────────────── */
.adm-pane { animation: mz-fade-in 0.2s ease both; }
.adm-pane-hidden { display: none !important; }

.adm-page-header { margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--mz-border); display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.adm-page-title { font-size: var(--mz-text-2xl); font-weight: var(--mz-font-extrabold); letter-spacing: -0.02em; color: var(--mz-text); margin: 0 0 0.2rem; }
.adm-page-desc  { font-size: var(--mz-text-base); color: var(--mz-text-subtle); margin: 0; }
.adm-page-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* ── Metric Grid ─────────────────────────────────────────────── */
.adm-metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.adm-metric-group { margin-bottom: 1.5rem; }
.adm-metric-group-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--mz-text-muted); margin-bottom: 0.625rem; display: flex; align-items: center; gap: 0.35rem; }

.adm-metric {
  background: var(--mz-surface);
  border: 1px solid var(--mz-border-subtle);
  border-radius: var(--mz-radius-lg);
  padding: 0.875rem;
  box-shadow: var(--mz-shadow-xs);
  cursor: default;
  transition: box-shadow 180ms, transform 180ms;
  text-decoration: none;
  display: block;
}
.adm-metric:hover { box-shadow: var(--mz-shadow-sm); transform: translateY(-1px); }
.adm-metric-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; margin-bottom: 0.625rem; }
.adm-metric-value { font-size: var(--mz-text-2xl); font-weight: var(--mz-font-extrabold); letter-spacing: -0.02em; color: var(--mz-text); line-height: 1; margin-bottom: 0.2rem; }
.adm-metric-label { font-size: var(--mz-text-xs); font-weight: var(--mz-font-semibold); color: var(--mz-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.adm-metric-trend { display: flex; align-items: center; gap: 0.2rem; font-size: var(--mz-text-xs); font-weight: var(--mz-font-semibold); margin-top: 0.375rem; }
.adm-metric-trend.up   { color: var(--mz-success); }
.adm-metric-trend.down { color: var(--mz-danger); }
.adm-metric-trend.flat { color: var(--mz-text-muted); }

/* Metric color variants */
.adm-metric-icon.blue   { background: var(--mz-primary-50); color: var(--mz-primary-600); }
.adm-metric-icon.purple { background: var(--mz-secondary-100); color: var(--mz-secondary-600); }
.adm-metric-icon.green  { background: var(--mz-success-light); color: var(--mz-success-dark); }
.adm-metric-icon.yellow { background: var(--mz-warning-light); color: var(--mz-warning-dark); }
.adm-metric-icon.red    { background: var(--mz-danger-light); color: var(--mz-danger); }
.adm-metric-icon.sky    { background: var(--mz-info-light); color: var(--mz-info-dark); }
.adm-metric-icon.gray   { background: var(--mz-neutral-100); color: var(--mz-neutral-600); }

/* ── Admin Card ──────────────────────────────────────────────── */
.adm-card { background: var(--mz-surface); border: 1px solid var(--mz-border-subtle); border-radius: var(--mz-radius-lg); box-shadow: var(--mz-shadow-xs); overflow: hidden; margin-bottom: 1rem; }
.adm-card-header { padding: 0.875rem 1rem 0; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.adm-card-title  { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mz-text); margin: 0; }
.adm-card-body   { padding: 0.875rem 1rem; }
.adm-card-footer { padding: 0.625rem 1rem; background: var(--mz-bg-subtle); border-top: 1px solid var(--mz-border); display: flex; align-items: center; gap: 0.5rem; }

/* ── Admin Table ─────────────────────────────────────────────── */
.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.adm-table th { text-align: left; padding: 0.5rem 0.75rem; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mz-text-muted); border-bottom: 2px solid var(--mz-border); white-space: nowrap; background: var(--mz-bg-subtle); }
.adm-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--mz-border); vertical-align: middle; color: var(--mz-text); }
.adm-table tr:hover td { background: var(--mz-bg-subtle); }
.adm-table tr:last-child td { border-bottom: none; }
.adm-table .adm-table-actions { display: flex; gap: 0.25rem; }

/* ── Admin Badge ─────────────────────────────────────────────── */
.adm-badge { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.18rem 0.45rem; border-radius: var(--mz-radius-full); font-size: 0.65rem; font-weight: 700; white-space: nowrap; }
.adm-badge-primary { background: var(--mz-primary-100); color: var(--mz-primary-700); }
.adm-badge-success { background: var(--mz-success-light); color: var(--mz-success-dark); }
.adm-badge-warning { background: var(--mz-warning-light); color: var(--mz-warning-dark); }
.adm-badge-danger  { background: var(--mz-danger-light); color: var(--mz-danger); }
.adm-badge-info    { background: var(--mz-info-light); color: var(--mz-info-dark); }
.adm-badge-neutral { background: var(--mz-neutral-100); color: var(--mz-neutral-600); }

/* ── Admin Section ───────────────────────────────────────────── */
.adm-section { margin-bottom: 1.5rem; }
.adm-section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mz-text-muted); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.35rem; }
.adm-section-title::after { content:''; flex:1; height:1px; background:var(--mz-border); }

/* ── Admin Filter Bar ────────────────────────────────────────── */
.adm-filter-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.adm-filter-input { padding: 0.38rem 0.65rem; border: 1px solid var(--mz-border); border-radius: 7px; font-family: var(--mz-font-family); font-size: 0.8rem; color: var(--mz-text); background: var(--mz-surface); outline: none; }
.adm-filter-input:focus { border-color: var(--mz-primary-400); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.adm-filter-select { padding: 0.38rem 0.65rem; border: 1px solid var(--mz-border); border-radius: 7px; font-family: var(--mz-font-family); font-size: 0.8rem; color: var(--mz-text); background: var(--mz-surface); outline: none; cursor: pointer; }
.adm-filter-spacer { flex: 1; }

/* ── Admin Button ────────────────────────────────────────────── */
.adm-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.42rem 0.875rem; border-radius: 7px; font-family: var(--mz-font-family); font-size: 0.8rem; font-weight: 600; cursor: pointer; border: none; transition: all 150ms; text-decoration: none; white-space: nowrap; }
.adm-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.adm-btn-sm { padding: 0.28rem 0.6rem; font-size: 0.72rem; }
.adm-btn-primary { background: var(--mz-primary-600); color: #fff; }
.adm-btn-primary:hover { background: var(--mz-primary-700); }
.adm-btn-outline { background: transparent; color: var(--mz-text-subtle); border: 1px solid var(--mz-border); }
.adm-btn-outline:hover { background: var(--mz-bg-subtle); color: var(--mz-text); }
.adm-btn-danger { background: var(--mz-danger-light); color: var(--mz-danger-dark); border: 1px solid #fecaca; }
.adm-btn-danger:hover { background: var(--mz-danger); color: #fff; }

/* ── Admin Status ────────────────────────────────────────────── */
.adm-status-online  { color: var(--mz-success); }
.adm-status-warning { color: var(--mz-warning); }
.adm-status-offline { color: var(--mz-danger); }

/* ── Admin Empty State ───────────────────────────────────────── */
.adm-empty { text-align: center; padding: 3rem 2rem; }
.adm-empty-icon  { font-size: 2rem; color: var(--mz-neutral-300); margin-bottom: 0.75rem; }
.adm-empty-title { font-size: 0.9rem; font-weight: 700; color: var(--mz-text); margin-bottom: 0.375rem; }
.adm-empty-desc  { font-size: 0.8rem; color: var(--mz-text-subtle); }

/* ── Admin Log Entry ─────────────────────────────────────────── */
.adm-log { padding: 0.5rem 0; border-bottom: 1px solid var(--mz-border); display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.78rem; }
.adm-log:last-child { border-bottom: none; }
.adm-log-time  { color: var(--mz-text-muted); font-family: var(--mz-font-mono); font-size: 0.68rem; flex-shrink: 0; white-space: nowrap; }
.adm-log-event { color: var(--mz-text); flex: 1; }
.adm-log-user  { color: var(--mz-text-muted); font-size: 0.68rem; white-space: nowrap; }
.adm-log-error { background: var(--mz-danger-light); border-radius: 4px; padding: 0 0.25rem; }

/* ── Admin Settings Form ─────────────────────────────────────── */
.adm-settings-group { margin-bottom: 1.5rem; }
.adm-settings-group-title { font-size: 0.75rem; font-weight: 700; color: var(--mz-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; padding-bottom: 0.375rem; border-bottom: 1px solid var(--mz-border); }
.adm-settings-row { display: grid; grid-template-columns: 200px minmax(0,1fr) 180px; gap: 0.75rem; align-items: start; padding: 0.5rem 0; border-bottom: 1px solid var(--mz-border); }
.adm-settings-label { font-size: 0.8rem; font-weight: 600; color: var(--mz-text); padding-top: 0.35rem; }
.adm-settings-hint  { font-size: 0.7rem; color: var(--mz-text-muted); margin-top: 0.2rem; }
.adm-settings-input { padding: 0.38rem 0.65rem; border: 1px solid var(--mz-border); border-radius: 7px; font-family: var(--mz-font-family); font-size: 0.8rem; color: var(--mz-text); background: var(--mz-surface); width: 100%; outline: none; }
.adm-settings-input:focus { border-color: var(--mz-primary-400); }
.adm-settings-meta { font-size: 0.7rem; color: var(--mz-text-muted); padding-top: 0.35rem; }

/* ── Admin Health Card ───────────────────────────────────────── */
.adm-health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.adm-health-card { background: var(--mz-surface); border: 1px solid var(--mz-border-subtle); border-radius: var(--mz-radius-lg); padding: 1rem; display: flex; align-items: center; gap: 0.75rem; }
.adm-health-indicator { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.adm-health-ok      { background: var(--mz-success); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.adm-health-warn    { background: var(--mz-warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.adm-health-error   { background: var(--mz-danger); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.adm-health-label   { font-size: 0.8rem; font-weight: 600; color: var(--mz-text); }
.adm-health-sub     { font-size: 0.7rem; color: var(--mz-text-muted); }

/* ── Admin Tabs ──────────────────────────────────────────────── */
.adm-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--mz-border); margin-bottom: 1rem; overflow-x: auto; }
.adm-tab { padding: 0.5rem 0.875rem; font-size: 0.8rem; font-weight: 600; color: var(--mz-text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--mz-font-family); white-space: nowrap; transition: all 150ms; }
.adm-tab:hover { color: var(--mz-text); }
.adm-tab.is-active { color: var(--mz-primary-600); border-bottom-color: var(--mz-primary-600); }
.adm-tab-panel { display: none; }
.adm-tab-panel.is-active { display: block; }

/* ── Admin Stat Row (compact table-like) ─────────────────────── */
.adm-stat-row { display: flex; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--mz-border); gap: 0.75rem; font-size: 0.78rem; }
.adm-stat-row:last-child { border-bottom: none; }
.adm-stat-key   { color: var(--mz-text-subtle); flex: 1; }
.adm-stat-value { font-weight: 700; color: var(--mz-text); white-space: nowrap; }

/* ── Dark mode overrides ─────────────────────────────────────── */
html[data-theme='dark'] .adm-sidebar,
html[data-theme='dark'] .adm-topbar,
html[data-theme='dark'] .adm-card { background: var(--mz-surface); border-color: var(--mz-border); }
html[data-theme='dark'] .adm-nav-item.is-active { background: rgba(99,102,241,0.12); color: var(--mz-primary-400); }
html[data-theme='dark'] .adm-metric { background: var(--mz-surface); border-color: var(--mz-border); }
html[data-theme='dark'] .adm-table th { background: var(--mz-bg-subtle); }
html[data-theme='dark'] .adm-filter-input,
html[data-theme='dark'] .adm-filter-select,
html[data-theme='dark'] .adm-settings-input { background: var(--mz-surface); border-color: var(--mz-border); color: var(--mz-text); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .adm-shell { grid-template-columns: 48px minmax(0, 1fr); }
  .adm-sidebar { width: 48px; overflow: visible; }
  .adm-brand-title, .adm-brand-sub, .adm-nav-group-label,
  .adm-nav-item span:not(.adm-nav-badge), .adm-sidebar-footer,
  .adm-sidebar-search { display: none; }
  .adm-nav-item { justify-content: center; padding: 0.5rem; }
  .adm-nav-item.is-active::before { display: none; }
  .adm-settings-row { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   ADMIN CENTER PHASE 3 — Advanced Components
   Health Center, Observability, Feature Flags, Config, Jobs, Logs
═══════════════════════════════════════════════════════════════ */

/* ── Health Indicator ────────────────────────────────────────── */
.adm-health-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.adm-health-status.ok      { background: var(--mz-success-light); color: var(--mz-success-dark); }
.adm-health-status.warning { background: var(--mz-warning-light); color: var(--mz-warning-dark); }
.adm-health-status.error   { background: var(--mz-danger-light); color: var(--mz-danger); }
.adm-health-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.adm-health-status.ok::before      { background: var(--mz-success); animation: pulse-green 2s infinite; }
.adm-health-status.warning::before { background: var(--mz-warning); animation: pulse-yellow 2s infinite; }
.adm-health-status.error::before   { background: var(--mz-danger); animation: pulse-red 2s infinite; }

@keyframes pulse-green  { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulse-yellow { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulse-red    { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Health Monitor Card ─────────────────────────────────────── */
.adm-health-monitor {
  background: var(--mz-surface);
  border: 1px solid var(--mz-border-subtle);
  border-radius: var(--mz-radius-lg);
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}
.adm-health-monitor-left { display: flex; flex-direction: column; gap: 0.35rem; }
.adm-health-monitor-label { font-size: 0.78rem; font-weight: 600; color: var(--mz-text); }
.adm-health-monitor-meta { display: flex; gap: 1rem; font-size: 0.68rem; color: var(--mz-text-muted); }
.adm-health-monitor-value { font-family: var(--mz-font-mono); font-weight: 600; }
.adm-health-monitor-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }

/* ── Feature Flag Toggle ─────────────────────────────────────── */
.adm-flag-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--mz-border);
  border-radius: 8px;
  background: var(--mz-surface);
  transition: background 150ms;
}
.adm-flag-item:hover { background: var(--mz-bg-subtle); }
.adm-flag-content { flex: 1; min-width: 0; }
.adm-flag-name { font-size: 0.8rem; font-weight: 700; color: var(--mz-text); margin-bottom: 0.15rem; }
.adm-flag-desc { font-size: 0.72rem; color: var(--mz-text-subtle); margin-bottom: 0.3rem; }
.adm-flag-meta { display: flex; gap: 0.5rem; font-size: 0.65rem; }
.adm-flag-meta-item { display: flex; align-items: center; gap: 0.2rem; color: var(--mz-text-muted); }
.adm-flag-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--mz-neutral-200);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 150ms;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.adm-flag-toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 10px;
  top: 2px;
  left: 2px;
  transition: left 150ms;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.adm-flag-toggle.enabled { background: var(--mz-primary-600); }
.adm-flag-toggle.enabled::after { left: 22px; }

/* ── Config Group ────────────────────────────────────────────── */
.adm-config-group { margin-bottom: 1.5rem; }
.adm-config-group-title { font-size: 0.78rem; font-weight: 700; color: var(--mz-text); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--mz-border); }
.adm-config-row { display: grid; grid-template-columns: 160px minmax(0,1fr) 140px; gap: 0.75rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--mz-border); }
.adm-config-row:last-child { border-bottom: none; }
.adm-config-label { font-size: 0.78rem; font-weight: 600; color: var(--mz-text); }
.adm-config-input { padding: 0.35rem 0.6rem; border: 1px solid var(--mz-border); border-radius: 6px; font-family: var(--mz-font-family); font-size: 0.78rem; color: var(--mz-text); background: var(--mz-surface); outline: none; }
.adm-config-input:focus { border-color: var(--mz-primary-400); }
.adm-config-note { font-size: 0.65rem; color: var(--mz-text-muted); text-align: right; }

/* ── Job Queue ──────────────────────────────────────────────── */
.adm-job-item {
  padding: 0.65rem;
  border: 1px solid var(--mz-border);
  border-radius: 7px;
  background: var(--mz-surface);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 150ms;
}
.adm-job-item:hover { box-shadow: var(--mz-shadow-xs); }
.adm-job-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.adm-job-status-dot.pending   { background: var(--mz-warning); }
.adm-job-status-dot.running   { background: var(--mz-primary); animation: pulse-green 1.5s infinite; }
.adm-job-status-dot.success   { background: var(--mz-success); }
.adm-job-status-dot.failed    { background: var(--mz-danger); }
.adm-job-info { flex: 1; min-width: 0; }
.adm-job-name { font-size: 0.8rem; font-weight: 600; color: var(--mz-text); }
.adm-job-meta { font-size: 0.68rem; color: var(--mz-text-muted); }
.adm-job-time { font-size: 0.68rem; color: var(--mz-text-muted); white-space: nowrap; }
.adm-job-actions { display: flex; gap: 0.3rem; }

/* ── Timeline ────────────────────────────────────────────────── */
.adm-timeline {
  position: relative;
  padding-left: 1.5rem;
}
.adm-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--mz-border);
}
.adm-timeline-item {
  position: relative;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--mz-border);
}
.adm-timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.adm-timeline-dot {
  position: absolute;
  left: -10px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mz-primary-500);
  border: 2px solid var(--mz-surface);
}
.adm-timeline-dot.success { background: var(--mz-success); }
.adm-timeline-dot.warning { background: var(--mz-warning); }
.adm-timeline-dot.error   { background: var(--mz-danger); }
.adm-timeline-content { font-size: 0.78rem; }
.adm-timeline-label { font-weight: 600; color: var(--mz-text); margin-bottom: 0.15rem; }
.adm-timeline-time  { font-size: 0.65rem; color: var(--mz-text-muted); }

/* ── Advanced Filters ────────────────────────────────────────── */
.adm-filter-advanced {
  padding: 0.75rem;
  background: var(--mz-bg-subtle);
  border-radius: 8px;
  border: 1px solid var(--mz-border);
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}
.adm-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.adm-filter-label { font-size: 0.65rem; font-weight: 700; color: var(--mz-text-muted); text-transform: uppercase; }
.adm-filter-input, .adm-filter-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--mz-border);
  border-radius: 6px;
  font-family: var(--mz-font-family);
  font-size: 0.75rem;
  color: var(--mz-text);
  background: var(--mz-surface);
  outline: none;
}
.adm-filter-input:focus, .adm-filter-select:focus { border-color: var(--mz-primary-400); }

/* ── Metrics Chart ──────────────────────────────────────────── */
.adm-metric-chart {
  background: var(--mz-surface);
  border: 1px solid var(--mz-border-subtle);
  border-radius: var(--mz-radius-lg);
  padding: 1rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--mz-text-muted);
  font-size: 0.8rem;
}
.adm-metric-chart-placeholder { text-align: center; }
.adm-metric-chart-placeholder i { font-size: 1.5rem; margin-bottom: 0.5rem; opacity: 0.5; }

/* ── Alert Card ────────────────────────────────────────────── */
.adm-alert-card {
  background: var(--mz-danger-light);
  border: 1px solid #fecaca;
  border-radius: var(--mz-radius-lg);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.adm-alert-card.warning { background: var(--mz-warning-light); border-color: #fcd34d; }
.adm-alert-card.info    { background: var(--mz-info-light); border-color: #93c5fd; }
.adm-alert-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.2);
  color: var(--mz-danger);
}
.adm-alert-card.warning .adm-alert-card-icon { background: rgba(245, 158, 11, 0.2); color: var(--mz-warning); }
.adm-alert-card.info .adm-alert-card-icon    { background: rgba(59, 130, 246, 0.2); color: var(--mz-info); }
.adm-alert-card-content { flex: 1; }
.adm-alert-card-title { font-size: 0.78rem; font-weight: 700; color: var(--mz-text); margin-bottom: 0.15rem; }
.adm-alert-card-desc  { font-size: 0.75rem; color: var(--mz-text-subtle); }

/* ── Notification Center ────────────────────────────────────── */
.adm-notif-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.adm-notif-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.adm-notif-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mz-text);
}
.adm-notif-hint {
  font-size: 0.68rem;
  color: var(--mz-text-muted);
}
.adm-notif-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--mz-border);
  border-radius: 7px;
  font-family: var(--mz-font-family);
  font-size: 0.8rem;
  color: var(--mz-text);
  background: var(--mz-surface);
  outline: none;
  resize: vertical;
  min-height: 80px;
}
.adm-notif-input:focus {
  border-color: var(--mz-primary-400);
}
.adm-notif-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}
.adm-notif-channel {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--mz-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms;
  font-size: 0.75rem;
}
.adm-notif-channel:hover { background: var(--mz-bg-subtle); }
.adm-notif-channel input[type="checkbox"] { cursor: pointer; }

/* ── Command Palette ────────────────────────────────────────── */
.adm-command-palette {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  background: var(--mz-surface);
  border: 1px solid var(--mz-border);
  border-radius: var(--mz-radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  display: none;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}
.adm-command-palette.is-open { display: flex; }
.adm-command-input {
  padding: 0.875rem 1rem;
  border: none;
  border-bottom: 1px solid var(--mz-border);
  font-family: var(--mz-font-family);
  font-size: 0.9rem;
  color: var(--mz-text);
  background: transparent;
  outline: none;
}
.adm-command-input::placeholder { color: var(--mz-text-muted); }
.adm-command-results {
  flex: 1;
  overflow-y: auto;
  max-height: calc(80vh - 50px);
}
.adm-command-result-group { padding: 0.5rem 0; }
.adm-command-result-group-label {
  padding: 0.5rem 1rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--mz-text-muted);
  text-transform: uppercase;
}
.adm-command-result-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 150ms;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--mz-border-subtle);
}
.adm-command-result-item:hover { background: var(--mz-bg-subtle); }
.adm-command-result-item-label { font-weight: 600; color: var(--mz-text); margin-bottom: 0.1rem; }
.adm-command-result-item-desc  { font-size: 0.7rem; color: var(--mz-text-muted); }

/* ── AI Chat Interface ──────────────────────────────────────── */
.adm-ai-chat {
  display: flex;
  flex-direction: column;
  height: 500px;
  background: var(--mz-surface);
  border: 1px solid var(--mz-border-subtle);
  border-radius: var(--mz-radius-lg);
  overflow: hidden;
}
.adm-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.adm-ai-message {
  display: flex;
  gap: 0.5rem;
  max-width: 85%;
}
.adm-ai-message.user { align-self: flex-end; flex-direction: row-reverse; }
.adm-ai-message.assistant { align-self: flex-start; }
.adm-ai-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
  background: var(--mz-primary-100);
  color: var(--mz-primary-600);
}
.adm-ai-message.user .adm-ai-avatar { background: var(--mz-neutral-200); color: var(--mz-text); }
.adm-ai-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  background: var(--mz-bg-subtle);
  color: var(--mz-text);
  word-break: break-word;
}
.adm-ai-message.user .adm-ai-bubble { background: var(--mz-primary-600); color: white; }
.adm-ai-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--mz-border);
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
.adm-ai-input {
  flex: 1;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--mz-border);
  border-radius: 6px;
  font-family: var(--mz-font-family);
  font-size: 0.78rem;
  color: var(--mz-text);
  background: var(--mz-surface);
  outline: none;
  resize: none;
  min-height: 32px;
  max-height: 100px;
}
.adm-ai-input:focus { border-color: var(--mz-primary-400); }
.adm-ai-send {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--mz-primary-600);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background 150ms;
}
.adm-ai-send:hover { background: var(--mz-primary-700); }
.adm-ai-loading {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}
.adm-ai-loading-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mz-text-muted);
  animation: bounce 1.4s infinite;
}
.adm-ai-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.adm-ai-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* ── Responsive adjustments ────────────────────────────────── */
@media (max-width: 1024px) {
  .adm-config-row { grid-template-columns: 1fr; }
  .adm-health-monitor { grid-template-columns: 1fr; }
  .adm-command-palette { width: 95%; max-width: 90vw; }
  .adm-ai-chat { height: 400px; }
}
