:root {
  --bg: #090f18;
  --bg-soft: #0f1725;
  --panel: #132033;
  --panel-soft: #1a2a40;
  --text: #f2f6ff;
  --text-dim: #b6c2d6;
  --accent: #ff7a18;
  --accent-2: #00d4ff;
  --success: #34d399;
  --danger: #ff6b6b;
  --border: rgba(255, 255, 255, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, #173359, transparent 38%),
    radial-gradient(circle at 80% 0%, #4a1f2f, transparent 30%),
    linear-gradient(150deg, #070d16 0%, #0e1522 55%, #111a2d 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 20px 60px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 28px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(255, 122, 24, 0.2), rgba(0, 212, 255, 0.1));
}

.kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.hero h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  line-height: 1.08;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 750px;
  color: var(--text-dim);
}

.account-bar {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(5, 14, 27, 0.35);
}

.account-user-text {
  margin: 0;
  color: #d7ecff;
  font-size: 0.93rem;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-link-btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  color: #051220;
  background: linear-gradient(95deg, var(--accent-2), #6ee7ff);
  border-radius: 9px;
  padding: 8px 12px;
}

.account-link-btn:hover {
  filter: brightness(1.04);
}

.logout-btn {
  background: linear-gradient(95deg, #ef4444, #f97316);
  color: #fff;
  padding: 8px 12px;
  border-radius: 9px;
}

.channel-notify-btn {
  background: linear-gradient(95deg, #14b8a6, #22d3ee);
  color: #06222c;
  padding: 8px 12px;
  border-radius: 9px;
}

.section {
  margin-top: 22px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  backdrop-filter: blur(4px);
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--text-dim);
}

.member-scroll-shell {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(7, 18, 33, 0.7), rgba(12, 25, 44, 0.55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  max-height: 470px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.member-scroll-shell::-webkit-scrollbar {
  width: 9px;
}

.member-scroll-shell::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.member-scroll-shell::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.45);
  border-radius: 999px;
}

.member-scroll-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.65);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-content: start;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(12px);
  opacity: 0;
  animation: rise 0.45s ease forwards;
}

.product-card h3 {
  margin: 0;
}

.description {
  margin: 0;
  color: var(--text-dim);
  min-height: 42px;
}

.price {
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  cursor: pointer;
  color: #051220;
  background: linear-gradient(95deg, var(--accent), #ffbe0b);
  transition: transform 0.12s ease, filter 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

button:disabled {
  cursor: not-allowed;
  background: #6c7484;
  transform: none;
  filter: none;
}

.order-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.order-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

.order-form input {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.order-form select {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.order-form input:focus,
.order-form select:focus {
  border-color: rgba(0, 212, 255, 0.7);
}

.payment-box {
  margin-top: 14px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
  border-radius: 12px;
  padding: 12px;
}

.payment-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.payment-box p {
  margin: 0 0 10px;
  color: #d0ffe9;
}

.qris-box {
  margin: 12px 0 10px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 10px;
  background: rgba(3, 14, 23, 0.32);
}

.qris-label {
  margin: 0 0 8px;
  color: #ddf7ff;
  font-size: 0.92rem;
}

.qris-image {
  width: 100%;
  max-width: 340px;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #fff;
}

.qris-image-hint {
  margin: 0;
  color: #fbbf24;
  font-size: 0.9rem;
}

.proof-upload-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 0.92rem;
}

.proof-upload-label input[type="file"] {
  width: 100%;
  color: #f8f8f8;
  background: rgba(8, 20, 30, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px;
}

.open-channel-btn {
  display: inline-block;
  margin-top: 6px;
  text-decoration: none;
  font-weight: 700;
  color: #051220;
  background: linear-gradient(95deg, var(--accent-2), #6ee7ff);
  border-radius: 10px;
  padding: 10px 14px;
}

.open-channel-btn:hover {
  filter: brightness(1.04);
}

.order-status {
  margin-top: 10px;
  font-size: 0.94rem;
  color: var(--text-dim);
}

.order-status.error {
  color: var(--danger);
}

.order-status.success {
  color: var(--success);
}

.owned-members-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.owned-members-empty {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 0.94rem;
}

.owned-member-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(4, 14, 25, 0.74), rgba(20, 37, 58, 0.6));
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.owned-member-name {
  margin: 0;
  font-size: 1rem;
}

.owned-member-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.86rem;
}

.owned-member-link {
  width: fit-content;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.metric-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(7, 20, 37, 0.76), rgba(22, 36, 55, 0.64));
  padding: 12px;
}

.metric-label {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.metric-value {
  margin: 6px 0 0;
  font-size: 1.55rem;
  font-weight: 700;
}

.panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(4, 14, 25, 0.74), rgba(20, 37, 58, 0.6));
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.panel-title {
  margin: 0;
  font-size: 1rem;
}

.channel-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.channel-profile-image {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.panel-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.86rem;
}

.owner-reseller-customer-list-wrap strong {
  display: block;
  margin-bottom: 4px;
}

.owner-reseller-customer-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 2px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-empty {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 0.94rem;
}

.owner-result {
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 10px;
  background: rgba(7, 29, 17, 0.55);
  color: #d1fae5;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.status-badge {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f7ff;
  white-space: nowrap;
}

.status-badge.pending_payment {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.status-badge.pending_owner_confirmation {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.status-badge.paid {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.2);
  color: #a7f3d0;
}

.status-badge.payment_rejected {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.status-badge.owner {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
}

.status-badge.reseller {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.status-badge.user {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

.owner-delete-user-btn {
  background: linear-gradient(95deg, #dc2626, #f97316);
  color: #fff;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 72vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.channel-list::-webkit-scrollbar {
  width: 9px;
}

.channel-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.channel-list::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.45);
  border-radius: 999px;
}

.channel-empty {
  margin: 0;
  color: var(--text-dim);
}

.channel-diagnostic {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(7, 15, 26, 0.7);
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.channel-page-status {
  margin: 8px 0 0;
  color: var(--text-dim);
}

.channel-page-status.success {
  color: var(--success);
}

.channel-page-status.warning {
  color: #fbbf24;
}

.channel-page-status.error {
  color: var(--danger);
}

.channel-history-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.channel-history-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 11px;
  cursor: pointer;
  font-weight: 600;
}

.channel-history-btn:hover {
  border-color: rgba(0, 212, 255, 0.45);
}

.channel-history-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.channel-history-meta {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 0.86rem;
}

.channel-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-header-info h2 {
  margin: 0;
}

.channel-header-info #channel-target-chat-id {
  margin: 4px 0 0;
}

#channel-target-chat-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.82rem;
}

.channel-card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
}

.channel-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.channel-title {
  font-size: 0.94rem;
}

.channel-time {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.channel-text {
  margin: 8px 0;
  white-space: pre-wrap;
}

.channel-media {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.channel-media-image {
  display: block;
  width: min(100%, 260px);
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.channel-media-video {
  display: block;
  width: min(100%, 360px);
  max-height: 420px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #000;
  object-fit: contain;
}

.channel-media-audio {
  width: 100%;
}

.channel-media-badge {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.1);
  color: #9de9ff;
  font-size: 0.76rem;
  font-weight: 600;
}

.channel-nav-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.channel-back-btn {
  border: none;
  cursor: pointer;
  font-weight: 700;
  color: #051220;
  background: linear-gradient(95deg, var(--accent-2), #6ee7ff);
  border-radius: 9px;
  padding: 8px 12px;
}

.channel-back-btn:hover {
  filter: brightness(1.04);
}

.back-home-link {
  display: inline-block;
  color: var(--accent-2);
  text-decoration: none;
}

.back-home-link:hover {
  text-decoration: underline;
}

.pm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.pm-gallery-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm-gallery-image-link {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pm-gallery-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}

.pm-gallery-time {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.86rem;
}

.pm-gallery-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  text-decoration: none;
  color: #051220;
  background: linear-gradient(95deg, var(--accent), #ffbe0b);
}

.pm-gallery-download-btn:hover {
  filter: brightness(1.05);
}

.hidden {
  display: none;
}

.auth-shell {
  max-width: 460px;
  margin: 48px auto 0;
  padding: 26px 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 21, 38, 0.75), rgba(16, 28, 47, 0.6));
}

.auth-title {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.auth-mode-switch {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mode-btn.active {
  background: linear-gradient(95deg, var(--accent), #ffbe0b);
  color: #051220;
  border-color: transparent;
}

.auth-form {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

.auth-form input {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(0, 212, 255, 0.7);
}

@keyframes rise {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 16px;
}

.picker-modal-card {
  width: min(720px, 100%);
  max-height: 85vh;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.picker-modal-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.picker-modal-head button {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.picker-modal-list {
  padding: 12px 16px;
  overflow: auto;
  display: grid;
  gap: 8px;
  max-height: 56vh;
}

.picker-modal-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
}

.picker-modal-option input {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
}

.picker-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 720px) {
  .container {
    padding: 22px 14px 36px;
  }

  .hero {
    padding: 20px;
  }

  .section {
    padding: 16px;
  }

  .member-scroll-shell {
    max-height: 56vh;
    padding: 10px;
  }

  .channel-list {
    max-height: 62vh;
    padding-right: 2px;
  }

  .channel-nav-actions {
    width: 100%;
  }

  .channel-back-btn {
    width: 100%;
  }

  .account-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .account-link-btn {
    width: 100%;
    text-align: center;
  }

  .logout-btn {
    width: 100%;
  }

  .auth-shell {
    margin-top: 24px;
    padding: 20px 16px;
  }
}
