/* =============================================
   Reminder banner (home page)
   ============================================= */

.reminder-banner {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reminder-banner__title {
  font-size: 1rem;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 0.25rem 0;
}

.reminder-banner__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 0.375rem;
  padding: 0.625rem 0.875rem;
}

.reminder-banner__info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.reminder-banner__entry-title {
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reminder-banner__date {
  font-size: 0.8125rem;
  color: #b45309;
  margin-top: 0.125rem;
}

.reminder-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Header row inside the banner (title + close button) */
.reminder-banner__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.reminder-banner__close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #92400e;
  line-height: 1;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.reminder-banner__close:hover {
  background: #fde68a;
}

/* Nav badge for due-reminder count in the sidebar */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 1.125rem;
  height: 1.125rem;
  border-radius: 0.625rem;
  padding: 0 0.25rem;
  margin-left: 0.375rem;
  vertical-align: middle;
  line-height: 1;
}

/* Responsive: on narrow viewports stack info and actions vertically */
@media (max-width: 560px) {
  .reminder-banner__item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
  }

  .reminder-banner__info {
    width: 100%;
  }

  .reminder-banner__actions {
    width: 100%;
    flex-shrink: 1;
    justify-content: flex-start;
  }

  .reminder-banner__actions button {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }
}

.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #6b7280;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  transition: background 0.15s, color 0.15s;
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Reminder management page (/reminders) */

.reminders-group {
  margin-bottom: 2rem;
}

.reminders-group__heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid #e5e7eb;
}

.reminder-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  background: #ffffff;
}

.reminder-card--done {
  opacity: 0.55;
  background: #f9fafb;
}

.reminder-card__info {
  flex: 1;
  min-width: 0;
}

.reminder-card__title {
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.reminder-card__meta {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.125rem;
}

.reminder-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Responsive: auf schmalen Viewports Info und Buttons vertikal stapeln */
@media (max-width: 560px) {
  .reminder-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
  }

  .reminder-card__info {
    width: 100%;
  }

  .reminder-card__actions {
    width: 100%;
    flex-shrink: 1;
    justify-content: flex-start;
  }

  .reminder-card__actions button {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }
}

.reminder-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.reminder-form__row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.reminder-form__mode-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reminder-form__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Reminder section on entry edit page */

.reminders-section {
  margin-top: 2rem;
}

.reminders-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.reminder-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reminders-add-btn {
  margin-top: 0.5rem;
}

/* =============================================
   Audio player and upload styles
   ============================================= */

.audio-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.audio-section--reflection {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
}

.audio-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.audio-item {
  display: flex;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  width: 100%;
}

.audio-filename {
  font-size: 0.875rem;
  color: #374151;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-control {
  height: 36px;
  flex: 1;
  min-width: 200px;
}

.audio-error {
  font-size: 0.8125rem;
  color: #dc2626;
}

.audio-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.btn-audio-load,
.btn-audio-upload {
  white-space: nowrap;
  flex-shrink: 0;
}

/* =============================================
   Reset / Base
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f5f5f5;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =============================================
   Layout (authenticated pages)
   ============================================= */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1e293b;
  color: #f8fafc;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* Sticky sidebar: always fills the viewport so user-info stays at the bottom */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-version {
  font-size: 0.7rem;
  color: #475569;
  letter-spacing: 0.02em;
}

.sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar ul a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.sidebar ul a:hover {
  background: #334155;
  text-decoration: none;
}

.user-info {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.user-info button {
  background: #334155;
  color: #e2e8f0;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
  transition: background 0.15s;
}

.user-info button:hover {
  background: #ef4444;
  color: #fff;
}

.user-info-link {
  display: block;
  background: #334155;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s;
}

.user-info-link:hover {
  background: #475569;
  text-decoration: none;
}

.content {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

.content h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #0f172a;
}

/* =============================================
   Login / Register pages
   ============================================= */
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-container h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.login-container section {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.login-container h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

/* =============================================
   Forms
   ============================================= */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.form-field input,
input[type="text"],
input[type="password"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9375rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.validation-message {
  color: #dc2626;
  font-size: 0.8125rem;
}

/* =============================================
   Buttons
   ============================================= */
button[type="submit"],
button.btn-add {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

button[type="submit"]:hover:not(:disabled),
button.btn-add:hover:not(:disabled) {
  background: #1d4ed8;
}

button[type="submit"]:disabled,
button.btn-add:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.btn-edit {
  background: #e2e8f0;
  color: #374151;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

button.btn-edit:hover {
  background: #cbd5e1;
}

button.btn-save {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

button.btn-save:hover {
  background: #15803d;
}

button.btn-cancel {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

button.btn-cancel:hover {
  background: #e5e7eb;
}

button.btn-delete {
  background: transparent;
  color: #dc2626;
  border: 1px solid #fca5a5;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

button.btn-delete:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

/* =============================================
   Error messages
   ============================================= */
.error-message {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
}

.success-message {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
}

.form-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.2rem;
}

.form-container {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-actions {
  margin-top: 0.5rem;
}

/* =============================================
   Admin sections
   ============================================= */
.admin-section {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  max-width: 640px;
}

.admin-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.admin-table th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.75rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td {
  background: #f9fafb;
}

.action-cell {
  width: 1%;
  white-space: nowrap;
  display: flex;
  gap: 0.5rem;
}

.empty-hint {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.875rem;
}

.inline-input {
  padding: 0.35rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9375rem;
  width: 100%;
  max-width: 300px;
}

.inline-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.add-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.add-form .inline-input {
  flex: 1;
}

/* =============================================
   Page header (title + action button row)
   ============================================= */
.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin-bottom: 0;
  flex: 1;
}

.btn-primary {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #1d4ed8;
  text-decoration: none;
  color: #fff;
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-secondary {
  display: inline-block;
  background: #f1f5f9;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-back {
  color: #6b7280;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.4rem 0;
  white-space: nowrap;
}

.btn-back:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* =============================================
   Entry list (Home page)
   ============================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 720px;
}

.entry-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, transform 0.1s;
}

.entry-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.entry-card-link {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
}

.entry-card-link:hover {
  text-decoration: none;
}

.entry-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.entry-date {
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 500;
}

.entry-mood {
  font-size: 0.75rem;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
  font-weight: 500;
}

.entry-reflection-count {
  font-size: 0.75rem;
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
  font-weight: 500;
}

.entry-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.4rem;
}

.tag-badge {
  font-size: 0.75rem;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
}

/* =============================================
   Entry form (EntryEdit page)
   ============================================= */
.entry-form-container {
  background: #fff;
  border-radius: 10px;
  padding: 1.75rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  max-width: 760px;
  margin-bottom: 2rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.form-row .form-field {
  flex: 1;
  min-width: 180px;
}

.form-field--narrow {
  flex: 0 0 180px !important;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.form-field label,
.form-field legend {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

/* Checkbox-Zeile: Häkchen und Beschriftung nebeneinander.
   Muss nach .form-field stehen, damit flex-direction: row gewinnt. */
.form-field--checkbox {
  flex-direction: row;
  align-items: center;
}

.form-field--checkbox label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: normal;
  user-select: none;
}

.form-field--checkbox input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.form-field textarea {
  padding: 0.6rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-field select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9375rem;
  background: #fff;
  transition: border-color 0.15s;
}

.form-field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-field fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.25rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* =============================================
   Statistics page (/statistics)
   ============================================= */

/* ── Pill buttons (granularity selector + reusable elsewhere) ── */

.filter-bar-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.filter-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 1rem;
  background: #ffffff;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.filter-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.filter-btn--active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 500;
}

.filter-btn--active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* ── Stats-specific layouts ────────────────────────────────── */

.stats-controls {
  margin-bottom: 1.25rem;
}

/* Granularity pill row — extra gap so pills breathe */
.stats-granularity-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Outer bar: holds the dropdown group + clear button */
.stats-selection-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* Inner group: keeps the two dropdowns side by side */
.stats-dropdowns {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Force <details> to shrink-wrap its summary so two dropdowns sit next to each other */
.stats-dropdowns .filter-dropdown {
  display: inline-block;
}

/* "Alle" / "Keine" quick-action buttons inside a dropdown panel */
.stats-quick-actions {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem 0.35rem;
  border-bottom: 1px solid #e5e7eb;
}

.stats-quick-btn {
  padding: 0.18rem 0.6rem;
  font-size: 0.78rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s;
}

.stats-quick-btn:hover {
  background: #e5e7eb;
}

/* "× Auswahl zurücksetzen" inline button */
.stats-clear-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.12s, background 0.12s;
}

.stats-clear-btn:hover {
  color: #374151;
  background: #f3f4f6;
}

/* Empty state inside a dropdown (search yields no results) */
.stats-dropdown-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
  margin: 0;
}

.stats-chart-section {
  margin-bottom: 2rem;
}

.stats-chart-container {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #ffffff;
  /* Chart.js with responsive:true + maintainAspectRatio:false fills this height. */
  height: 420px;
  position: relative;
  padding: 0.5rem;
}


.stats-empty-hint {
  color: #6b7280;
  font-style: italic;
  margin-bottom: 1rem;
}

.stats-table-section {
  margin-bottom: 2rem;
}

.stats-table-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.stats-table-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.stats-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  white-space: nowrap;
}

.stats-table th,
.stats-table td {
  padding: 0.4rem 0.75rem;
  border: 1px solid #e5e7eb;
  text-align: right;
}

.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
  font-weight: 500;
  position: sticky;
  left: 0;
  background: #f9fafb;
  z-index: 1;
}

.stats-table thead th {
  background: #f3f4f6;
  font-weight: 600;
}

.stats-table tbody tr:nth-child(even) td {
  background: #f9fafb;
}

.stats-table tbody tr:nth-child(even) td:first-child {
  background: #f3f4f6;
}

/* =============================================
   Reflections section
   ============================================= */
.reflections-section {
  max-width: 760px;
}

.reflections-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1rem;
}

.reflection-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  border-left: 3px solid #2563eb;
}

.reflection-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.reflection-content {
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;
  font-size: 0.9375rem;
}

.btn-delete--small {
  margin-left: auto;
  font-size: 0.8125rem;
  padding: 0.25rem 0.6rem;
}

/* The reflection card's delete button now sits after .reflection-content in the DOM (for tab/
   screen-reader order) instead of inside the flex .reflection-card-header, so .btn-delete--small's
   margin-left: auto (needed for AudioPlayer's flex row) no longer applies here. This just adds
   its own spacing below the content paragraph. */
.reflection-delete-btn {
  margin-left: 0;
  margin-top: 0.6rem;
}

.add-reflection {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-top: 0.75rem;
}

.add-reflection summary {
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #2563eb;
  list-style: none;
  user-select: none;
}

.add-reflection summary:hover {
  text-decoration: underline;
}

.add-reflection-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =============================================
   Accessibility utilities
   ============================================= */

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden until focused via keyboard */
.skip-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  z-index: 9999;
  background: #1e293b;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 0.375rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  outline: none;
}

.skip-link:focus {
  top: 0;
  left: 0;
}

/* Inline skip link inside a form row — same hide/show behaviour, but sits in flow */
.skip-link--inline {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link--inline:focus {
  position: static;
  left: auto;
}

/* Keeps the title field visually first in the form-row even though date comes first in DOM */
.form-field--title-first {
  order: -1;
}

/* =============================================
   Text search bar (Home page)
   ============================================= */
.text-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.text-search-input {
  width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9375rem;
  background: #fff;
  color: #111827;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.text-search-input::placeholder {
  color: #9ca3af;
}

/* Hide the browser's native clear button — we render our own */
.text-search-input::-webkit-search-cancel-button {
  display: none;
}

.text-search-clear {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}

.text-search-clear:hover {
  color: #374151;
}

/* =============================================
   Filter toggle row (Home page)
   ============================================= */

.filter-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 0.45rem 1rem;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.filter-toggle-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.filter-toggle-btn--open {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.filter-toggle-btn--open:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.filter-toggle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  line-height: 1;
}

.filter-toggle-chevron {
  font-size: 0.7rem;
  opacity: 0.6;
}

.filter-inline-clear {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.filter-inline-clear:hover {
  color: #374151;
  background: #f3f4f6;
}

/* =============================================
   Collapsible filter panel (Home page)
   ============================================= */

.filter-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* =============================================
   Filter panel rows (Home page)
   ============================================= */

.filter-rows {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-row__label {
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
  min-width: 7rem;
}

.filter-row__controls {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}

.filter-select {
  padding: 0.3rem 0.6rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s;
}

.filter-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* =============================================
   Mood / tag dropdown (Home page)
   ============================================= */

.filter-dropdown {
  position: relative;
}

.filter-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: border-color 0.15s, background 0.15s;
}

/* Remove the native marker from <summary> */
.filter-dropdown__toggle::-webkit-details-marker { display: none; }
.filter-dropdown__toggle::marker { display: none; }

.filter-dropdown__toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

details[open] > .filter-dropdown__toggle {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.filter-dropdown__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  line-height: 1;
}

.filter-dropdown__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
  min-width: 220px;
  max-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Wrapper that positions the search input + clear button as one unit */
.filter-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-search-wrap .filter-item-search {
  padding-right: 1.75rem; /* make room for the × button */
}

/* × button inside the search wrapper */
.filter-search-clear {
  position: absolute;
  right: 0.35rem;
  background: none;
  border: none;
  padding: 0 0.2rem;
  font-size: 0.75rem;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.12s;
}

.filter-search-clear:hover {
  color: #374151;
}

.filter-item-search {
  width: 100%;
  padding: 0.3rem 0.6rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-item-search:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.filter-item-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.filter-item-group + .filter-item-group {
  border-top: 1px solid #f1f5f9;
  padding-top: 0.5rem;
  margin-top: 0.15rem;
}

.filter-item-group__label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.filter-item-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s;
}

.filter-item-label:hover {
  background: #f1f5f9;
}

.filter-item-label--selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.filter-item-label input[type="radio"],
.filter-item-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #2563eb;
}

/* =============================================
   Filter bar (Home page)
   ============================================= */
.filter-clear-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.2rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.filter-clear-btn:hover {
  color: #111827;
}

/* =============================================
   Load-more bar (Home page)
   ============================================= */
.filter-result-count {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0.25rem 0 0.75rem;
}

.load-more-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.load-more-btn {
  white-space: nowrap;
}

.load-more-info {
  font-size: 0.8125rem;
  color: #6b7280;
}

.empty-state--filtered {
  text-align: center;
  padding: 2rem 1rem;
}

.tag-badge--active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

/* =============================================
   Tag chips (EntryEdit page)
   ============================================= */
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 99px;
  padding: 0.2rem 0.55rem 0.2rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.tag-chip-remove:hover {
  color: #dc2626;
}

.tag-input-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Grows the combobox wrapper to fill the row next to the "+" button. Scoped to
   .tag-input-row (not the base .combobox rule below) so the mood combobox, which sits in a
   column-direction .form-field, does not also stretch vertically — see the comment on
   .combobox for why that combination broke the suggestion popup's position. */
.tag-input-row .combobox {
  flex: 1;
}

.btn-add-tag {
  padding: 0.5rem 0.85rem;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}

/* =============================================
   Accessible combobox (AccessibleCombobox.razor)
   Used for the mood and tag fields. The suggestion list is purely visual —
   keyboard focus always stays on the text input, see AccessibleCombobox.razor.cs.
   ============================================= */
/* No "flex: 1" here on purpose: .form-row (used for the Stimmung/Tags pair above) is a
   flex row with the default align-items: stretch, so the shorter Stimmung field is stretched
   to match the taller, tag-count-dependent Tags field's height. A "flex: 1" here previously
   made this wrapper (the positioning anchor for .combobox__listbox) grow to fill that
   stretched height too, so the suggestion popup's "top: 100%" landed at the bottom of the
   whole stretched column instead of right below the visible input. Horizontal growth for the
   Tags row's side-by-side layout is restored separately via .tag-input-row .combobox below. */
.combobox {
  position: relative;
}

.combobox__listbox {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-height: 240px;
  overflow-y: auto;
}

/* Hard, client-side-only safety net: the "hidden" attribute above is driven by the server-side
   _IsOpen field and only updates once the Blazor Server round-trip for blur/focus completes.
   That round-trip is not instantaneous, and a real (non-synthetic) Tab keypress can move focus
   to the next field before it lands, leaving the popup visible — and, per user reports, also
   caught up in a much more disruptive focus race — for that brief window. This rule hides the
   popup the instant the input genuinely loses focus, purely via the browser's own native
   :focus-within tracking, with zero dependency on any server round-trip. It only ever hides
   (never shows) the popup, so it cannot fight with the "hidden" attribute's own logic (e.g.
   Escape while still focused, which :focus-within alone would not close).  */
.combobox:not(:focus-within) .combobox__listbox {
  display: none !important;
}

.combobox__option {
  padding: 0.45rem 0.75rem;
  font-size: 0.9375rem;
  color: #374151;
  cursor: pointer;
}

.combobox__option:hover {
  background-color: #eff6ff;
}

.combobox__option--highlighted,
.combobox__option--highlighted:hover {
  background-color: #2563eb;
  color: #fff;
}

/* =============================================
   Import / Export page
   ============================================= */
.ie-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
}

.ie-section h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.ie-description {
  color: #6b7280;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

/* Plain-text export warning box (audit M-5). */
.ie-export-warning {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 0.375rem;
  color: #78350f;
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.ie-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ie-filter-grid .form-field {
  flex: 1 1 180px;
  min-width: 150px;
}

.ie-tag-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.ie-tag-fieldset legend {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  padding: 0 0.4rem;
}

.ie-tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.ie-tag-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.ie-filter-summary {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 1rem;
  min-height: 1.5rem;
}

.ie-filter-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  color: #1d4ed8;
}

.ie-preview-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  background: #f8fafc;
}

.ie-preview-card h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #374151;
}

.ie-preview-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.ie-preview-dl dt {
  font-weight: 600;
  color: #6b7280;
  align-self: start;
}

.ie-preview-dl dd {
  color: #1a1a1a;
  word-break: break-word;
}

.ie-content-preview {
  white-space: pre-wrap;
  font-family: inherit;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.6;
  max-height: 10rem;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  background: #fff;
}

.ie-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ie-badge--entry {
  background: #dcfce7;
  color: #15803d;
}

.ie-badge--reflection {
  background: #ede9fe;
  color: #7c3aed;
}

.ie-badge--error {
  background: #fee2e2;
  color: #b91c1c;
}

/* =============================================
   Import queue table
   ============================================= */
.import-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  color: #374151;
}

.import-summary__ok {
  color: #15803d;
  font-weight: 600;
}

.import-summary__err {
  color: #b91c1c;
  font-weight: 600;
}

.import-table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}

.import-table thead {
  background: #f8fafc;
}

.import-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.import-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1a1a1a;
}

.import-table tbody tr:last-child td {
  border-bottom: none;
}

.import-row--ok {
  background: #f0fdf4;
}

.import-row--error {
  background: #fff5f5;
}

.import-status-cell {
  width: 2.5rem;
  text-align: center;
}

.import-status {
  font-size: 1rem;
  font-weight: 700;
}

.import-status--ok  { color: #16a34a; }
.import-status--err { color: #dc2626; cursor: help; }
.import-status--pending { color: #9ca3af; }

.import-filename {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
  font-size: 0.8125rem;
  color: #374151;
}

.import-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 12rem;
}

.import-title {
  font-weight: 500;
  color: #111827;
}

.import-date {
  font-size: 0.8rem;
  color: #6b7280;
}

.import-error-hint {
  font-size: 0.8rem;
  color: #b91c1c;
  word-break: break-word;
}

.success-message {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

/* =============================================
   Admin stats section
   ============================================= */
.stats-table .stats-col-num {
  text-align: right;
  white-space: nowrap;
  width: 6rem;
}

.stats-own-badge {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: 0.35rem;
}

.stats-info-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
}

.stats-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stats-info-item dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-info-item dd {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

/* =============================================
   Admin user selector
   ============================================= */
.user-selector-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.admin-section-user-hint {
  font-size: 0.875rem;
  font-weight: 400;
  color: #6b7280;
  margin-left: 0.4rem;
}

/* =============================================
   Mobile top bar (hidden on desktop)
   ============================================= */
.mobile-topbar {
  display: none;
}

.nav-backdrop {
  display: none;
}

/* =============================================
   Responsive — Mobile (≤ 768px)
   ============================================= */
@media (max-width: 768px) {

  /* --- Mobile top bar --- */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #1e293b;
    padding: 0 1rem;
    z-index: 900;
  }

  .mobile-app-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    min-width: 44px;
    min-height: 44px;
    transition: background 0.15s;
  }

  .hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  /* Three-line hamburger icon via CSS */
  .hamburger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: #f8fafc;
    position: relative;
  }

  .hamburger-icon::before,
  .hamburger-icon::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: #f8fafc;
    position: absolute;
    left: 0;
  }

  .hamburger-icon::before {
    top: -7px;
  }

  .hamburger-icon::after {
    top: 7px;
  }

  /* --- Backdrop overlay behind open sidebar --- */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    top: 56px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 950;
  }

  /* --- Layout: shift content down for fixed topbar --- */
  .layout {
    padding-top: 56px;
  }

  /* --- Sidebar: slide-in overlay --- */
  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 280px;
    height: calc(100vh - 56px);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    /* Keep desktop sidebar styles (background, padding, etc.) */
  }

  .sidebar--open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  /* --- Content area --- */
  .content {
    padding: 1.25rem 1rem;
    width: 100%;
  }

  .content h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  /* --- Page header: stack on very small screens --- */
  .page-header {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .page-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* --- Entry form --- */
  .entry-form-container {
    padding: 1.1rem;
    border-radius: 8px;
  }

  /* Datum-Feld soll auf Mobile genauso flexibel wie die anderen sein */
  .form-field--narrow {
    flex: 1 !important;
  }

  /* --- Admin sections --- */
  .admin-section {
    max-width: 100%;
    padding: 1.1rem;
  }

  /* Admin-Tabellen horizontal scrollbar statt abschneiden */
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* --- Import/Export --- */
  .ie-section {
    padding: 1.25rem 1rem;
  }

  .ie-preview-dl {
    grid-template-columns: 100px 1fr;
  }

  /* --- Reflections --- */
  .reflections-section {
    max-width: 100%;
  }

  /* --- Login / Register --- */
  .login-container section {
    padding: 1.5rem 1.25rem;
  }
}
