:root {
  --pc-bg: #f4f1ea;
  --pc-surface: rgba(255, 255, 255, 0.82);
  --pc-surface-strong: #ffffff;
  --pc-ink: #1f2a33;
  --pc-accent: #14532d;
  --pc-accent-soft: #e8f3eb;
  --pc-border: rgba(31, 42, 51, 0.12);
  --pc-sidebar-width-open: 18rem;
  --pc-sidebar-width-collapsed: 5.25rem;
}

body.app-shell {
  background:
    radial-gradient(circle at top right, rgba(20, 83, 45, 0.10), transparent 30%),
    linear-gradient(180deg, #fbfaf7 0%, var(--pc-bg) 100%);
  color: var(--pc-ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.app-login-shell {
  min-height: 100vh;
}

.app-login-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.app-login-panel {
  width: min(100%, 28rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--pc-border);
  border-radius: 0.75rem;
  background: var(--pc-surface-strong);
}

.app-sidebar {
  width: var(--pc-sidebar-width-open);
  flex: 0 0 var(--pc-sidebar-width-open);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  transition: width 180ms ease, flex-basis 180ms ease;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-sidebar-brand-copy {
  min-width: 0;
}

.app-sidebar-toggle {
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
}

.app-filters-column {
  width: 100%;
  max-width: 22rem;
  flex: 0 0 auto;
}

.app-filters-column--stacked {
  max-width: none;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.9rem;
  color: #44515d;
  white-space: nowrap;
}

.app-nav-link i {
  flex: 0 0 auto;
  font-size: 1.05rem;
}

.app-nav-link.active,
.app-nav-link:hover {
  background: var(--pc-accent-soft);
  color: var(--pc-accent);
}

.card,
.accordion-item,
.list-group-item {
  border-color: var(--pc-border);
}

.card,
.accordion-item {
  background: var(--pc-surface);
  backdrop-filter: blur(12px);
}

.json-block {
  margin: 0;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #18212a;
  color: #d6e4f0;
  font-size: 0.85rem;
  max-height: 24rem;
  overflow: auto;
}

.table > :not(caption) > * > * {
  background-color: transparent;
}

.min-w-0 {
  min-width: 0;
}

textarea.form-control[readonly] {
  background-color: rgba(248, 249, 250, 0.7);
}

.analytics-chart-shell {
  position: relative;
  height: 20rem;
  min-height: 20rem;
}

.analytics-chart-shell canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.app-help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  cursor: help;
  line-height: 1;
}

.app-help-tip:hover,
.app-help-tip:focus-visible {
  color: var(--pc-accent);
  outline: none;
}

.podcast-synth-modal .modal-content {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.podcast-synth-modal .modal-dialog {
  height: calc(100dvh - 1rem);
  max-height: calc(100dvh - 1rem);
  margin: 0.5rem auto;
}

.podcast-synth-modal .podcast-synth-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.podcast-synth-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.podcast-synth-modal .modal-header,
.podcast-synth-modal .modal-footer {
  flex: 0 0 auto;
}

@media (min-width: 992px) {
  html.app-sidebar-collapsed .app-sidebar {
    width: var(--pc-sidebar-width-collapsed);
    flex-basis: var(--pc-sidebar-width-collapsed);
  }

  html.app-sidebar-collapsed .app-sidebar-brand {
    justify-content: center !important;
  }

  html.app-sidebar-collapsed .app-sidebar-brand-copy,
  html.app-sidebar-collapsed .app-sidebar-footer {
    display: none !important;
  }

  html.app-sidebar-collapsed .app-sidebar-nav {
    align-items: center;
  }

  html.app-sidebar-collapsed .app-nav-link {
    justify-content: center;
    gap: 0;
    width: 100%;
    padding-inline: 0.75rem;
  }

  html.app-sidebar-collapsed .app-nav-label {
    display: none;
  }
}

@media (max-width: 1199.98px) {
  .app-filters-column {
    max-width: none;
  }
}

@media (max-width: 991.98px) {
  .app-layout {
    display: block;
  }

  .app-sidebar {
    width: 100%;
    flex-basis: auto;
  }

  .app-sidebar-inner {
    min-height: auto;
  }
}
