/* === Dashboard Layout === */
:root {
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 72px;
  --sidebar-bg: #0b0b14;
  --sidebar-hover: #1c1c30;
  --sidebar-active: #6366f1;
  --sidebar-text: #6b6b8d;
  --sidebar-text-hover: #f0f0f5;
  --topbar-bg: #12121e;
  --topbar-border: #1e1e30;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.15);
}

.private-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 100vh;
  background: var(--pico-background-color, #13131f);
}

/* === Sidebar (collapsed by default, opens on hover) === */
.sidebar {
  width: var(--sidebar-collapsed-width);
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  z-index: 20;
}

.sidebar:hover,
.sidebar.pinned {
  width: var(--sidebar-width);
}

.sidebar:not(:hover):not(.pinned) {
  transition-delay: 0.15s;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
  min-height: 64px;
  transition: padding 0.25s ease, justify-content 0.25s ease;
}

.sidebar:hover .sidebar-header,
.sidebar.pinned .sidebar-header {
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #f0f0f5;
  overflow: hidden;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.brand-text,
.nav-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  display: inline-block;
  white-space: nowrap;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}

.sidebar:hover .brand-text,
.sidebar.pinned .brand-text,
.sidebar:hover .nav-label,
.sidebar.pinned .nav-label {
  max-width: 200px;
  opacity: 1;
  transition-delay: 0.05s;
}

.sidebar-brand {
  gap: 0;
  transition: gap 0.25s ease;
}

.sidebar:hover .sidebar-brand,
.sidebar.pinned .sidebar-brand {
  gap: 0.75rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.sidebar:hover .sidebar-toggle,
.sidebar.pinned .sidebar-toggle {
  display: flex;
}

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

.toggle-icon {
  transition: transform 0.3s ease;
}

.sidebar.pinned .toggle-icon {
  transform: rotate(45deg);
}

/* === Sidebar Navigation === */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  transition: padding 0.25s ease;
  justify-content: unset;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0 !important;
  padding: 0;
  display: block;
}

.sidebar-nav li {
  padding: 0 !important;
  display: block;
  margin: 0;
  text-align: center;
}

.sidebar:hover .sidebar-nav li,
.sidebar.pinned .sidebar-nav li {
  text-align: left;
}

.sidebar-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 !important;
  padding: 0.65rem 0.375rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 450;
  transition: background 0.2s, color 0.2s, padding 0.25s ease, gap 0.25s ease;
  white-space: nowrap;
  position: relative;
  box-sizing: border-box;
}

.sidebar:hover .sidebar-nav a,
.sidebar.pinned .sidebar-nav a {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem 0.65rem calc(0.75rem + 5px);
  width: 100%;
}

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

.sidebar-nav li.active a {
  background: var(--accent-glow);
  color: #fff;
}

.sidebar-nav li.active a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: left 0.25s ease;
}

.sidebar:hover .sidebar-nav li.active a::before,
.sidebar.pinned .sidebar-nav li.active a::before {
  left: 0.375rem;
}

.nav-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-icon svg {
  display: block;
}

/* === Sidebar Footer === */
.sidebar-footer {
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
  transition: padding 0.25s ease;
}

.sidebar:hover .sidebar-footer,
.sidebar.pinned .sidebar-footer {
  padding: 0.5rem;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.65rem 0;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s, padding 0.25s ease, justify-content 0.25s ease, gap 0.25s ease;
  white-space: nowrap;
}

.sidebar:hover .sidebar-footer a,
.sidebar.pinned .sidebar-footer a {
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
}

.sidebar-footer a:hover {
  background: rgba(233, 69, 96, 0.12);
  color: #e94560;
}

/* === Main Wrapper === */
.main-wrapper {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-width: 0;
}

/* === Topbar === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
  min-height: 64px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
}

.topbar-menu-toggle:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #f0f0f5;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-email {
  font-size: 0.8rem;
  color: var(--sidebar-text);
  font-weight: 450;
}

.topbar-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.topbar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.topbar-search-form {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0.25rem;
}

.topbar-search-input,
.topbar-search-input:focus,
.topbar-search-input:focus-visible {
  background-color: var(--sidebar-hover) !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f0f0f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.7'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: 0.85rem center !important;
  background-size: 14px 14px !important;
}

.topbar-search-input {
  border: 1px solid var(--topbar-border) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: #f0f0f5 !important;
  font-size: 0.8rem !important;
  padding: 0.4rem 0.9rem 0.4rem 2.1rem !important;
  margin: 0 !important;
  width: 220px;
  height: auto !important;
  min-height: 0 !important;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, width 0.2s;
}

.topbar-search-input::-webkit-search-decoration,
.topbar-search-input::-webkit-search-cancel-button,
.topbar-search-input::-webkit-search-results-button,
.topbar-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

.topbar-search-input::placeholder {
  color: var(--sidebar-text);
  opacity: 1;
}

.topbar-search-input:focus,
.topbar-search-input:focus-visible {
  border-color: #6366f1 !important;
  box-shadow: none !important;
  outline: none !important;
  width: 280px;
}

@media (max-width: 768px) {
  .topbar-search-input {
    width: 140px;
  }
  .topbar-search-input:focus {
    width: 180px;
  }
}

/* === Search results === */
.search-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.search-page .search-summary {
  color: var(--sidebar-text);
  margin: 0;
  flex-shrink: 0;
}
.search-page .search-summary strong {
  color: #f0f0f5;
}

.search-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.search-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}
.search-badge:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.search-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-text);
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  scroll-margin-top: 80px;
}
.search-section-title:first-of-type {
  margin-top: 0;
}
.search-section-count {
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.25rem;
  opacity: 0.7;
}

.search-section {
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
}

.search-list,
.search-list li {
  list-style: none !important;
}
.search-list {
  padding: 0 !important;
  margin: 0 !important;
}
.search-list li::before,
.search-list li::marker {
  content: none !important;
  display: none !important;
}

.search-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.search-item:last-child {
  border-bottom: none;
}

.search-item-livre {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.search-item-cover {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  display: block;
}
.search-item-cover-empty {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}
.search-item-body {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  color: #f0f0f5;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
a.search-item-title:hover {
  color: #6366f1;
}

.search-item-meta {
  color: var(--sidebar-text);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.pepite-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.pepite-badge-shared {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}
.pepite-badge-private {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* === Content Area === */
.content {
  padding: 2rem;
  overflow-y: auto;
}

/* === Private Footer === */
.private-footer {
  padding: 1rem 2rem;
  font-size: 0.75rem;
  color: var(--sidebar-text);
  border-top: 1px solid rgba(255,255,255,0.04);
  text-align: center;
}

.private-footer p {
  margin: 0;
}

/* === Theme Switcher === */
.theme-switcher {
  position: relative;
}

.theme-switcher .theme-switcher-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.theme-switcher .theme-switcher-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin: 4px 0 0;
  padding: 0;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  min-width: 100px;
  z-index: 50;
  list-style: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  overflow: hidden;
}

.theme-switcher.open .theme-switcher-menu {
  display: block;
}

.theme-switcher-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-switcher-menu li::before {
  display: none;
  content: none;
}

.theme-switcher-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--sidebar-text);
  text-decoration: none;
  white-space: nowrap;
  text-align: left;
}

.theme-switcher-menu a:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

/* === Sidebar Overlay (mobile) === */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 15;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* === Dashboard Stats Cards === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.stat-card-link:hover .stat-card {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s, background 0.2s;
}

.stat-card:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

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

.stat-card-label {
  font-size: 0.8rem;
  color: var(--sidebar-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f0f0f5;
  line-height: 1;
}

.stat-card-change {
  font-size: 0.75rem;
  color: #2ecc71;
}

.stat-card--soon {
  opacity: 0.55;
}

.stat-card-link:hover .stat-card--soon {
  opacity: 0.85;
}

.stat-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-text);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  line-height: 1;
}

/* === Dashboard Section === */
.dashboard-section {
  margin-bottom: 2rem;
}

.dashboard-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f0f0f5;
  margin-bottom: 1rem;
}

.dashboard-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.5rem;
}

.dashboard-card p {
  color: var(--sidebar-text);
  margin: 0;
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-width) !important;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    transition-delay: 0s !important;
  }

  .sidebar:hover,
  .sidebar.pinned {
    width: var(--sidebar-width) !important;
  }

  .private-layout[data-sidebar="mobile-open"] .sidebar {
    transform: translateX(0);
  }

  .private-layout[data-sidebar="mobile-open"] .brand-text,
  .private-layout[data-sidebar="mobile-open"] .nav-label {
    max-width: 200px;
    opacity: 1;
  }

  .private-layout[data-sidebar="mobile-open"] .sidebar-nav a,
  .private-layout[data-sidebar="mobile-open"] .sidebar-footer a {
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
  }

  .private-layout[data-sidebar="mobile-open"] .sidebar-brand {
    gap: 0.75rem;
  }

  .private-layout[data-sidebar="mobile-open"] .sidebar-header {
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }



  .private-layout[data-sidebar="mobile-open"] .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  .topbar-menu-toggle {
    display: flex;
  }

  .sidebar-toggle {
    display: flex !important;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .content {
    padding: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .user-email {
    display: none;
  }
}

/* === Scrollbar Styling === */
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* === Toolbar === */
.toolbar {
  margin-bottom: 1.5rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.85;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--sidebar-text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: #fff;
}

.btn-success {
  background: #2ecc71;
  color: #fff;
}

.btn-success:hover {
  opacity: 0.85;
  color: #fff;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.85;
  color: #fff;
}

.btn-small {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
}

/* === Data Table === */
.data-table {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

.data-table-header,
.data-table-row {
  display: grid;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.data-table-header {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-text);
  border-radius: 12px 12px 0 0;
}

.data-table-header .col-count,
.data-table-header .col-count-left,
.data-table-header .col-auteur,
.data-table-header .col-isbn {
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.data-table-row {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}

.data-table-row:last-child {
  border-bottom: none;
  border-radius: 0 0 12px 12px;
}

.data-table-row:hover {
  background: rgba(255,255,255,0.03);
}

.col-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.col-auteur {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  color: #f0f0f5;
  text-align: left;
}

.col-count {
  text-align: center;
  font-size: 0.85rem;
  color: #f0f0f5;
}

.col-count-left {
  text-align: left;
  font-size: 0.85rem;
  color: #f0f0f5;
}

.col-isbn {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  color: #f0f0f5;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-actions {
  text-align: center;
  position: relative;
}

/* === Data Table Grid layouts === */

.data-table-books .data-table-header,
.data-table-books .data-table-row {
  grid-template-columns: 1fr 3rem 8rem 8rem 3rem 3rem 1rem;
}

.data-table-books .data-table-row {
  align-items: start;
}

.data-table-themes {
  --pepite-cols: 5;
}
.data-table-themes .data-table-header,
.data-table-themes .data-table-row {
  grid-template-columns: 1fr 4rem repeat(var(--pepite-cols), 5rem) 1rem;
}

.col-count-pepite {
  opacity: 0.65;
  font-size: 0.85em;
}
.col-count-pepite .count-badge {
  opacity: 1;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(99,102,241,0.2);
  color: var(--accent, #6366f1);
  vertical-align: middle;
  line-height: 1;
}
.count-badge.is-complete {
  background: #2ecc71;
  color: #fff;
  font-weight: 700;
}
.count-badge.is-partial {
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
}
a.count-badge {
  text-decoration: none;
  transition: filter 0.1s, transform 0.1s;
}
a.count-badge:hover {
  filter: brightness(1.15);
  transform: scale(1.08);
  text-decoration: none;
}

.data-table-pepite-videos .data-table-header,
.data-table-pepite-videos .data-table-row,
.data-table-pepite-podcasts .data-table-header,
.data-table-pepite-podcasts .data-table-row {
  grid-template-columns: 1fr 12rem 6rem 1rem;
}

.data-table-pepite-videos .data-table-row,
.data-table-pepite-podcasts .data-table-row,
.data-table-pepite-articles .data-table-row {
  align-items: start;
}

.data-table-pepite-articles .data-table-header,
.data-table-pepite-articles .data-table-row {
  grid-template-columns: 1fr 1rem;
}

.data-table-pepite-videos .col-name,
.data-table-pepite-podcasts .col-name,
.data-table-pepite-articles .col-name {
  position: relative;
  padding-right: 4.5rem;
}

.data-table-pepite-videos .cover-thumb,
.data-table-pepite-podcasts .cover-thumb,
.data-table-pepite-articles .cover-thumb {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  width: auto;
  border-radius: 3px;
  cursor: pointer;
}

.data-table-pepite-astuces .data-table-header,
.data-table-pepite-astuces .data-table-row {
  grid-template-columns: 1fr 30rem 1rem;
}

.data-table-pepite-astuces .data-table-row {
  align-items: start;
}

/* Pill badges partagés : theme, kind, duree, like sm, +badge auteur circulaire */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.65rem;
  line-height: 1;
  border-radius: 20px;
  box-sizing: border-box;
  min-height: 1.05rem;
  vertical-align: middle;
  text-decoration: none;
  border: none;
  font-family: inherit;
  margin: 0;
  white-space: nowrap;
}
button.pill-badge {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* Variants couleur */
.pill-theme       { background: rgba(99,102,241,0.15);  color: #6366f1; }
.pill-kind-show   { background: rgba(139,92,246,0.15);  color: #a78bfa; }
.pill-kind-ep     { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.pill-duree       { background: rgba(46,204,113,0.15);  color: #2ecc71; }
.pill-like-liked  { background: rgba(46,204,113,0.15);  color: #2ecc71; }
.pill-like-unliked{ background: rgba(167,139,250,0.15); color: #a78bfa; }
.pill-warning     { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.pill-owned       { background: rgba(99,102,241,0.15);  color: #6366f1; }
.pill-cta-green   { background: #2ecc71; color: #fff; cursor: pointer; }
.pill-cta-green:hover { filter: brightness(1.1); }

/* Like button md (show) — bouton outlined, plus prominent */
.like-btn-md {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  border: 1px solid;
  box-sizing: border-box;
  vertical-align: middle;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}
.like-btn-md.is-liked   { color: #2ecc71; border-color: #2ecc71; }
.like-btn-md.is-unliked { color: #a78bfa; border-color: #a78bfa; }
.like-btn-md.is-liked svg { fill: currentColor; }
.like-btn-md.is-unliked svg { fill: none; }

/* Like owner md (badge lecture seule sur show quand créateur) */
.like-owner-md {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--sidebar-text);
  font-size: 0.85rem;
}
.like-owner-md svg { fill: #2ecc71; stroke: #2ecc71; }
.like-owner-md strong { color: #f0f0f5; }

/* Like button sm (list) — état liké/non-liké via classes .is-liked/.is-unliked */
.like-btn-sm.is-liked   svg { fill: currentColor; }
.like-btn-sm.is-unliked svg { fill: none; }

.data-table-pepite-citations .data-table-header,
.data-table-pepite-citations .data-table-row {
  grid-template-columns: 1fr 12rem 1rem;
}

.data-table-pepite-citations .data-table-row {
  align-items: start;
}

.data-table-pepite-partages .data-table-header,
.data-table-pepite-partages .data-table-row {
  grid-template-columns: 1fr 8rem 1rem;
}

.data-table-user-themes .data-table-header,
.data-table-user-themes .data-table-row {
  grid-template-columns: 1fr 7rem;
}

.data-table-exemplaires .data-table-header,
.data-table-exemplaires .data-table-row {
  grid-template-columns: 1fr 6rem 7rem 9rem 1rem;
}

.data-table-contacts .data-table-header,
.data-table-contacts .data-table-row {
  grid-template-columns: 1fr 12rem 6rem 5rem 5rem 1rem;
}

.data-table-loans .data-table-header,
.data-table-loans .data-table-row {
  grid-template-columns: 1fr 12rem 7rem 7rem 7rem 1rem;
}

.data-table-reviews .data-table-header,
.data-table-reviews .data-table-row {
  grid-template-columns: 1fr 4rem 8rem 7rem 1rem;
}

.data-table-admin-users .data-table-header,
.data-table-admin-users .data-table-row {
  grid-template-columns: 3rem 1fr 4rem 4rem 5rem 5rem 4rem 4rem 1rem;
}

.btn-toggle-bool {
  all: unset;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  transition: transform 0.1s, background 0.15s;
  line-height: 1;
}
.btn-toggle-bool:hover {
  transform: scale(1.15);
  background: rgba(255,255,255,0.06);
}
.btn-toggle-bool.is-true { color: #2ecc71; }
.btn-toggle-bool.is-false { color: #6366f1; }
.btn-toggle-bool:disabled { opacity: 0.5; cursor: wait; transform: none; }

.data-table-notifications .data-table-header,
.data-table-notifications .data-table-row {
  grid-template-columns: 1fr 7rem 5rem;
}

/* Favorite star inline in col-name */
.fav-star {
  font-size: 1rem;
  text-decoration: none;
  color: #f1c40f;
  transition: transform 0.15s;
  display: inline-flex;
  align-items: center;
}

.fav-star:hover {
  transform: scale(1.25);
}

/* Theme name in list */
.theme-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f0f0f5;
}

.theme-breadcrumb {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  opacity: 0.5;
  margin-left: 0.35rem;
}

/* 3-dots dropdown */
.dropdown-actions {
  display: inline-block;
  margin: 0;
  position: relative;
  height: 32px;
}

.dropdown-actions summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--sidebar-text);
  transition: background 0.15s, color 0.15s;
}

.dropdown-actions summary::-webkit-details-marker {
  display: none;
}

.dropdown-actions summary::marker {
  display: none;
  content: '';
}

.dropdown-actions summary::after {
  display: none;
}

.dropdown-actions summary:hover,
.dropdown-actions[open] summary {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.dropdown-actions[open] ul {
  position: absolute;
  right: 0;
  top: 100%;
  margin: 4px 0 0;
  padding: 0;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  min-width: 130px;
  z-index: 50;
  list-style: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  overflow: hidden;
}

.dropdown-actions[open] ul li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dropdown-actions[open] ul li::before {
  display: none;
  content: none;
}

.dropdown-actions[open] ul a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--sidebar-text);
  text-decoration: none;
  white-space: nowrap;
  text-align: left;
}

.dropdown-actions[open] ul a:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

/* === Suggestion Cards === */
.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.suggestion-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem;
}

.suggestion-main h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f0f0f5;
  margin: 0 0 0.25rem;
}

.suggestion-main p {
  color: var(--sidebar-text);
  font-size: 0.85rem;
  margin: 0 0 0.25rem;
}

.suggestion-meta {
  color: var(--sidebar-text);
  opacity: 0.5;
  font-size: 0.75rem;
}

.suggestion-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* === Form Global === */
.content label,
.content input,
.content select,
.content textarea {
  font-size: 0.85rem;
}

.content input[type="checkbox"] {
  appearance: auto;
  width: auto;
  height: auto;
  accent-color: var(--primary, #6366f1);
}

/* === Dropzone === */
.dropzone {
  width: 100%;
  aspect-ratio: 2/3;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-text, #aaa);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
  user-select: none;
}
.dropzone:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.05);
}
.dropzone-dragover {
  border-color: var(--accent, #6366f1);
  background: rgba(99,102,241,0.1);
}
.dropzone-uploading {
  border-color: var(--accent, #6366f1);
  background: rgba(99,102,241,0.08);
  cursor: default;
  opacity: 0.7;
}
.dropzone-error {
  border-color: #e74c3c;
  background: rgba(231,76,60,0.08);
}
.dropzone:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
}

/* Cover card — allows image+dropzone swap */
.cover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cover-card img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 6px;
}

/* Cover thumbnail in book list + loan list */
.data-table-books .col-name,
.data-table-loans .col-name {
  position: relative;
  padding-right: 4.5rem;
}
.cover-thumb {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 54px;
  width: auto;
  border-radius: 3px;
  cursor: pointer;
}
.data-table-loans .cover-thumb {
  height: 40px;
}

/* === Form Container === */
.form-container {
  max-width: 600px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 2rem;
}

/* === Letter Filter (A-Z) === */
.letter-filter {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.letter-filter a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.letter-filter a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.letter-filter a.active {
  background: var(--accent);
  color: #fff;
}

.letter-filter a.has-content {
  background: rgba(255, 255, 255, 0.08);
}

.letter-filter a.has-content:hover {
  background: var(--sidebar-hover);
}

.letter-filter a.has-content.active {
  background: var(--accent);
}

/* === Badge Counter === */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.35rem;
}

.badge-muted {
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-text);
}

.badge-warning {
  background: #f59e0b;
  color: #000;
}

.badge-loan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.45rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.badge-loan-none {
  background: rgba(255,255,255,0.08);
  color: var(--sidebar-text);
}

.badge-loan-ok {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.badge-loan-warn {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

/* === Empty State === */
.empty {
  color: var(--sidebar-text);
  opacity: 0.5;
  font-style: italic;
  display: block;
  width: 100%;
  text-align: center;
  padding: 1rem 0;
}

/* === Theme Tree === */
.spacer {
  margin-left: auto;
}

.theme-tree-arrow {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  opacity: 0.5;
  margin-right: 0.25rem;
}

.badge-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  margin-right: 0.35rem;
  transform: translateY(10px);
}

.badge-toggle:hover {
  background: #7c5cfc;
}

.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  border-radius: 3px;
  line-height: 1;
}

.toggle-icon i {
  font-size: 0.7rem;
}

.toggle-icon.collapsed {
  background: transparent;
}

.toggle-icon:not(.collapsed) {
  background: rgba(0,0,0,0.2);
}

.btn-add-subtheme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #198754;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-add-subtheme:hover {
  background: #157347;
  color: #fff;
}

.btn-suggest-subtheme {
  font-size: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.btn-suggest-subtheme:hover {
  text-decoration: underline;
}



/* === Notification Badge === */
.notif-badge {
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  line-height: 1.3;
  min-width: 18px;
  text-align: center;
}


/* =========================================================
   BetterB — additions (login, flash) — hors Pépites base
   ========================================================= */

/* === Flash messages === */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid;
  background: var(--sidebar-hover);
}
.flash svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }
.flash-success {
  border-color: #2ecc71;
  color: #6fdf9a;
  background: rgba(46, 204, 113, 0.08);
}
.flash-error {
  border-color: #e74c3c;
  color: #f8a29c;
  background: rgba(231, 76, 60, 0.08);
}
.flash-warning {
  border-color: #f39c12;
  color: #f8c775;
  background: rgba(243, 156, 18, 0.08);
}

/* === Login page (standalone, hors layout admin) === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.12), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.06), transparent 50%),
    var(--pico-background-color, #13131f);
}
.login-card {
  width: 100%;
  max-width: 460px;
  background: #12121e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 2.5rem 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.login-brand-logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 56px;
  height: auto;
}
.login-subtitle {
  text-align: center;
  color: #6b6b8d;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  font-weight: 500;
}
.login-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #d4d4e0;
  margin-bottom: 0.4rem;
}
.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  color: #000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.login-card input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1a1a2e;
  box-shadow: 0 0 0 1000px #eef2ff inset;
  transition: background-color 5000s ease-in-out 0s;
}
.login-card button[type="submit"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  margin-top: 0.5rem;
  font-family: inherit;
}
.login-card button[type="submit"]:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}
.login-error {
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #f8a29c;
  border-radius: 8px;
  font-size: 0.85rem;
}
.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #6b6b8d;
}

/* === Dashboard header (au-dessus des stats) === */
.dashboard-header {
  margin-bottom: 2rem;
}
.dashboard-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: #f0f0f5;
}
.dashboard-header p {
  color: #7d7d9d;
  margin: 0;
  font-size: 0.95rem;
}


/* === Data Table Grid layouts (BetterB) === */
.data-table-domaines .data-table-header,
.data-table-domaines .data-table-row {
  grid-template-columns: 1fr 12rem 5rem 5rem 5rem 4rem 1rem;
}


/* === Form grid (2 colonnes) === */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.25rem;
  align-items: start;
}
.form-grid > .form-full {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* === Card upsell : liste de checkboxes (EntityType multiple+expanded)
   Symfony rend input et label directement enfants du container (pas de wrapper
   par option). On utilise un CSS grid 2 colonnes (auto | 1fr) qui aligne
   chaque paire input+label sur une ligne. Les !important battent les defauts
   Pico (label display:block, input width:100%). */
.upsell-checkbox-card [id$="_upsellProducts"],
.upsell-checkbox-card [id$="_upsellConseils"] {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
}
.upsell-checkbox-card [id$="_upsellProducts"] input[type="checkbox"],
.upsell-checkbox-card [id$="_upsellConseils"] input[type="checkbox"] {
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
}
.upsell-checkbox-card [id$="_upsellProducts"] label,
.upsell-checkbox-card [id$="_upsellConseils"] label {
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  font-size: 0.9rem;
  color: #d4d4e0;
  line-height: 1.4;
  display: block;
}


/* === Reset button.btn (Pico override) ===
   Pico style les <button> par défaut, ce qui casse l'alignement avec les <a class="btn">.
   Ce bloc force la parité visuelle. */
button.btn {
  background: transparent;
  color: inherit;
  font-family: inherit;
  height: auto;
  margin: 0;
  border: 1px solid transparent;
}
button.btn.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
button.btn.btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
}
button.btn.btn-outline {
  background: transparent;
  color: #d4d4e0;
  border-color: rgba(255, 255, 255, 0.12);
}
button.btn.btn-outline:hover {
  background: var(--sidebar-hover);
  color: #f0f0f5;
  border-color: rgba(255, 255, 255, 0.2);
}


/* === Show field (pattern d'affichage d'un attribut dans un show, aligné sur .form-grid) === */
.show-field {
  padding: 0.5rem 0 1rem;
}
.show-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7d7d9d;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.show-value {
  color: #f0f0f5;
  font-size: 0.95rem;
  line-height: 1.5;
}


/* === Form grid 3 colonnes (utilisé notamment dans les show) === */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.form-grid-3 > .form-full {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .form-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}


/* === Status badges (actif / inactif) — sémantiques BetterB === */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}
.badge-active {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}
.badge-inactive {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}


/* === Count badges (0 = jaune, sinon vert) === */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.25rem;
  padding: 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.count-badge.is-empty {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.count-badge.is-filled {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}
.count-badge.is-danger {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}


/* === Badge position module cliquable (raccourci vers edit dans le tableau Programme) === */
.module-position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.15s, filter 0.15s;
}
.module-position-badge:hover {
  transform: scale(1.1);
  filter: brightness(1.15);
  color: #fff;
  text-decoration: none;
}


/* === Vignette vidéo cliquable (data-tables + modules) === */
.video-thumb-btn {
  display: inline-block;
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  transition: transform 0.15s;
}
.video-thumb-btn:hover {
  transform: scale(1.03);
}
.video-thumb {
  width: 100px;
  height: 56px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.video-thumb-placeholder {
  background: linear-gradient(135deg, #1a1a2e, #0b0b14);
  border: 1px solid rgba(255,255,255,0.06);
}
.video-thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  pointer-events: none;
  transition: background 0.15s;
}
.video-thumb-btn:hover .video-thumb-play {
  background: var(--accent);
}


/* === Modale lecteur vidéo === */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.video-modal[hidden] {
  display: none;
}
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(2px);
}
.video-modal-panel {
  position: relative;
  max-width: 90vw;
  width: 960px;
  background: #12121e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.video-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #f0f0f5;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.video-modal-close:hover {
  background: rgba(255,255,255,0.08);
}
.video-modal-title {
  color: #f0f0f5;
  font-size: 1rem;
  font-weight: 500;
  margin: 0 2rem 0.75rem 0;
  padding-right: 1rem;
}
.video-modal-embed {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.video-modal-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}


/* === Form help text (compact & discret) — Symfony rend un <div class="help-text"> === */
.help-text,
small.help-block,
.form-help {
  display: block;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--sidebar-text);
  margin-top: 0.2rem;
  margin-bottom: 0;
  opacity: 0.8;
}


/* === Toasts (flashes) — bas à droite, auto-hide, animations === */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
  width: calc(100vw - 3rem);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #1a1a26;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--sidebar-text);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  color: #f0f0f5;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(1.5rem);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.toast.is-leaving {
  opacity: 0;
  transform: translateX(1.5rem);
}
.toast-success { border-left-color: #2ecc71; }
.toast-error   { border-left-color: #e74c3c; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info    { border-left-color: var(--accent); }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.toast-icon svg { width: 20px; height: 20px; stroke-width: 1.75; }
.toast-success .toast-icon { color: #2ecc71; }
.toast-error   .toast-icon { color: #e74c3c; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info    .toast-icon { color: var(--accent); }

.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #f0f0f5;
  margin-bottom: 0.1rem;
}
.toast-message {
  color: #d4d4e0;
  font-size: 0.85rem;
  line-height: 1.4;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.toast-close:hover {
  opacity: 1;
  color: #f0f0f5;
}
.toast-close svg { width: 16px; height: 16px; }


/* === Dropdown actions — support <button> (aligne sur <a>) === */
.dropdown-actions[open] ul button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--sidebar-text);
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
}
.dropdown-actions[open] ul button:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.dropdown-actions[open] ul form {
  margin: 0;
}


/* === Thèmes - grid table === */
.data-table-themes .data-table-header,
.data-table-themes .data-table-row {
  grid-template-columns: 1fr 5rem 5rem 4rem 1rem;
}


/* === Data-tables scopées (sous-listes dans les show) === */
.data-table-themes-of-domaine .data-table-header,
.data-table-themes-of-domaine .data-table-row {
  grid-template-columns: 1fr 5rem 5rem 4rem 1rem;
}
.data-table-pages-of-domaine .data-table-header,
.data-table-pages-of-domaine .data-table-row {
  grid-template-columns: 1fr 5rem 5rem 1rem;
}
.data-table-pages-of-theme .data-table-header,
.data-table-pages-of-theme .data-table-row {
  grid-template-columns: 1fr 5rem 4rem 1rem;
}


/* === Pages - grid tables === */
.data-table-pages .data-table-header,
.data-table-pages .data-table-row {
  grid-template-columns: 1fr 5rem 5rem 1rem;
}

/* === Formations - grid table ===
   Colonnes : Titre (thumb + nom/slug/thème empilés) | Durée | Position | Publiée | Actions */
.data-table-formations .data-table-header,
.data-table-formations .data-table-row {
  grid-template-columns: 1fr 6rem 5rem 5rem 1rem;
}
.data-table-formations .data-table-row .col-count-left {
  align-self: center;
}


/* === Pattern data-table avec miniature en cellule Nom ===
   Réutilisable par n'importe quelle data-table qui met un <img class="col-name-thumb">
   suivi d'un <div class="col-name-body"> dans son .col-name. Cf. products, formations. */
.col-name:has(.col-name-thumb) {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}
.col-name-thumb {
  width: 60px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: block;
}
.col-name-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  line-height: 1.3;
}


/* === Produits - grid table ===
   Colonnes : Nom (avec slug + landing en 2e/3e ligne) | Type | Prix HT | Position | Publié | Actions */
.data-table-products .data-table-header,
.data-table-products .data-table-row {
  grid-template-columns: 1fr 8rem 7rem 5rem 4rem 1rem;
}
.data-table-products .data-table-row .col-count-left {
  align-self: center;
}
/* Structure thumb + [nom / slug / landing] : géré par la règle générique .col-name:has(.col-name-thumb) plus haut */


/* === Conseils - grid table ===
   Colonnes : Nom (thumb + slug) | Format (durée + rythme) | Tarif HT | Position | Publiée | Actions */
.data-table-conseils .data-table-header,
.data-table-conseils .data-table-row {
  grid-template-columns: 1fr 12rem 9rem 5rem 4rem 1rem;
}
.data-table-conseils .data-table-row .col-count-left {
  align-self: center;
}


/* === Formations vidéo - grid table ===
   Colonnes : Titre (thumb + slug prefixé du theme si theme) | Prix courant | Phase | Modules | Publiée | Actions */
.data-table-formations-video .data-table-header,
.data-table-formations-video .data-table-row {
  grid-template-columns: 1fr 7rem 6rem 5rem 4rem 1rem;
}
.data-table-formations-video .data-table-row .col-count-left {
  align-self: center;
}


/* === Commandes (Orders) - filtres form (hauteurs uniformes select + input date) === */
.orders-filters-form {
  margin-bottom: 1.5rem;
}
.orders-filters-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.orders-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.orders-filter-field label {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.orders-filter-control {
  height: 2.4rem !important;
  padding: 0 0.6rem !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  min-width: 8rem;
  line-height: normal !important;
}
.orders-filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  height: 2.4rem;
}
.orders-filter-actions .btn {
  height: 2.4rem !important;
  display: inline-flex;
  align-items: center;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* === Commandes (Orders) - grid table ===
   Colonnes : Commande (Prénom · Email + Type Objet) | Phase | Prix HT | Statut | Créée le | Actions */
.data-table-orders .data-table-header,
.data-table-orders .data-table-row {
  grid-template-columns: 1fr 7rem 6rem 6rem 6rem 1rem;
}
.data-table-orders .data-table-row .col-count-left {
  align-self: center;
}


/* === CollectionType embarqué (modules d'une FormationVideo, etc.) === */
.collection-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.collection-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1rem 1rem 0.5rem;
  position: relative;
}
.collection-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.collection-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.collection-item-actions {
  display: flex;
  gap: 0.25rem;
}
.collection-item-actions button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--sidebar-text);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
  font-family: inherit;
}
.collection-item-actions button:hover {
  background: var(--sidebar-hover);
  color: #f0f0f5;
}
.collection-item-actions button.collection-remove {
  color: #e74c3c;
  border-color: rgba(231,76,60,0.3);
}
.collection-item-actions button.collection-remove:hover {
  background: rgba(231,76,60,0.1);
  color: #e74c3c;
}
.collection-add {
  align-self: flex-start;
}


/* === Onglets (tabs) — pattern générique pour formulaires long à plusieurs sections === */
.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tabs-nav button {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--sidebar-text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  margin: 0;
  transition: color 0.15s, border-color 0.15s;
}
.tabs-nav button:hover {
  color: #f0f0f5;
}
.tabs-nav button.is-active {
  color: #f0f0f5;
  border-bottom-color: var(--accent);
}
.tab-panel {
  display: none;
}
.tab-panel.is-active {
  display: block;
}


/* === MoneyType — wrapper flex pour aligner symbole + input sur une ligne
   (rendu via form theme templates/form/admin_form_theme.html.twig) === */
.money-widget {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}
.money-widget input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.money-widget-symbol {
  color: var(--sidebar-text);
  font-size: 0.9rem;
  flex-shrink: 0;
}


/* === Page preview (aperçu HTML dans le form Page) === */
.page-preview {
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 2rem;
  min-height: 400px;
  max-height: 70vh;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
.page-preview * { max-width: 100%; }
.page-preview img { height: auto; border-radius: 4px; }
.page-preview a { color: #1d4ed8; }
.page-preview h1, .page-preview h2, .page-preview h3, .page-preview h4 {
  color: #1a1a1a;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}
.page-preview h1 { font-size: 2rem; }
.page-preview h2 { font-size: 1.5rem; }
.page-preview h3 { font-size: 1.2rem; }
.page-preview p { margin: 0 0 1em; }
.page-preview ul, .page-preview ol { margin: 0 0 1em 1.5rem; }
.page-preview code {
  background: #f0f0f0;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #d63384;
}
.page-preview pre {
  background: #f6f8fa;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
}
.page-preview blockquote {
  border-left: 3px solid #d0d0d0;
  padding-left: 1rem;
  margin: 1em 0;
  color: #555;
  font-style: italic;
}
.page-preview p:first-child, .page-preview h1:first-child, .page-preview h2:first-child { margin-top: 0; }


/* === Data-table Leads (index principal) === */
.data-table-leads .data-table-header,
.data-table-leads .data-table-row {
  grid-template-columns: 10rem 1fr 14rem 4rem 8rem 1rem;
}


/* === Alignement des hauteurs dans un form-grid-3 (edit/new Domaine et Thème) === */
.form-grid-3 { align-items: stretch; }
.form-grid-3 > .dashboard-card {
  display: flex;
  flex-direction: column;
}
/* Le dernier élément-enfant qui contient un textarea prend toute la hauteur restante.
   Ciblé sur :has(textarea) pour ne pas casser d'autres last-child (ex: label flex d'une checkbox). */
.form-grid-3 > .dashboard-card > *:last-child:has(textarea) { flex: 1; display: flex; flex-direction: column; }
.form-grid-3 > .dashboard-card textarea {
  flex: 1;
  min-height: 120px;
  height: auto;
  box-sizing: border-box;
}


/* === Badge cliquable (bascule AJAX) === */
button.badge-toggle {
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.12s ease, box-shadow 0.12s ease;
}
button.badge-toggle:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}
button.badge-toggle:disabled {
  opacity: 0.4;
  cursor: wait;
}


/* === Modale générique (fond overlay + box centrée) === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: #1b1b23;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: min(720px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-header h3 {
  margin: 0;
  color: #f0f0f5;
  font-size: 1.05rem;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.modal-close:hover {
  background: var(--sidebar-hover);
  color: #f0f0f5;
}
.modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* === Picker de composition (modale FV : "Module existant" / "Formation entière") === */
.picker-empty {
  color: var(--sidebar-text);
  font-style: italic;
  margin: 0;
}
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.picker-fv {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
}
.picker-fv h4 {
  margin: 0 0 0.5rem;
  color: #f0f0f5;
  font-size: 0.9rem;
  font-weight: 600;
}
.picker-fv ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.picker-fv label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  transition: background 0.1s ease;
}
.picker-fv label:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f0f0f5;
}
.picker-fv label input[type="radio"] { flex-shrink: 0; }
.picker-fv em {
  color: rgba(255, 255, 255, 0.4);
  font-style: normal;
  font-size: 0.8rem;
}

/* === Barre de boutons compo sous la collection modules === */
.fv-composition-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
