:root {
  color-scheme: light;
  --ink: #20252d;
  --muted: #657080;
  --line: #d7dde5;
  --panel: #f6f8fb;
  --panel-strong: #eef2f6;
  --accent: #166c7d;
  --accent-dark: #0f4e5d;
  --warm: #a85b23;
  --ok: #2f7b46;
  --missing: #9c3d3d;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

#doctorat-music-app {
  height: 100vh;
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
}

.brand h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.logout-button {
  width: 100%;
  margin-top: 14px;
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.logout-button:hover {
  background: #eef2f6;
}

.root-path {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.control-label {
  display: block;
  margin: 22px 0 8px;
  color: #303844;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.checklist label,
.radio-list label {
  display: block;
  margin: 0 0 7px;
  font-size: 14px;
  line-height: 1.3;
}

.checklist input,
.radio-list input {
  margin-right: 8px;
}

.compact label {
  font-size: 13px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.sidebar-link {
  display: block;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--ink);
  background: var(--panel-strong);
}

.sidebar-link.active {
  color: #ffffff;
  background: var(--accent);
}

.sources-overview {
  margin-top: 24px;
  display: grid;
  gap: 8px;
}

.source-card {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--white);
}

.source-semantic {
  border-left-color: var(--ok);
}

.source-missing {
  border-left-color: var(--missing);
  opacity: 0.7;
}

.source-name {
  font-size: 13px;
  font-weight: 700;
}

.source-stats {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.source-stats span {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--panel-strong);
}

.author-file-item {
  display: grid;
  gap: 7px;
}

.author-file-top {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.author-download-link {
  min-width: 0;
  flex: 1;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.author-download-link:hover {
  text-decoration: underline;
}

.dga-issue-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 7px;
  list-style: none;
}

.dga-issue-row {
  min-height: 34px;
  padding: 7px 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #e3e8ef;
  border-radius: 6px;
  background: #ffffff;
}

.dga-issue-title {
  min-width: 0;
  flex: 1;
  color: #303844;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dga-item-preview {
  margin-left: auto;
}

.content {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 28px 40px;
}

.page-content {
  min-width: 0;
}

.content h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-intro {
  max-width: 760px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.sources-page-grid {
  display: grid;
  max-width: 860px;
  gap: 10px;
}

.folder-accordion {
  max-width: 860px;
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.bibliography-documents-layout {
  display: grid;
  grid-template-columns: minmax(420px, 860px) minmax(380px, 1fr);
  gap: 18px;
  align-items: start;
}

.bibliography-list-pane {
  min-width: 0;
}

.bibliography-list-pane .sources-page-grid,
.bibliography-list-pane .folder-accordion {
  max-width: none;
}

.pdf-preview-pane {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  min-height: 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
}

.pdf-preview-empty {
  min-height: 100%;
  padding: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.pdf-preview-header {
  padding: 10px 12px;
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.pdf-preview-kicker {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pdf-preview-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pdf-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pdf-preview-link {
  min-height: 28px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.pdf-preview-link:hover {
  background: var(--accent-dark);
}

.pdf-preview-link.secondary {
  color: var(--ink);
  background: var(--panel-strong);
}

.pdf-preview-link.secondary:hover {
  background: #dfe6ee;
}

.pdf-preview-body {
  min-height: 0;
  flex: 1;
  background: var(--panel);
  overflow: hidden;
}

.pdf-preview-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #ffffff;
}

.alphabet-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  max-width: 860px;
  margin: 0 0 14px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
}

.alphabet-link {
  min-width: 30px;
  height: 30px;
  padding: 6px 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: var(--accent-dark);
  background: var(--panel-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.alphabet-link:hover {
  color: #ffffff;
  background: var(--accent);
}

.folder-menu {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  scroll-margin-top: 56px;
}

.alphabet-menu {
  border-left: 4px solid var(--accent);
}

.author-menu {
  border-color: #e3e8ef;
  border-left: 3px solid var(--panel-strong);
}

.folder-summary {
  min-height: 42px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.alphabet-summary {
  background: var(--panel-strong);
}

.author-summary {
  min-height: 38px;
  padding-left: 14px;
}

.alphabet-title {
  font-size: 17px;
  font-weight: 800;
}

.alphabet-panel {
  padding: 8px;
  display: grid;
  gap: 8px;
}

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

.folder-summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
}

.folder-menu[open] > .folder-summary::after {
  content: "-";
}

.author-summary::before {
  content: "+";
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
}

.author-menu[open] > .author-summary::before {
  content: "-";
}

.author-summary::after {
  display: none;
}

.folder-title {
  font-size: 14px;
  font-weight: 700;
}

.folder-count {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 12px;
  white-space: nowrap;
}

.folder-panel {
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
  background: #fbfcfe;
}

.folder-file-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  list-style: none;
}

.folder-file-item {
  min-width: 0;
}

.file-biblio-details {
  border: 1px solid #e3e8ef;
  border-radius: 6px;
  background: #ffffff;
}

.file-summary {
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

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

.file-summary::before {
  content: "+";
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.file-biblio-details[open] .file-summary::before {
  content: "-";
}

.file-title {
  min-width: 0;
  flex: 1;
  color: #303844;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.biblio-badge {
  padding: 2px 6px;
  border-radius: 4px;
  color: #ffffff;
  background: var(--ok);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.preview-badge {
  min-height: 24px;
  padding: 3px 8px;
  flex: 0 0 auto;
  border: 0;
  font-family: inherit;
  line-height: 1;
  text-transform: none;
}

.preview-badge:hover {
  background: #25683b;
}

.author-summary-preview,
.author-item-preview {
  margin-left: auto;
}

.preview-badge-disabled {
  opacity: 0.45;
}

.biblio-badge.muted {
  color: var(--muted);
  background: var(--panel-strong);
}

.file-biblio-panel {
  border-top: 1px solid #e3e8ef;
  padding: 10px;
}

.biblio-author {
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.biblio-text {
  color: #303844;
  font-size: 13px;
  line-height: 1.5;
}

.pdf-download-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 5px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.pdf-download-link:hover {
  background: var(--accent-dark);
}

.file-no-biblio {
  color: var(--muted);
  font-size: 13px;
}

.folder-empty {
  color: var(--muted);
  font-size: 13px;
}

.info-panel {
  max-width: 860px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.info-label {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.info-label:first-child {
  margin-top: 0;
}

.info-value {
  margin-top: 4px;
  color: #2d343e;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px auto auto;
  gap: 10px;
  align-items: center;
}

.source-selector-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.source-dropdown {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.source-dropdown-title {
  min-height: 34px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.source-dropdown[open] .source-dropdown-title {
  border-bottom: 1px solid var(--line);
}

.source-checklist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 7px;
}

.source-checklist-plain {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.source-checklist-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-strong);
  color: #2d343e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.source-checklist-all {
  background: #eaf7f8;
  color: var(--accent-dark);
}

.source-checklist-input {
  flex: 0 0 auto;
  margin-top: 0;
}

.query-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 16px;
}

button {
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  color: var(--ink);
  background: var(--panel-strong);
  border-color: var(--line);
}

.status-row {
  margin: 18px 0 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.search-status,
.results-count {
  color: var(--muted);
  font-size: 14px;
}

.display-controls {
  display: grid;
  grid-template-columns: auto 96px;
  gap: 8px;
  align-items: center;
}

.inline-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mode-filter,
.per-page-filter {
  font-size: 13px;
}

.results-section {
  max-width: 1180px;
}

.results-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 14px 15px;
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.result-meta span,
.pill,
.score {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--panel-strong);
}

.result-score {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pill {
  color: #ffffff;
  background: var(--warm);
}

.result-card h3 {
  margin: 10px 0 7px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.snippet {
  margin: 0;
  color: #2d343e;
  line-height: 1.5;
  font-size: 14px;
}

mark {
  background: #ffe38f;
  padding: 0 2px;
  border-radius: 2px;
}

.result-path {
  margin-top: 10px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.empty-state {
  margin-top: 10px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--panel);
}

.login-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 18px 32px;
  background:
    linear-gradient(135deg, rgba(22, 108, 125, 0.14), rgba(168, 91, 35, 0.12)),
    #f7f5ef;
}

.login-panel {
  width: min(460px, 100%);
}

.login-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 14px;
  border-radius: 8px;
  box-shadow: 0 14px 42px rgba(32, 37, 45, 0.28);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.18)),
    url("/assets/accueil.jpg") center / contain no-repeat,
    url("/assets/accueil.png") center / contain no-repeat,
    transparent;
}

.login-brand {
  color: #1f2730;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  white-space: nowrap;
}

.login-project-text {
  margin: 3px 0 14px;
  color: #6b625a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.login-institution {
  margin-top: 8px;
  color: #2f343a;
  font-size: 13px;
  font-weight: 700;
}

.login-card {
  padding: 16px 18px;
  border: 1px solid rgba(32, 37, 45, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 48px rgba(32, 37, 45, 0.18);
}

.login-heading {
  margin-bottom: 12px;
  color: #25313c;
  font-size: 18px;
  font-weight: 700;
}

.login-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  font-size: 15px;
}

.login-button {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  color: #ffffff;
  background: var(--accent);
}

.login-button:hover {
  background: var(--accent-dark);
}

.login-error {
  min-height: 6px;
  margin-top: 3px;
  color: #9c3d3d;
  font-size: 14px;
  font-weight: 700;
}

.login-db-summary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #5d6876;
  font-size: 13px;
  line-height: 1.45;
}

.login-db-summary-title {
  margin-bottom: 5px;
  color: #25313c;
  font-weight: 700;
}

@media (max-width: 920px) {
  .login-panel {
    width: min(460px, 100%);
  }

  .login-photo {
    margin-bottom: 14px;
  }

  .login-brand {
    white-space: nowrap;
  }

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

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .search-row,
  .status-row,
  .source-selector-panel,
  .display-controls {
    grid-template-columns: 1fr;
  }

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

  .pdf-preview-pane {
    position: static;
    height: 72vh;
    min-height: 420px;
  }
}
