/* Upvote — Custom Minimal (Ultra-flat, Single Column) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #16181c;
  --surface-2: #0f1419;
  --border: #2f3336;
  --text: #e7e9ea;
  --text-muted: #71767b;
  --blue: 29, 155, 240;
  --blue-hover: 26, 140, 216;
  --tab-new: 29, 155, 240;
  --tab-top: 249, 115, 22;
  --tab-views: 34, 197, 94;
  --tab-trend: 168, 85, 247;
  --accent: rgb(var(--blue));
  --accent-contrast: #ffffff;
  --radius-pill: 999px;
  --radius-lg: 24px;
  --radius-md: 12px;
  --feed-width: 680px;
  --page-gutter: 1.5rem;
  --font: "Instrument Sans", system-ui, -apple-system, sans-serif;
}

@media (max-width: 520px) {
  :root {
    --page-gutter: 1rem;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

/* Header */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  max-width: var(--feed-width);
  padding: 1.5rem var(--page-gutter);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}

.top-bar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  text-decoration: none;
}

.logo__icon {
  width: 44px;
  height: 44px;
  background: var(--text);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.logo:hover .logo__icon {
  transform: translateY(-2px);
}

.auth-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-menu {
  position: relative;
}

.profile-menu__btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-menu__btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.profile-menu__avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.profile-menu__dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border-radius: 14px;
  padding: 0.35rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.6);
  z-index: 2500;
}

.profile-menu__item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.profile-menu__item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.25rem 0.25rem 0.4rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
}

.profile-pill__avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(var(--blue), 0.18);
  color: rgba(219, 234, 254, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
}

.profile-pill__name {
  font-weight: 850;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pill__form {
  display: inline-flex;
}

.profile-pill__logout {
  width: 40px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-pill__logout:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auth-mini__text {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgb(var(--blue));
  color: var(--accent-contrast);
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-mini__btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.auth-mini button[data-open-auth="login"] {
  border-color: rgba(var(--blue), 0.8);
  color: rgb(var(--blue));
}

.auth-mini__btn--primary {
  background: rgb(var(--blue));
  color: var(--accent-contrast);
  border-color: transparent;
}

.auth-mini__btn--primary:hover {
  background: rgb(var(--blue-hover));
}

@media (max-width: 420px) {
  .top-bar {
    padding: 1.25rem var(--page-gutter);
  }

  .top-bar__row {
    gap: 0.75rem;
  }

  .auth-mini {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .auth-mini__btn {
    min-height: 44px;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  .notif-bell {
    width: 44px;
    height: 44px;
  }

  .profile-menu__btn {
    width: 44px;
    height: 44px;
  }

  .profile-pill__name {
    display: none;
  }



  .search-field {
    padding: 0.9rem 1.25rem;
  }
}

@media (max-width: 520px) {
  .feed-search-wrap {
    margin: 1.75rem 0 2.25rem;
  }

  .post__meta {
    flex-wrap: wrap;
    row-gap: 0.4rem;
    column-gap: 0.55rem;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
  }

  .post__content {
    font-size: 1rem;
  }

  .notification {
    grid-template-columns: 44px 1fr;
    row-gap: 0.35rem;
  }

  .notification__time {
    grid-column: 2;
    margin-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 380px) {
  .auth-mini__text {
    display: none;
  }
}

/* Feed */
.feed {
  width: 100%;
  max-width: var(--feed-width);
  padding: 0 var(--page-gutter) calc(5rem + 140px + env(safe-area-inset-bottom));
}

.feed-search-wrap {
  width: 100%;
  margin: 2.5rem 0 3rem;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-pill);
}

.search-field:focus-within {
  background: rgba(255, 255, 255, 0.04);
}

.search-field__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.search-field__input:focus {
  outline: none;
}

.search-field__icon {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Composer */
.composer {
  margin-bottom: 4rem;
}

.composer__summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.5rem;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  background: rgba(var(--blue), 0.12);
  border-radius: var(--radius-pill);
  text-align: center;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.composer__summary i {
  font-size: 0.95em;
  opacity: 0.95;
}

.composer__summary::-webkit-details-marker {
  display: none;
}

.composer__form {
  margin-top: 1.25rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(var(--blue), 0.08);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.composer__form > * {
  position: relative;
  z-index: 1;
}

.field input,
.field textarea {
  width: 100%;
  padding: 1rem 1.5rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.field textarea {
  border-radius: var(--radius-lg);
  min-height: 120px;
  resize: none;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn--primary {
  background: rgb(var(--blue));
  color: var(--accent-contrast);
  padding: 0.85rem 2rem;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
}

.btn--primary:hover {
  background: rgb(var(--blue-hover));
}

.fab {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgb(var(--blue));
  color: var(--accent-contrast);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1800;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.fab-stack {
  position: fixed;
  right: var(--page-gutter);
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  z-index: 1800;
}

.fab-stack .fab {
  position: static;
}

.fab--search {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.fab--search:hover {
  background: rgba(255, 255, 255, 0.1);
}


.search-modal__title {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.search-modal__field {
  margin-bottom: 0.75rem;
}

.search-modal__card {
  max-width: var(--feed-width);
}

.fab:hover {
  background: rgb(var(--blue-hover));
}

.fab i {
  font-size: 1.05rem;
}

.compose-modal__title {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

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

.compose-modal__card {
  max-width: var(--feed-width);
}


/* Nav */
.feed-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.feed-sort__btn {
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(231, 233, 234, 0.82);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.feed-sort__btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.feed-sort__btn i {
  font-size: 1.1em;
  opacity: 0.95;
}

.feed-sort__btn--active {
  color: var(--text);
}

.feed-sort__btn--active.feed-sort__btn--new {
  background: rgba(var(--tab-new), 0.18);
}

.feed-sort__btn--active.feed-sort__btn--top {
  background: rgba(var(--tab-top), 0.18);
}

.feed-sort__btn--active.feed-sort__btn--views {
  background: rgba(var(--tab-views), 0.18);
}

.feed-sort__btn--active.feed-sort__btn--trend {
  background: rgba(var(--tab-trend), 0.18);
}

@media (max-width: 520px) {
  .feed-sort {
    gap: 0.6rem;
  }

  .feed-sort__btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
  }
}

/* Post Items - Image -> Title -> Meta -> Text */
.post-list {
  margin: 0;
  padding: 0;
}

.post {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 5rem;
  position: relative;
}

.post:hover .post__title a {
  color: var(--text-muted);
}

.post__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post__media {
  width: 100%;
  display: block;
  z-index: 2;
  position: relative;
}

.post__expand,
.auth-mini__btn,
.composer__summary {
  z-index: 3;
  position: relative;
}

.post__media {
  width: 100%;
}

.post__thumb-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.post__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post__title {
  font-size: clamp(1.15rem, 4.4vw, 1.35rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 0;
}

.post__title a {
  color: inherit;
  text-decoration: none;
}

.post__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.65rem;
}

.post__comments {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.post__comments i {
  font-size: 0.9em;
}

.post__time,
.post__opens {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.post__views {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.post__time i,
.post__opens i {
  font-size: 0.9em;
}

.post__views i {
  font-size: 0.9em;
}

.post__author {
  color: var(--text);
}

.post__sep {
  opacity: 0.2;
}

.post__content-wrapper {
  margin-top: 1rem;
}

.post__content {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.post__content--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post__expand {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0;
  margin-top: 0.5rem;
  cursor: pointer;
}

/* Modals */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.auth-modal__card {
  position: relative;
  width: 100%;
  max-width: var(--feed-width);
  background: var(--surface);
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  transform: translateY(28px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.auth-modal:not([hidden]) .auth-modal__backdrop {
  opacity: 1;
}

.auth-modal:not([hidden]) .auth-modal__card {
  transform: translateY(0);
  opacity: 1;
}

.auth-modal__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

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

.auth-form__field span {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.auth-form__field input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: none;
  color: var(--text);
  font: inherit;
}

.auth-modal__switch {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-modal__switch-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

/* Footer */
.footer {
  padding: 4rem var(--page-gutter);
  text-align: center;
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Comments Section */
.comments-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.comments-section__title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 2rem 0;
}

.comments-section__count {
  color: var(--text-muted);
  font-weight: 400;
}

.comment-form {
  margin-bottom: 3rem;
}

.comment-form__input-row {
  margin-bottom: 1rem;
}

.comment-form__textarea {
  width: 100%;
  padding: 1rem 1.5rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  resize: none;
  min-height: 80px;
}

.comment-form__textarea:focus {
  outline: none;
}

.comment-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.comment-form__replying-to {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
}

.comment-form__cancel-reply {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.comment-form__submit {
  padding: 0.6rem 1.5rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.comments-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

.comment {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: none;
}

.comment__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.comment__author {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.comment__sep {
  color: var(--text-muted);
  opacity: 0.3;
}

.comment__time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment__reply-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.comment__body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.comment__actions {
  display: flex;
  gap: 1rem;
}

.comment-replies {
  margin-top: 1rem;
}

.comment-replies__toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.comment-replies__toggle::-webkit-details-marker {
  display: none;
}

.comment-replies[open] .comment-replies__toggle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.comment-replies__toggle-close {
  display: none;
}

.comment-replies[open] .comment-replies__toggle-open {
  display: none;
}

.comment-replies[open] .comment-replies__toggle-close {
  display: inline;
}

.comment__reply-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.comment__reply-btn:hover {
  color: var(--text);
}

.comment__replies {
  margin-top: 1.5rem;
  margin-left: 2rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment--reply {
  padding-bottom: 0;
  border-bottom: none;
}

.share {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.post-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.share--inline {
  margin-left: 0.25rem;
}

.share__btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: none;
  border-radius: var(--radius-pill);
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  justify-content: center;
}

.share__btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.share__btn i {
  font-size: 0.95em;
  opacity: 0.9;
}

.flash--error {
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.notifications__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.notifications__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notifications__empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

.notifications__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notification {
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  padding: 0.95rem 1.05rem;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  column-gap: 0.9rem;
  position: relative;
  overflow: hidden;
  outline: none;
  border: none;
}

.notification--unread {
  background: rgba(var(--blue), 0.12);
}

.notification--unread::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--blue));
}

.notification:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notification--unread:hover {
  background: rgba(var(--blue), 0.16);
}

.notification__icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.9);
  z-index: 1;
}

.notification--unread .notification__icon {
  background: rgba(var(--blue), 0.18);
  color: rgba(219, 234, 254, 0.95);
}

.notification__text {
  display: block;
  line-height: 1.35;
  z-index: 1;
  min-width: 0;
}

.notification__post {
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification__time {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1;
  align-self: start;
  margin-top: 0.15rem;
  padding-right: 14px;
}

body.admin {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.admin-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.admin-sidebar {
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-sidebar__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(var(--blue));
  box-shadow: 0 0 0 4px rgba(var(--blue), 0.12);
}

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

.admin-nav__link {
  text-decoration: none;
  color: rgba(231, 233, 234, 0.85);
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav__link:hover {
  background: rgba(255, 255, 255, 0.04);
}

.admin-nav__link--active {
  background: rgba(var(--blue), 0.14);
  color: var(--text);
}

.admin-sidebar__spacer {
  flex: 1;
}

.admin-sidebar__me {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-sidebar__meName {
  font-weight: 700;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main {
  padding: 1.5rem 1.5rem 3rem;
}

.admin-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-top__title {
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.admin-top__sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.admin-link {
  color: rgb(var(--blue));
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-seg {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-seg__item {
  text-decoration: none;
  color: rgba(231, 233, 234, 0.8);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-seg__item.is-active {
  background: rgba(var(--blue), 0.18);
  color: var(--text);
}

.admin-date {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-date__input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
}

.admin-date__sep {
  color: var(--text-muted);
}

.admin-btn {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-btn--primary {
  background: rgb(var(--blue));
  border-color: transparent;
  color: var(--accent-contrast);
}

.admin-btn--primary:hover {
  background: rgb(var(--blue-hover));
}

.admin-btn--secondary {
  background: rgba(255, 255, 255, 0.04);
}

.admin-btn--ghost {
  border-color: rgba(255, 255, 255, 0.06);
  padding: 0.45rem 0.8rem;
}

.admin-banner {
  background: rgba(var(--blue), 0.10);
  border: 1px solid rgba(var(--blue), 0.18);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  color: rgba(231, 233, 234, 0.9);
  margin-bottom: 1rem;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.admin-kpi__label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-kpi__value {
  font-size: 1.6rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  margin-top: 0.25rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.admin-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  overflow: hidden;
}

.admin-card__head {
  padding: 1rem 1rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-card__title {
  font-weight: 850;
  letter-spacing: -0.02em;
}

.admin-card__sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.admin-chartWrap {
  padding: 0 1rem 1rem;
  height: 320px;
}

.admin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.admin-legend__item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: rgba(231, 233, 234, 0.9);
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-legend__item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
}

.admin-legend__item.is-off {
  opacity: 0.55;
}

.admin-tableWrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.admin-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.admin-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-table__meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.admin-events {
  padding: 0.35rem 0;
}

.admin-event {
  display: grid;
  grid-template-columns: 110px 160px 1fr;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-event__type {
  font-weight: 800;
  color: rgba(231, 233, 234, 0.92);
}

.admin-event__time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.admin-event__meta {
  color: rgba(231, 233, 234, 0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-empty {
  padding: 1rem;
  color: var(--text-muted);
}

.admin-login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.admin-login__card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  padding: 1.25rem;
}

.admin-login__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-login__logo {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(var(--blue), 0.16);
  color: rgb(var(--blue));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-login__title {
  font-weight: 850;
  letter-spacing: -0.03em;
}

.admin-login__subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.1rem;
}

.admin-login__error {
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.18);
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  margin-bottom: 0.9rem;
}

.admin-login__form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-field__label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-field__input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  font: inherit;
}

.admin-login__footer {
  margin-top: 0.9rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .admin-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .admin-nav {
    flex-direction: row;
    gap: 0.25rem;
  }

  .admin-sidebar__spacer {
    display: none;
  }
}

@media (max-width: 520px) {
  .admin-main {
    padding: 1.25rem 1rem 2.5rem;
  }

  .admin-top {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-chartWrap {
    height: 260px;
  }

  .admin-event {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}
