/* Dempart site - separate layout from Gandalf */
:root {
  --dempart-bg: #f5f5f5;
  --dempart-header-bg: #1a1a2e;
  --dempart-header-text: #eee;
  --dempart-accent: #16213e;
  --dempart-link: #0f3460;
  --dempart-border: #e0e0e0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--dempart-bg);
  color: #333;
  line-height: 1.5;
}

.site-header {
  background: var(--dempart-header-bg);
  color: var(--dempart-header-text);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-header a {
  color: var(--dempart-header-text);
  text-decoration: none;
}
.site-header a:hover {
  text-decoration: underline;
}
.site-brand { font-weight: 700; font-size: 1.25rem; }
.site-nav { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.site-nav a.active { text-decoration: underline; }
.site-user { display: flex; align-items: center; gap: 1rem; }
.site-user .welcome { font-size: 0.9rem; opacity: 0.9; }
.btn-logout {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-logout:hover { background: #a93226; color: #fff; }

.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }

.card {
  background: #fff;
  border: 1px solid var(--dempart-border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card-title { margin-top: 0; margin-bottom: 1rem; }

.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--dempart-border);
  border-radius: 4px;
  font-size: 1rem;
}
.btn-primary {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--dempart-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { opacity: 0.9; color: #fff; }

.list-unstyled { list-style: none; padding: 0; margin: 0; }
.post-item {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--dempart-border);
  color: inherit;
  text-decoration: none;
}
.post-item:hover { background: #eee; color: inherit; }
.post-item:last-child { border-bottom: none; }
.post-title { font-size: 1.1rem; margin: 0 0 0.25rem 0; }
.post-meta { font-size: 0.85rem; color: #666; margin: 0; }
.pagination { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.pagination a, .pagination span { padding: 0.25rem 0.5rem; }
.page-item { list-style: none; }
.page-link { text-decoration: none; color: var(--dempart-link); }
.page-item.disabled .page-link { color: #999; cursor: default; }
.page-item.active .page-link { font-weight: 600; color: var(--dempart-accent); }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-info {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--dempart-border);
  background: #fff;
  color: #333;
  cursor: pointer;
}
.btn-outline-primary { border-color: var(--dempart-accent); color: var(--dempart-accent); }
.btn-outline-primary:hover { background: var(--dempart-accent); color: #fff; }
.btn-outline-info { border-color: #17a2b8; color: #17a2b8; }
.btn-outline-info:hover { background: #17a2b8; color: #fff; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.text-muted { color: #6c757d; }
.small { font-size: 0.875rem; }
.d-block { display: block; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.me-1 { margin-right: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.d-flex { display: flex; }
.gap-3 { gap: 1rem; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1 { flex-grow: 1; }
.min-w-0 { min-width: 0; }
.rounded { border-radius: 4px; }
.alert-warning { background: #fff3cd; color: #856404; }
.list-group-item { border: 1px solid var(--dempart-border); border-radius: 4px; margin-bottom: 0.5rem; }
.input-group { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; max-width: 400px; }
.input-group .form-control { flex: 1; min-width: 150px; }
.justify-content-center { justify-content: center; }
.h5 { font-size: 1.1rem; }
.h6 { font-size: 1rem; }
.h3 { font-size: 1.35rem; }
.h4 { font-size: 1.2rem; }
.lead { font-size: 1.1rem; }
.code, code { background: #eee; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.9em; }
.pre code { display: block; padding: 1rem; overflow-x: auto; }
.bg-light { background: #f8f9fa; }
.accordion-button { width: 100%; text-align: left; padding: 0.75rem 1rem; border: 1px solid var(--dempart-border); background: #fff; cursor: pointer; border-radius: 4px; }
.card-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--dempart-border); background: #f8f9fa; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; margin: 0 -0.5rem; }
.col-lg-10 { flex: 0 0 100%; max-width: 100%; padding: 0 0.5rem; }
.col-lg-3 { flex: 0 0 25%; max-width: 25%; padding: 0 0.5rem; }
.col-lg-9 { flex: 0 0 75%; max-width: 75%; padding: 0 0.5rem; }
@media (max-width: 991px) { .col-lg-3, .col-lg-9 { flex: 0 0 100%; max-width: 100%; } .d-none.d-lg-block { display: none !important; } }
.mx-auto { margin-left: auto; margin-right: auto; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 1rem; }
.container.mt-4 { margin-top: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.justify-content-between { justify-content: space-between; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.text-center { text-align: center; }
.text-decoration-none { text-decoration: none; }
.text-dark { color: #333; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.p-3 { padding: 1rem; }
.p-5 { padding: 2rem; }
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 0.5rem; }
@media (max-width: 767px) { .col-md-6 { flex: 0 0 100%; max-width: 100%; } }
.h-100 { height: 100%; }
.alert-heading { font-weight: 600; margin-bottom: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.rounded.mb-3 { margin-bottom: 1rem; }
.pre { margin: 0; }
.mb-0 .pre { margin-bottom: 0; }
.accordion-body { padding: 1rem; border: 1px solid var(--dempart-border); border-top: none; border-radius: 0 0 4px 4px; }
.accordion-item { margin-bottom: 0.5rem; }
.accordion-item .accordion-button { border-radius: 4px 4px 0 0; }
.accordion-item .accordion-button.collapsed + .accordion-body { display: none; }
.accordion-item .accordion-button:not(.collapsed) + .accordion-body { display: block; }
.list-group-item-action { display: block; padding: 0.5rem 1rem; color: inherit; text-decoration: none; }
.list-group-item-action:hover { background: #f0f0f0; }
.d-lg-none { display: none; }
@media (max-width: 991px) { .d-lg-none { display: block; } }
.card-text { margin: 0; }
/* Tech page */
.tech-nav { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.tech-nav .nav-link { color: #495057; padding: 0.5rem 1rem; border-left: 3px solid transparent; transition: all 0.2s; display: block; text-decoration: none; }
.tech-nav .nav-link:hover { background-color: #f8f9fa; border-left-color: var(--dempart-accent); color: var(--dempart-accent); }
.tech-nav .nav-link.active { background-color: #e7f3ff; border-left-color: var(--dempart-accent); color: var(--dempart-accent); font-weight: 600; }
.section-anchor { scroll-margin-top: 20px; }
@media (max-width: 991px) { .tech-nav { position: relative; top: 0; margin-bottom: 2rem; } }
.nav.flex-column { flex-direction: column; }
/* Audio / metrics / transcription page-specific */
.audio-list-item { transition: transform 0.2s; }
.audio-list-item:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.audio-icon { width: 64px; height: 64px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem; }
.file-size { font-size: 0.9rem; color: #6c757d; }
.duration-badge { background-color: #e9ecef; color: #495057; padding: 0.25rem 0.5rem; border-radius: 0.25rem; font-size: 0.875rem; }
.transcription-status { font-size: 0.85rem; }
.status-badge { display: inline-block; padding: 0.2rem 0.4rem; border-radius: 0.2rem; font-size: 0.75rem; font-weight: 500; }
.status-available { background-color: #d4edda; color: #155724; }
.status-unavailable { background-color: #f8d7da; color: #721c24; }
.metrics-container { max-width: 1000px; margin: 0 auto; padding: 2rem 1rem; }
.metrics-header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid #e9ecef; }
.metrics-title { font-size: 2rem; font-weight: bold; margin-bottom: 0.5rem; }
.metrics-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.summary-card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 1.5rem; border-radius: 0.5rem; text-align: center; }
.summary-card-value { font-size: 2rem; font-weight: bold; margin-bottom: 0.5rem; }
.summary-card-label { font-size: 0.9rem; opacity: 0.9; }
.steps-timeline { margin-top: 2rem; }
.step-item { display: flex; gap: 1.5rem; margin-bottom: 2rem; padding: 1.5rem; background-color: #f8f9fa; border-radius: 0.5rem; border-left: 4px solid #667eea; }
.step-icon { width: 48px; height: 48px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem; flex-shrink: 0; }
.step-content { flex-grow: 1; }
.step-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 0.5rem; }
.step-name { font-size: 1.2rem; font-weight: bold; color: #333; }
.step-status { padding: 0.25rem 0.75rem; border-radius: 1rem; font-size: 0.85rem; font-weight: 500; }
.status-completed { background-color: #d4edda; color: #155724; }
.status-pending { background-color: #fff3cd; color: #856404; }
.status-failed { background-color: #f8d7da; color: #721c24; }
.step-details { color: #6c757d; font-size: 0.95rem; margin-top: 0.5rem; }
.step-time { font-family: monospace; color: #495057; font-size: 0.9rem; margin-top: 0.5rem; }
.no-metrics { text-align: center; padding: 3rem; color: #6c757d; }
.model-info { background-color: #e9ecef; padding: 1rem; border-radius: 0.25rem; margin-top: 2rem; }
.model-info h4 { margin-bottom: 0.5rem; color: #495057; }
.model-info-item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #dee2e6; }
.model-info-item:last-child { border-bottom: none; }
.transcription-container { max-width: 1000px; margin: 0 auto; padding: 2rem 1rem; }
.transcription-header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid #e9ecef; }
.transcription-title { font-size: 2rem; font-weight: bold; margin-bottom: 0.5rem; }
.transcription-meta { color: #6c757d; font-size: 0.95rem; }
.transcription-type-selector { margin-bottom: 2rem; }
.transcription-type-selector .btn { margin-right: 0.5rem; margin-bottom: 0.5rem; }
.transcription-content { background-color: #f8f9fa; border-radius: 0.5rem; padding: 2rem; font-size: 1.05rem; line-height: 1.8; }
.transcription-segment { margin-bottom: 1.5rem; padding: 1rem; background-color: white; border-radius: 0.25rem; border-left: 4px solid #667eea; }
.transcription-segment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.9rem; color: #6c757d; }
.transcription-segment-speaker { font-weight: bold; color: #667eea; text-transform: uppercase; }
.transcription-segment-time { font-family: monospace; }
.transcription-segment-text { color: #333; margin-top: 0.5rem; }
.audio-player-container { margin-top: 0.75rem; padding: 0.75rem; background-color: #f8f9fa; border-radius: 0.25rem; }
.audio-player-container audio { width: 100%; max-width: 500px; }
.chunk-indicator { font-size: 0.8rem; color: #6c757d; margin-top: 0.25rem; }
.no-transcription { text-align: center; padding: 3rem; color: #6c757d; }
.transcription-stats { display: flex; gap: 2rem; margin-bottom: 2rem; padding: 1rem; background-color: #e9ecef; border-radius: 0.25rem; }
.stat-item { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: bold; color: #667eea; }
.stat-label { font-size: 0.85rem; color: #6c757d; text-transform: uppercase; }
.mt-3 { margin-top: 1rem; }
