html {
  background-color: rgba(27, 38, 54, 1);
  color: #e8eef7;
}

body {
  margin: 0;
  color: #e8eef7;
  font-family:
    "Nunito",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Roboto",
    "Oxygen",
    "Ubuntu",
    "Cantarell",
    "Fira Sans",
    "Droid Sans",
    "Helvetica Neue",
    sans-serif;
}

* {
  box-sizing: border-box;
}

a {
  color: #8cb4ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.1rem 0.75rem 1.25rem;
  background: rgba(16, 24, 38, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  padding: 0 0.45rem;
}

.logo {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.tagline {
  margin: 0.15rem 0 0;
  color: #9aacbf;
  font-size: 0.78rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #e8eef7;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(61, 126, 232, 0.28);
  color: #d6e6ff;
}

.nav-form {
  margin: 0;
}

.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-user .meta {
  min-width: 0;
}

.sidebar-user .name {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .login {
  margin: 0;
  color: #9aacbf;
  font-size: 0.72rem;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.4rem 1.6rem;
  overflow: auto;
  max-height: 100vh;
}

.page-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  background: rgba(176, 52, 72, 0.28);
  border: 1px solid rgba(240, 160, 168, 0.35);
  border-radius: 8px;
  color: #ffd6da;
}

.card {
  background: rgba(36, 48, 68, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  min-width: 0;
}

.card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.hint {
  margin: 0 0 0.75rem;
  color: #9aacbf;
  font-size: 0.88rem;
}

.error {
  margin: 0 0 0.75rem;
  color: #f0a0a8;
  font-size: 0.88rem;
}

.ok {
  margin: 0 0 0.75rem;
  color: #8ad7a5;
  font-size: 0.88rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #9aacbf;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}

.form-row label {
  flex: 1;
  min-width: 10rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

input,
select {
  background: rgba(16, 24, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: #e8eef7;
  padding: 0.45rem 0.6rem;
  font-size: 0.92rem;
  outline: none;
  width: 100%;
}

input:focus,
select:focus {
  border-color: rgba(122, 176, 255, 0.7);
}

.btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8eef7;
  border-radius: 7px;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

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

.btn.primary {
  background: #3d7ee8;
  border-color: #3d7ee8;
}

.btn.primary:hover:not(:disabled) {
  background: #5590f0;
}

.btn.ghost {
  background: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.running {
  background: rgba(74, 168, 112, 0.22);
  color: #8ad7a5;
}

.badge.stopped {
  background: rgba(154, 172, 191, 0.16);
  color: #9aacbf;
}

.badge.error {
  background: rgba(176, 52, 72, 0.28);
  color: #ffd6da;
}

.avatar,
.avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(61, 126, 232, 0.35);
}

.avatar.lg,
.avatar-fallback.lg {
  width: 56px;
  height: 56px;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #d6e6ff;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.user-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  background: rgba(16, 24, 38, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

a.user-card:hover {
  border-color: rgba(122, 176, 255, 0.45);
  text-decoration: none;
}

.user-card.disabled {
  opacity: 0.72;
}

.user-card .body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.user-card strong {
  font-size: 0.95rem;
}

.user-card .sub {
  color: #9aacbf;
  font-size: 0.78rem;
}

.identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.identity h2 {
  margin: 0 0 0.2rem;
}

.user-card.current,
a.user-card.current {
  border-color: rgba(122, 176, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(61, 126, 232, 0.35);
}

.channel-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0.85rem 0 0.35rem;
}

.streamer-carousel {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.35rem 0 0.55rem;
  margin: 0.2rem 0 0.4rem;
}

.carousel-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 7.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.5rem;
  background: rgba(16, 24, 38, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  text-align: center;
}

a.carousel-card:hover {
  border-color: rgba(122, 176, 255, 0.45);
  text-decoration: none;
}

.carousel-card.current {
  border-color: rgba(122, 176, 255, 0.7);
  background: rgba(61, 126, 232, 0.18);
}

.carousel-card.disabled {
  opacity: 0.72;
}

.carousel-name {
  font-size: 0.78rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.collection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.collection-head h2 {
  margin: 0 0 0.35rem;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0.4rem 0 0;
  list-style: none;
}

.item-grid li,
.item-card {
  background: rgba(16, 24, 38, 0.7);
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.item-thumb {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 12, 20, 0.9);
  cursor: pointer;
}

.item-thumb img,
.item-ph {
  width: 100%;
  height: 7rem;
  object-fit: contain;
  display: block;
}

.item-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aacbf;
  font-size: 0.78rem;
}

.item-card.locked .item-thumb img,
.item-card.locked .item-ph {
  filter: brightness(0.16) saturate(0.25);
}

.item-card.locked .item-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.55);
}

.item-grid form {
  margin-top: 0.4rem;
}

.item-grid .qty {
  color: #9aacbf;
  font-size: 0.8rem;
}

.item-lightbox {
  width: min(46rem, calc(100vw - 2rem));
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0;
  background: rgba(20, 30, 46, 0.97);
  color: #e8eef7;
}

.item-lightbox::backdrop {
  background: rgba(6, 10, 18, 0.72);
}

.lightbox-frame {
  position: relative;
  padding: 1.1rem 1.2rem 1.25rem;
}

.lightbox-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 42%;
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 24, 38, 0.85);
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
}

.lightbox-nav.prev {
  left: 0.5rem;
}

.lightbox-nav.next {
  right: 0.5rem;
}

.lightbox-media {
  position: relative;
  margin: 0.4rem auto 0.85rem;
  max-width: 28rem;
  min-height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
  {{/* background: rgba(8, 12, 20, 0.9); */}}
  border-radius: 12px;
  overflow: hidden;
}

.lightbox-media img {
  width: 100%;
  max-height: min(62vh, 28rem);
  object-fit: contain;
  display: block;
}

.lightbox-media.locked img,
.lightbox-media.locked .item-ph {
  filter: brightness(0.16) saturate(0.25);
}

.lightbox-media.locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.55);
}

.lightbox-meta h3 {
  margin: 0 0 0.25rem;
}

.lightbox-meta .qty {
  margin: 0 0 0.75rem;
}

.lightbox-meta .error {
  margin: 0 0 0.65rem;
}

.search-form {
  margin: 0 0 0.9rem;
}

@media (max-width: 720px) {
  .shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .main {
    max-height: none;
  }
}
