* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0f1115;
  color: #f2f3f5;
}

html {
  scroll-behavior: smooth;
}

.wrap {
  width: min(1100px, 94vw);
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid #2a2f3a;
  background: #0b0d12;
  position: sticky;
  top: 0;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-size: 1.1rem;
  color: #e8c56a;
  text-decoration: none;
  font-weight: 700;
}

main {
  padding: 20px 0 36px;
}

.panel, .card {
  background: #151923;
  border: 1px solid #262c39;
  border-radius: 10px;
  padding: 16px;
}

.panel-narrow {
  width: min(520px, 100%);
  margin: 24px auto;
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.center {
  text-align: center;
}

.login-splash {
  min-height: 100vh;
  padding: 36px 0;
}

.panel-overlay {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

.logo {
  max-width: 420px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.stack {
  display: grid;
  gap: 10px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  background: #0f131c;
  color: #f2f3f5;
  border: 1px solid #2b3344;
  border-radius: 8px;
  padding: 9px 10px;
  min-height: 44px;
}

.btn {
  border: 1px solid #495472;
  background: #1b2130;
  color: #f2f3f5;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
  cursor: pointer;
}

.btn-primary {
  border-color: #cfac4f;
  color: #111;
  background: #e8c56a;
}

.btn-danger {
  border-color: #8f3140;
  background: #6d2230;
}

.card {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card:hover {
  border-color: rgba(207, 172, 79, 0.45);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.rating {
  color: #e8c56a;
}

.poster {
  margin-top: 8px;
  max-height: 280px;
  border-radius: 8px;
}

.feed-logo {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.feed-logo img {
  max-width: 380px;
  width: 100%;
  height: auto;
}

.muted {
  color: #9ea8bd;
}

.small {
  font-size: 0.85rem;
}

.messages {
  margin-bottom: 12px;
}

.msg {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.msg.success {
  background: #17351f;
  border: 1px solid #2a6a3c;
}

.msg.error {
  background: #3a1a1f;
  border: 1px solid #7a2b36;
}

@media (max-width: 900px) {
  .grid, .split {
    grid-template-columns: 1fr;
  }
}

.btn-link {
  border: none;
  background: transparent;
  padding: 0;
  color: #cfac4f;
  text-decoration: underline;
  cursor: pointer;
}

.login-grid {
  grid-template-columns: 1fr;
  margin: 24px auto 0;
  max-width: 920px;
}

.feed-layout {
  align-items: start;
}

.app-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 88px);
  overflow: auto;
  padding-right: 4px;
}

.sidebar-toggle {
  display: none;
}

.sidebar-sections {
  display: grid;
  gap: 10px;
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}

.sidebar-logo img {
  width: 100%;
  max-width: 240px;
  height: auto;
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  color: #f2f3f5;
  text-decoration: none;
  border: 1px solid #313b50;
  border-radius: 8px;
  padding: 8px 10px;
  background: #111725;
}

.menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #cfac4f;
  background: rgba(207, 172, 79, 0.22);
  color: #f4d889;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.menu-link:hover {
  border-color: #cfac4f;
  color: #e8c56a;
}

.menu-link.active {
  border-color: #cfac4f;
  background: rgba(207, 172, 79, 0.18);
  color: #f4d889;
}

.menu-link.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #e8c56a;
}

.sidebar-bottom {
  margin-top: 2px;
}

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

.content-area .panel,
.content-area .card {
  overflow-wrap: anywhere;
}

.divider {
  height: 1px;
  background: #262c39;
  margin: 14px 0;
}

.tmdb-form {
  margin-top: 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  margin-top: 12px;
}

.card-media {
  min-width: 0;
}

.card-body {
  min-width: 0;
}

.comment {
  margin: 8px 0 10px;
  line-height: 1.55;
  font-style: italic;
  color: #d6dae6;
}

.code {
  background: #0f131c;
  border: 1px solid #2b3344;
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.tabbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab {
  padding: 8px 12px;
  border: 1px solid #495472;
  border-radius: 8px;
  text-decoration: none;
  color: #f2f3f5;
  background: #1b2130;
}

.tab.active {
  border-color: #cfac4f;
  color: #111;
  background: #e8c56a;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr 280px 220px;
  gap: 12px;
  padding: 12px;
  border: 1px solid #262c39;
  border-radius: 10px;
  background: #111521;
  margin-bottom: 10px;
  align-items: start;
}

.user-actions {
  margin-top: 6px;
}

.user-row-actions {
  display: grid;
  gap: 8px;
}

.user-delete {
  margin-top: 8px;
}

.confirm-check {
  font-size: 0.92rem;
  color: #d0d0d0;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #262c39;
}

.stream-row {
  margin: 10px 0;
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .sidebar-toggle {
    display: block;
    width: 100%;
  }

  .sidebar-sections {
    display: none;
  }

  .sidebar.is-open .sidebar-sections {
    display: grid;
  }
}

@media (max-width: 1200px) {
  .wrap {
    width: min(1160px, 96vw);
  }

  .app-layout {
    grid-template-columns: 290px 1fr;
    gap: 14px;
  }

  .card-grid {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 1024px) {
  .grid,
  .split {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .sidebar-toggle {
    display: block;
    width: 100%;
  }

  .sidebar-sections {
    display: none;
  }

  .sidebar.is-open .sidebar-sections {
    display: grid;
  }

  .sidebar-logo img {
    max-width: 210px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .topbar-inner {
    min-height: 56px;
  }

  .brand {
    font-size: 1rem;
  }

  .panel,
  .card {
    padding: 12px;
    border-radius: 8px;
  }

  .card-head h3 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .poster {
    max-height: 230px;
  }

  label {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card:hover {
    transform: none;
  }
}
