/* ============================================================
   Muziekbibliotheek – stylesheet
   Originele Bootstrap-opmaak: wit met grijstinten, Bootstrap-blauw
   als accent, standaard systeemlettertype.
   ============================================================ */

:root {
  --primary:        #0d6efd;
  --primary-hover:  #0b5ed7;
  --primary-subtle: #e7f1ff;
  --dark:            #212529;
  --muted:           #6c757d;
  --border:          #dee2e6;
  --bg:              #f8f9fa;
  --sidebar-w:       260px;
  --radius:          .375rem;
  --shadow:          0 .125rem .25rem rgba(0,0,0,.075);
}

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Sidebar ── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .28s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.4rem 1.4rem 1.1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: .65rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand i { font-size: 1.3rem; color: var(--primary); }

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: .8rem 0;
  flex: 1;
}
.sidebar-nav .nav-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .9rem 1.4rem .3rem;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1.4rem;
  color: #495057;
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
  background: #f1f3f5;
  color: var(--dark);
}
.sidebar-nav a.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.sidebar-nav a i { font-size: 1.05rem; width: 1.2rem; }

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.user-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
  margin: -.3rem;
  padding: .3rem;
  transition: background .15s;
}
.user-info:hover {
  background: #f1f3f5;
  color: inherit;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.user-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.user-role {
  font-size: .7rem;
  color: var(--muted);
  text-transform: capitalize;
}
.btn-logout {
  margin-left: auto;
  color: var(--muted);
  font-size: 1.1rem;
  text-decoration: none;
  transition: color .15s;
}
.btn-logout:hover { color: var(--primary); }

/* ── Mobile toggle ── */
#sidebarToggle {
  display: none;
  position: fixed;
  top: .9rem; left: .9rem;
  z-index: 1100;
  background: #fff;
  color: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .6rem;
  font-size: 1.3rem;
  line-height: 1;
  box-shadow: var(--shadow);
}

/* ── Main content ── */
#mainContent {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.page-body {
  padding: 1.8rem 2rem;
  flex: 1;
}

/* ── Cards ── */
.mb-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Table ── */
.table-mb {
  margin: 0;
  font-size: .88rem;
}
.table-mb thead th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .75rem 1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-mb thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}
.table-mb thead th[data-sort]:hover { color: var(--primary); }
.table-mb .sort-icon { font-size: .7rem; margin-left: .3rem; opacity: .5; }
.table-mb thead th[data-sort]:hover .sort-icon { opacity: 1; }
.table-mb tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.table-mb tbody tr:hover { background: #f8f9fa; }
.table-mb tbody td {
  padding: .7rem 1rem;
  vertical-align: middle;
  border: none;
}
.table-mb .cell-id {
  font-family: SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  color: var(--muted);
  width: 60px;
}
.table-mb .cell-actions { width: 165px; white-space: nowrap; }

/* ── Buttons ── */
.btn-copper {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  font-weight: 500;
  font-size: .85rem;
}
.btn-copper:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
.btn-icon {
  background: none;
  border: none;
  padding: .25rem .4rem;
  border-radius: 4px;
  line-height: 1;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, color .15s;
}
.btn-icon.view  { color: var(--primary); }
.btn-icon.view:hover  { background: var(--primary-subtle); color: var(--primary); }
.btn-icon.edit  { color: #495057; }
.btn-icon.edit:hover  { background: #e9ecef; color: var(--dark); }
.btn-icon.del   { color: #dc3545; }
.btn-icon.del:hover   { background: #f8d7da; color: #dc3545; }
.btn-icon.fav   { color: #ffc107; border: none; background: none; cursor: pointer; }
.btn-icon.fav:hover   { background: #fff3cd; }

/* ── Search bar ── */
.search-bar {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.search-bar .form-control { font-size: .88rem; }

/* ── Modals ── */
/* Een <form> rond modal-body + modal-footer breekt Bootstrap's flex-layout voor
   .modal-dialog-scrollable (header/body/footer moeten directe flex-kinderen van
   .modal-content zijn) — zonder dit wordt inhoud afgekapt i.p.v. intern scrollbaar. */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 700; color: var(--dark); }
.modal-footer { border-top: 1px solid var(--border); }
.form-label { font-size: .82rem; font-weight: 600; color: #495057; }
.form-control, .form-select { font-size: .88rem; }

/* ── Notitie-velden: zachtgele "post-it"-hint ── */
textarea.postit-veld,
textarea.postit-veld:focus {
  background-color: #fef9c3;
  border-color: #fde68a;
}
.postit-waarde {
  background-color: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: .75rem 1rem;
}

/* ── Zoekbare dropdown (typen + scrollen) ── */
.combo-select { position: relative; }
.combo-select select.combo-native-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}
.combo-input { cursor: text; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.combo-menu {
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  margin-top: .2rem;
}
.combo-menu .dropdown-item { cursor: pointer; font-size: .88rem; }
.combo-menu .dropdown-item.highlighted,
.combo-menu .dropdown-item:hover { background-color: var(--primary-subtle); color: var(--primary); }
.combo-menu .dropdown-item.active { background-color: var(--primary); color: #fff; }

/* ── Wachtwoordsterkte-indicator ── */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  background: #e9ecef;
  margin-top: .4rem;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .25s, background .25s;
}

/* ── Standalone form card (edit pages) ── */
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

/* ── Badge ── */
.badge-copper {
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 600;
  padding: .25em .6em;
  border-radius: 20px;
}

/* ── Pagination ── */
.page-link { font-size: .83rem; color: var(--primary); }

/* ── Toast ── */
.toast {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--dark);
  font-size: .85rem;
  box-shadow: var(--shadow);
}
.toast.success { border-left: 4px solid #198754; }
.toast.error   { border-left: 4px solid #dc3545; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; color: #ced4da; }
.empty-state p { font-size: .95rem; }

/* ── Drag-and-drop overlay ── */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(13, 110, 253, .08);
  border: 4px dashed var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.drop-overlay-inner {
  background: #fff;
  border-radius: .75rem;
  padding: 2rem 3rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}
.drop-overlay-inner i { font-size: 2.5rem; color: var(--primary); display: block; margin-bottom: .5rem; }
.drop-overlay-inner p { color: var(--dark); font-weight: 500; }

/* ── Detail view ── */
.detail-row { display: flex; gap: 2rem; flex-wrap: wrap; }
.detail-label { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.detail-value { font-size: .95rem; margin-top: .15rem; }
.detail-title {
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .8rem;
}
.form-card .detail-title { color: var(--dark); }
.detail-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 4/3;
}
.detail-bio { white-space: pre-line; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li {
  border-bottom: 1px solid var(--border);
}
.related-list li:last-child { border-bottom: none; }
.related-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .2rem;
  color: var(--dark);
  text-decoration: none;
  font-size: .88rem;
}
.related-list a:hover { color: var(--primary); }

.bezit-list { list-style: none; margin: 0; padding: 0; }
.bezit-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .5rem .2rem;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.bezit-list li:last-child { border-bottom: none; }

/* ── Foto preview ── */
.foto-preview {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.foto-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  max-height: 220px;
  overflow: hidden;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: .5rem;
}
.foto-preview-box img { max-height: 210px; object-fit: contain; border-radius: 4px; }

/* ── Fotogalerij (orgels) ── */
.galerij-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.galerij-thumb {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  cursor: zoom-in;
  aspect-ratio: 4/3;
}
.galerij-thumb img,
.galerij-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s;
}
.galerij-thumb:hover img { transform: scale(1.05); }
.galerij-tile { position: relative; }
.galerij-tile img {
  aspect-ratio: 4/3;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .35rem;
}
.galerij-tile.bezig img { opacity: .4; }
.galerij-tile.klaar img { outline: 3px solid #198754; outline-offset: -3px; }
.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: 2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-dropzone i { font-size: 2.2rem; color: var(--muted); }
.upload-dropzone:hover,
.upload-dropzone.dragover { border-color: var(--primary); background: var(--primary-subtle); }
.galerij-tile-del {
  position: absolute;
  top: .35rem; right: .35rem;
  width: 2rem; height: 2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
}
.galerij-tile-del:hover { background: #dc3545; }
.galerij-dialog { max-width: min(1400px, 95vw); }
.galerij-layout {
  display: flex;
  height: 80vh;
}
.galerij-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.galerij-viewer {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.galerij-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.galerij-bijschrift { padding: .5rem 1rem; border-top: 1px solid var(--border); }
.galerij-bijschrift input { flex: 1 1 auto; }
.galerij-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem; height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 1.4rem;
}
.galerij-nav:hover { background: rgba(0,0,0,.8); }
.galerij-prev { left: 1rem; }
.galerij-next { right: 1rem; }
.galerij-strip {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .5rem;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.galerij-strip button {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 4/3;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  opacity: .6;
  background: none;
  transition: opacity .15s;
}
.galerij-strip button:hover { opacity: .9; }
.galerij-strip button.actief { border-color: var(--primary); opacity: 1; }
.galerij-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Smal scherm: miniaturen als horizontale balk boven de foto */
@media (max-width: 767.98px) {
  .galerij-layout { flex-direction: column; }
  .galerij-strip {
    flex: 0 0 auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .galerij-strip button { width: 80px; }
}

/* ── Login page ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-title {
  color: var(--dark);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.8rem;
}
.login-title i { color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 991px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,.15);
  }
  #sidebarToggle { display: block; }
  #mainContent { margin-left: 0; }
  .page-header { padding: 1rem 1rem 1rem 3.5rem; }
  .page-body { padding: 1.2rem; }
}

@media (max-width: 575px) {
  .page-title { font-size: 1.2rem; }
  .table-mb { font-size: .82rem; }
  .table-mb tbody td, .table-mb thead th { padding: .55rem .6rem; }
}

/* ── Snel zoeken (Ctrl+K) ── */
.quick-search-dialog { margin-top: 10vh; }
.quick-search-input {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.quick-search-input input { font-size: 1.1rem; padding-left: 0; }
.quick-search-results { max-height: 55vh; overflow-y: auto; padding: .25rem 0 .5rem; }
.quick-search-group {
  padding: .6rem 1rem .2rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.quick-search-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 .5rem;
  padding: .45rem .75rem;
  border-radius: var(--radius);
  color: var(--dark);
  text-decoration: none;
}
.quick-search-item i { color: var(--muted); }
.quick-search-item.active { background: var(--primary-subtle); color: var(--primary); }
.quick-search-item.active i { color: var(--primary); }
.quick-search-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.quick-search-help {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .25rem 1rem;
  padding: .25rem 1.25rem;
  color: var(--muted);
}
.quick-search-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1rem;
  padding: .5rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.quick-search-dialog kbd,
.quick-search-link kbd {
  padding: .1rem .35rem;
  font-size: .7rem;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: none;
}
.quick-search-link { display: flex; align-items: center; }
