:root {
  --bg: #070910;
  --panel: rgba(10, 15, 28, 0.82);
  --panel-strong: rgba(8, 12, 22, 0.94);
  --line: rgba(214, 182, 96, 0.18);
  --gold: #d6b660;
  --gold-bright: #f1dc9c;
  --ivory: #f4ead6;
  --copy: #cfd7e6;
  --mist: #adb7ca;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.46);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--copy);
  font-family: "Manrope", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(44, 77, 157, 0.22), transparent 30%),
    radial-gradient(circle at 88% 14%, rgba(214, 182, 96, 0.12), transparent 25%),
    linear-gradient(180deg, #04060b 0%, #07101f 40%, #08111c 60%, #05070c 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 30%, rgba(255, 255, 255, 0.42) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.36) 0 1px, transparent 1.5px),
    radial-gradient(circle at 60% 62%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1.5px);
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  position: relative;
}

.nav {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Cinzel", serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--mist);
}

.brand-mark {
  display: block;
  width: 64px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(214, 182, 96, 0.18));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--mist);
}

.nav-links a {
  opacity: 0.84;
}

.nav-links a:hover,
.nav-links a.is-active {
  opacity: 1;
  color: var(--ivory);
}

.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(214, 182, 96, 0.38);
  background: rgba(214, 182, 96, 0.08);
  color: var(--gold-bright);
  font: inherit;
  cursor: pointer;
}

.button-primary {
  color: #10131b;
  background: linear-gradient(135deg, #f0dfa9 0%, #d7b967 46%, #ae8530 100%);
  box-shadow: 0 16px 34px rgba(177, 136, 45, 0.28);
  border: 0;
}

.label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 182, 96, 0.55));
}

.eyebrow::after {
  background: linear-gradient(90deg, rgba(214, 182, 96, 0.55), transparent);
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ivory);
}

h1 {
  font-size: clamp(56px, 8vw, 94px);
  line-height: 0.95;
  color: transparent;
  background: linear-gradient(180deg, #fff8ea 0%, #ebe3d3 24%, #d7c8a0 56%, #fff5dc 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

h2 {
  font-size: clamp(30px, 4vw, 42px);
}

.admin-shell {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.admin-hero,
.admin-grid,
.stats-grid {
  display: grid;
  gap: 20px;
}

.admin-hero {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.stats-grid {
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-grid {
  margin-top: 22px;
  grid-template-columns: 1.15fr 0.85fr;
}

.admin-card,
.auth-card {
  padding: 30px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top center, rgba(214, 182, 96, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(11, 18, 34, 0.9), rgba(7, 10, 18, 0.97));
  border: 1px solid rgba(214, 182, 96, 0.14);
  box-shadow: var(--shadow);
}

.auth-copy {
  margin: 20px 0 0;
  line-height: 1.85;
  color: #c7d0e0;
  font-size: 18px;
}

.stat-feature {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.song-feature {
  min-height: 300px;
  align-items: stretch;
  text-align: left;
}

.stat-hero-value,
.stat-value {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ivory);
}

.stat-hero-value {
  margin-top: 14px;
  font-size: clamp(88px, 13vw, 150px);
  line-height: 0.9;
}

.stat-hero-note {
  margin-top: 14px;
  max-width: 300px;
  line-height: 1.75;
  color: #b6c0d2;
}

.song-ranking {
  margin-top: 26px;
  display: grid;
  gap: 14px;
}

.song-rank-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.song-rank-number {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  line-height: 1;
  color: var(--gold);
}

.song-rank-title {
  min-width: 0;
  color: var(--ivory);
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.song-rank-count {
  color: #bcc6d8;
  font-size: 15px;
  white-space: nowrap;
}

.stat-card {
  text-align: center;
}

.stat-value {
  margin-top: 10px;
  font-size: 58px;
  line-height: 1;
}

.action-card {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.stat-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 999px;
  color: #10131b;
  background: linear-gradient(135deg, #f0dfa9 0%, #d7b967 46%, #ae8530 100%);
  font-weight: 700;
  box-shadow: 0 16px 34px rgba(177, 136, 45, 0.22);
}

.reader-list,
.info-stack {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.reader-item,
.info-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reader-item strong,
.info-card strong {
  display: block;
  color: var(--ivory);
}

.reader-item span,
.info-card span {
  display: block;
  margin-top: 6px;
  line-height: 1.7;
  color: #bcc6d8;
}

.muted {
  color: #95a1b5;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell-admin {
  min-height: auto;
  padding: 16px 24px 72px;
}

.auth-card {
  width: min(560px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-logo {
  width: 72px;
  height: auto;
  display: block;
}

.auth-brand-text {
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auth-form label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.auth-form input {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ivory);
  font: inherit;
}

.auth-button {
  margin-top: 8px;
}

.auth-error {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(199, 99, 99, 0.24);
  background: rgba(199, 99, 99, 0.08);
  color: #ffd0d0;
}

.auth-success {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(112, 183, 126, 0.24);
  background: rgba(112, 183, 126, 0.08);
  color: #d8ffe0;
}

code {
  font-family: Consolas, "Courier New", monospace;
  color: var(--gold-bright);
}

.customer-management-shell {
  padding-top: 10px;
}

.customer-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 26px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(214, 182, 96, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(11, 18, 34, 0.84), rgba(7, 10, 18, 0.96));
  border: 1px solid rgba(214, 182, 96, 0.16);
  box-shadow: var(--shadow);
}

.page-heading {
  min-width: 0;
}

.page-heading h1 {
  margin-top: 8px;
  font-size: clamp(46px, 5vw, 68px);
}

.summary-pills {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: stretch;
}

.summary-pill {
  min-width: 154px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.summary-pill span {
  display: block;
  color: var(--mist);
  font-size: 13px;
}

.summary-pill strong {
  display: block;
  margin-top: 8px;
  color: var(--ivory);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 44px;
  line-height: 1;
}

.summary-pill.attention {
  border-color: rgba(214, 182, 96, 0.28);
  background: rgba(214, 182, 96, 0.08);
}

.customer-toolbar {
  margin-top: 18px;
  padding: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.search-box {
  flex: 1 1 340px;
  display: grid;
  gap: 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(3, 6, 12, 0.66);
  color: var(--ivory);
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.search-box input::placeholder {
  color: #7f8a9c;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  background: rgba(3, 6, 12, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--copy);
  cursor: pointer;
}

.filter-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.table-card {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
}

.table-wrap {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

.user-table th,
.user-table td {
  padding: 20px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: middle;
}

.user-table th:first-child,
.user-table td:first-child {
  width: 42%;
}

.user-table th:nth-child(2),
.user-table th:nth-child(3),
.user-table td:nth-child(2),
.user-table td:nth-child(3) {
  width: 16%;
  text-align: center;
}

.user-table th:last-child,
.user-table td:last-child {
  width: 26%;
}

.user-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--gold);
  background: rgba(7, 10, 18, 0.98);
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.user-table td {
  color: #d5dbea;
  font-size: 16px;
}

.user-table td strong,
.user-table td span {
  display: block;
}

.user-table td strong {
  color: var(--ivory);
  overflow-wrap: anywhere;
  font-size: 17px;
}

.user-table td span {
  margin-top: 5px;
  color: #9eaabd;
  font-size: 13px;
}

.communication-badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.25;
}

.communication-badge.none {
  color: #94a0b3;
  background: rgba(255, 255, 255, 0.045);
}

.communication-badge.sent {
  color: #d8ffe0;
  background: rgba(112, 183, 126, 0.12);
  border: 1px solid rgba(112, 183, 126, 0.24);
}

.communication-badge.failed {
  color: #ffd0d0;
  background: rgba(199, 99, 99, 0.1);
  border: 1px solid rgba(199, 99, 99, 0.22);
}

.needs-attention-row {
  background:
    linear-gradient(90deg, rgba(214, 182, 96, 0.16), rgba(214, 182, 96, 0.045) 38%, rgba(255, 255, 255, 0.015));
}

.needs-attention-row td:first-child {
  box-shadow: inset 5px 0 0 var(--gold);
}

.active-user-row {
  background: rgba(255, 255, 255, 0.015);
}

.user-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.activity-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.035);
}

.activity-dot.attention {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(214, 182, 96, 0.12);
}

.activity-dot.active {
  background: #70b77e;
  box-shadow: 0 0 0 5px rgba(112, 183, 126, 0.12);
}

.metric-cell {
  color: var(--ivory);
  font-weight: 700;
  font-size: 18px;
}

.activity-count-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(214, 182, 96, 0.2);
  background: rgba(214, 182, 96, 0.08);
  color: var(--ivory);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.activity-count-button:hover {
  background: rgba(214, 182, 96, 0.16);
  border-color: rgba(214, 182, 96, 0.42);
}

.customer-detail-card {
  margin-top: 20px;
}

.customer-detail-card[hidden] {
  display: none;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.detail-header h2 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 42px);
  overflow-wrap: anywhere;
}

.detail-close {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--copy);
  font: inherit;
  cursor: pointer;
}

.detail-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-grid h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.detail-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.detail-item,
.detail-empty {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.detail-item strong,
.detail-item span {
  display: block;
}

.detail-item strong {
  color: var(--ivory);
  overflow-wrap: anywhere;
}

.detail-item span {
  margin-top: 6px;
  color: #aeb9cb;
  line-height: 1.55;
}

.detail-empty {
  color: var(--mist);
}

.context-menu {
  position: fixed;
  z-index: 1000;
  width: min(320px, calc(100vw - 24px));
  padding: 10px;
  border-radius: 16px;
  background: rgba(7, 10, 18, 0.98);
  border: 1px solid rgba(214, 182, 96, 0.22);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

.context-menu[hidden] {
  display: none;
}

.context-menu-title {
  padding: 8px 10px 10px;
  color: var(--mist);
  font-size: 13px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.context-menu button {
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ivory);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.context-menu button:hover {
  background: rgba(214, 182, 96, 0.12);
  color: var(--gold-bright);
}

.admin-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  max-width: min(420px, calc(100vw - 48px));
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(7, 10, 18, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ivory);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.44);
}

.admin-toast[hidden] {
  display: none;
}

.admin-toast.success {
  border-color: rgba(112, 183, 126, 0.35);
}

.admin-toast.error {
  border-color: rgba(199, 99, 99, 0.42);
  color: #ffd0d0;
}

.status-chip {
  display: inline-flex;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: normal;
  line-height: 1.35;
  font-size: 13px;
}

.status-chip.attention {
  color: #ffecc0;
  background: rgba(214, 182, 96, 0.14);
  border: 1px solid rgba(214, 182, 96, 0.28);
}

.status-chip.active {
  color: #ccebd8;
  background: rgba(112, 183, 126, 0.1);
  border: 1px solid rgba(112, 183, 126, 0.22);
}

.empty-cell {
  padding: 34px 20px;
  color: var(--mist);
  text-align: center;
}

@media (max-width: 980px) {
  .admin-hero,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

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

  .customer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-pills {
    justify-content: flex-start;
  }

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

@media (max-width: 760px) {
  .nav,
  .admin-shell {
    width: min(var(--max), calc(100% - 24px));
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .song-rank-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .song-rank-count {
    grid-column: 2;
  }

  .nav {
    padding-top: 18px;
  }

  .nav-links a {
    display: none;
  }

  .nav-links a.is-active {
    display: inline-flex;
  }

  .admin-card,
  .auth-card {
    padding: 22px;
  }

  .table-card {
    padding: 0;
  }

  .summary-pill {
    min-width: calc(50% - 8px);
  }

  .customer-header {
    padding: 22px;
  }

  .page-heading h1 {
    font-size: clamp(44px, 16vw, 62px);
  }
}


