@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #0a0b10;
  --panel: #11131d;
  --panel-2: #151828;
  --text: #e8ecff;
  --muted: #9aa3c7;
  --accent: #00f5d4;
  --accent-2: #1f7cff;
  --warning: #ff5c8a;
  --border: #232845;
  --glow: rgba(0, 245, 212, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #101525, #0a0b10 55%);
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.5;
}

.admin-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 16, 26, 0.96), rgba(11, 14, 22, 0.96));
  backdrop-filter: blur(10px);
}

.sidebar-brand-wrap {
  display: grid;
  gap: 4px;
  padding: 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 245, 212, 0.04);
}

.sidebar-brand {
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar-sub {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-link {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sidebar-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
  color: #04131e;
  background: linear-gradient(135deg, var(--accent), #70fff4);
  border-color: rgba(0, 245, 212, 0.58);
  box-shadow: 0 10px 22px rgba(0, 245, 212, 0.14);
}

.logout-link {
  border-color: rgba(255, 92, 138, 0.24);
  color: #ffc7d6;
  background: rgba(255, 92, 138, 0.08);
}

.logout-link:hover {
  color: #ffe7ef;
  border-color: rgba(255, 92, 138, 0.44);
  background: rgba(255, 92, 138, 0.14);
}

.admin-main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 16, 0.76);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.brand {
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  cursor: pointer;
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.sidebar-overlay {
  display: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}

.mobile-menu-lock {
  overflow: hidden;
}

.container {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-actions input {
  background: #0d1020;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  min-width: 240px;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
}

h1 {
  margin: 8px 0 6px;
  font-size: 34px;
}

.muted {
  color: var(--muted);
}

.pulse {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 60%);
  box-shadow: 0 0 40px var(--glow);
  animation: pulse 2.6s ease-in-out infinite;
  display: grid;
  place-items: center;
  position: relative;
}

.pulse.is-online {
  background: radial-gradient(circle, #2ee67d 0%, rgba(46, 230, 125, 0.18) 58%, transparent 70%);
  box-shadow: 0 0 40px rgba(46, 230, 125, 0.22);
}

.pulse.is-offline {
  background: radial-gradient(circle, #ff5c8a 0%, rgba(255, 92, 138, 0.16) 58%, transparent 70%);
  box-shadow: 0 0 40px rgba(255, 92, 138, 0.2);
}

.pulse-core-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #0a0b10;
}

.pulse-status-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pulse-status-copy {
  display: grid;
  gap: 6px;
}

.pulse-status-title {
  font-size: 18px;
  font-weight: 700;
}

.pulse-status-text {
  font-size: 14px;
  color: var(--text);
}

.pulse-status-sub {
  font-size: 12px;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.grid.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.card-label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-value {
  font-size: 28px;
  margin-top: 8px;
}

.card-value-positive {
  color: var(--accent);
}

.card-value-negative {
  color: var(--warning);
}

.panel {
  margin-top: 24px;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: 16px;
}

.panel-title {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  gap: 12px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.meta-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

.meta-value {
  font-size: 16px;
  margin-top: 6px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.action-card {
  background: rgba(10, 11, 16, 0.6);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 14px;
  display: grid;
  gap: 12px;
}

.card-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a0b10;
  border: none;
  font-weight: 600;
}

.btn.warning {
  background: linear-gradient(120deg, #ffb347, #ff7a18);
  color: #0a0b10;
  border: none;
  font-weight: 600;
}

.btn.danger-soft {
  border-color: rgba(255, 92, 138, 0.34);
  color: #ffc7d6;
  background: rgba(255, 92, 138, 0.08);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.audit-page {
  display: grid;
  gap: 22px;
}

.audit-page .panel {
  margin-top: 0;
}

.earnings-page {
  display: grid;
  gap: 22px;
}

.earnings-page .panel {
  margin-top: 0;
}

.cashback-cycles-page {
  display: grid;
  gap: 22px;
}

.cashback-cycles-page .panel {
  margin-top: 0;
}

.cashback-payments-page,
.users-page,
.user-profile-page,
.contact-page,
.referrals-page,
.loyalty-page,
.gifts-page,
.lottery-manage-page,
.instant-lottery-page,
.account-page,
.jackpot-manage-page {
  display: grid;
  gap: 22px;
}

.cashback-payments-page .panel,
.users-page .panel,
.user-profile-page .panel,
.contact-page .panel,
.referrals-page .panel,
.loyalty-page .panel,
.gifts-page .panel,
.lottery-manage-page .panel,
.instant-lottery-page .panel,
.account-page .panel,
.jackpot-manage-page .panel {
  margin-top: 0;
}

.gifts-page .audit-kpi-card .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}

.lottery-manage-page .manual-hint-row,
.lottery-manage-page .manual-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.lottery-manage-page .manual-hint-row {
  margin-bottom: 10px;
}

.lottery-manage-page .manual-actions-row {
  margin-top: 10px;
}

.lottery-manage-page .lottery-ticket-pager {
  margin-top: 10px;
  margin-bottom: 4px;
  justify-content: space-between;
  align-items: center;
}

.lottery-manage-page .tickets-inline-form {
  display: inline-flex;
}

.lottery-manage-page .lottery-manual-prize-input {
  width: 120px;
  max-width: 100%;
}

.lottery-manage-page .lottery-manual-tickets-form {
  margin-bottom: 10px;
}

.lottery-manage-page .cycle-tickets-subhead {
  margin-bottom: 8px;
}

.lottery-manage-page .lottery-live-cycle-stack {
  margin-top: 14px;
}

.lottery-manage-page .lottery-settings-note {
  margin: 0;
}

.lottery-manage-page .lottery-history-stats-block {
  margin-top: 16px;
}

.lottery-manage-page .lottery-settings-form {
  width: 100%;
}

.lottery-manage-page .lottery-settings-section .settings-head .panel-title {
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.6px;
}

.lottery-manage-page .lottery-draw-type-grid {
  align-items: stretch;
}

.lottery-manage-page .lottery-draw-card {
  min-width: 0;
}

.lottery-manage-page .lottery-draw-field {
  display: grid;
  gap: 6px;
}

.lottery-manage-page .lottery-settings-actions {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-start;
}

.lottery-manage-page .lottery-history-kpi {
  margin-top: 18px;
}

/* Instant lottery admin */
.instant-lottery-page .il-section-lede {
  margin: 0;
}

.instant-lottery-page .il-analytics-kpi {
  margin-top: 16px;
}

.instant-lottery-page .il-field-hidden {
  display: none !important;
}

.instant-lottery-page .il-create-block-hidden {
  display: none !important;
}

.instant-lottery-page .il-close-strip {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 200, 87, 0.18);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.instant-lottery-page .il-close-strip .il-close-lede {
  margin: 0;
  font-size: 13px;
}

.instant-lottery-page .tickets-inline-form {
  display: inline-flex;
}

.instant-lottery-page .il-details-tight {
  margin-top: 18px;
}

.instant-lottery-page .il-kpi-timestamp {
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 600;
}

.instant-lottery-page .il-kpi-status {
  text-transform: capitalize;
}

.instant-lottery-page .il-table-head {
  margin: 0 0 10px;
}

.instant-lottery-page .il-table-head:not(:first-child) {
  margin-top: 22px;
}

.instant-lottery-page .il-table-block {
  margin-top: 10px;
}

.instant-lottery-page .il-create-form {
  width: 100%;
}

.instant-lottery-page .il-assignment-hint {
  display: block;
  margin-top: 6px;
}

.instant-lottery-page .il-repeater-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.instant-lottery-page .il-repeater-lede {
  margin: 0 0 10px;
}

.instant-lottery-page .il-repeater-stack {
  margin-top: 8px;
}

.instant-lottery-page .il-repeater-add {
  margin-top: 10px;
}

.instant-lottery-page .instant-lottery-dynamic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.instant-lottery-page .instant-lottery-dynamic-row input {
  min-width: 0;
  flex: 1 1 110px;
}

.instant-lottery-page .instant-lottery-dynamic-row .il-row-remove {
  padding: 4px 10px;
  font-size: 0.8rem;
  flex: 0 0 auto;
}

.instant-lottery-page .il-history-pager {
  margin-top: 14px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.instant-lottery-page .audit-kpi-card .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}

.instant-lottery-page .il-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.3);
  color: var(--accent);
}

@media (max-width: 900px) {
  .instant-lottery-page .il-close-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

.gifts-target-user-field {
  display: none;
}

.gifts-code-pill {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 12.5px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(31, 124, 255, 0.12);
  border: 1px solid rgba(31, 124, 255, 0.25);
}

.gifts-td-time {
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.gifts-usage-cell {
  font-size: 13px;
  line-height: 1.45;
  max-width: 220px;
}

.gifts-approve-form {
  display: grid;
  gap: 8px;
  min-width: min(200px, 100%);
}

.gifts-approve-note {
  width: 100%;
  max-width: 260px;
}

.gifts-approve-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gifts-requests-section .audit-action-cell {
  min-width: 180px;
}

.loyalty-page .audit-kpi-card .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}

.loyalty-rules-form .loyalty-rules-actions {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.loyalty-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 1100px) {
  .loyalty-two-col {
    grid-template-columns: 1fr;
  }
}

.loyalty-rule-form {
  margin-top: 0;
}

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

.loyalty-toggle-form {
  display: inline;
}

.loyalty-td-time {
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.loyalty-desc {
  margin-top: 4px;
  max-width: 280px;
}

.loyalty-processed-hint {
  font-size: 12px;
  margin-top: 4px;
}

.loyalty-approve-form {
  display: grid;
  gap: 8px;
  min-width: min(220px, 100%);
}

.loyalty-approve-note {
  width: 100%;
  max-width: 280px;
}

.loyalty-approve-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loyalty-action-cell {
  min-width: 200px;
}

.referrals-hero p {
  max-width: 60ch;
}

.referrals-kpi .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}

.referrals-filters-wrap {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.referrals-intra-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.referrals-filters-wrap .referrals-intra-title {
  margin-top: 0;
}

.referrals-filter-form .field-only-active {
  align-items: end;
}

.referrals-filter-form .field-spacer {
  display: block;
  min-height: 1.4rem;
}

.referrals-inner-pager {
  margin-top: 8px;
}

.referrals-tx-time {
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.referrals-sync-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 245, 212, 0.08);
  border: 1px solid rgba(0, 245, 212, 0.2);
}

.referrals-cycle-form {
  margin-top: 4px;
}

.referrals-active-cycle {
  margin-top: 8px;
  padding: 4px 0 8px;
}

.referrals-active-head {
  margin-bottom: 10px;
}

.referrals-active-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 14px;
}

.referrals-active-update {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.referrals-danger-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 92, 138, 0.12);
}

.referrals-inline-form {
  display: inline;
}

.referrals-subsection {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.referrals-subsection--history {
  margin-top: 24px;
}

.metrics-em {
  color: var(--accent);
  font-weight: 600;
}

.contact-page .audit-kpi-card .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.4;
}

.contact-channel-pill {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 8px;
  word-break: break-all;
  max-height: 4.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.contact-subheading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  text-transform: none;
  letter-spacing: 0;
  font-style: normal;
}

.contact-form-block .form-section--titled:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.field-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  cursor: pointer;
}

.field-check-row input {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.field-check-row--tight {
  margin-top: 8px;
}

.contact-form-actions {
  margin-top: 4px;
}

.contact-periodic-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-periodic-card {
  margin-bottom: 0;
}

.contact-page .contact-periodic-preview {
  max-width: min(32rem, 100%);
  display: inline-block;
  vertical-align: bottom;
}

.contact-periodic-row-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.contact-empty-hint {
  margin: 0;
  padding: 8px 0 4px;
}

.card-kpi-badge-wrap {
  margin-top: 10px;
}

.card-value-tight {
  font-size: 18px;
  line-height: 1.35;
  margin-top: 8px;
  font-weight: 600;
  word-break: break-word;
}

.kpi-suffix {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--muted);
}

.users-hero-search {
  min-width: min(420px, 100%);
  flex: 1 1 320px;
  justify-content: flex-end;
}

.users-hero-search input[type="search"] {
  flex: 1 1 200px;
  min-width: 0;
}

.cashback-bulk-pay-form {
  margin-bottom: 16px;
}

.cashback-partial-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cashback-partial-form select,
.cashback-partial-form input,
.cashback-partial-form button {
  max-width: 100%;
}

.cashback-partial-amount {
  width: 110px;
  min-width: 0;
}

.user-profile-tx-filters {
  margin-bottom: 0;
}

.user-profile-tx-apply {
  align-self: end;
}

/* —— User profile (refined) —— */

.user-profile-hero {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px 28px;
}

.user-profile-hero-text {
  flex: 1 1 min(100%, 420px);
  min-width: 0;
}

.user-profile-title {
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.12;
  margin: 6px 0 10px;
  word-break: break-word;
}

.user-profile-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.user-profile-id-pill {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.user-profile-blocked-hint {
  font-size: 13px;
}

.user-profile-lede {
  max-width: 55ch;
  line-height: 1.5;
  margin: 0;
}

.user-profile-hero-actions {
  flex: 0 0 auto;
  align-items: flex-start;
}

.user-profile-kpi .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.4;
}

.user-profile-kpi .kpi-unit {
  font-size: 0.5em;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}

.user-profile-kpi-status .kpi-hint {
  margin-top: 10px;
}

.user-profile-section .audit-section-head {
  margin-bottom: 18px;
}

.profile-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.profile-detail-group {
  padding: 0 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-detail-group:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.profile-section-heading {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.profile-details-tight {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 18px;
}

.user-profile-mono {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.profile-inline-link {
  max-width: 100%;
}

.profile-action-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.profile-action-cluster {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.profile-action-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
}

.action-card--soft {
  background: rgba(8, 9, 14, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.action-card--warning {
  border-color: rgba(255, 160, 70, 0.25);
  background: linear-gradient(165deg, rgba(255, 160, 70, 0.06), rgba(8, 9, 14, 0.5));
}

.action-card-lede {
  font-size: 13px;
  line-height: 1.45;
  margin: -2px 0 10px;
}

.user-profile-tx-section {
  border-color: rgba(31, 124, 255, 0.2);
}

.user-profile-tx-filter-shell {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.user-profile-tx-filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.user-profile-tx-time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

/* Ref column: system ids / message keys (e.g. text_message) — wide, wrap, readable */
.user-profile-tx-table th.user-profile-tx-ref-head,
.user-profile-tx-table td.user-profile-tx-ref {
  min-width: 16rem;
  max-width: 36rem;
  white-space: normal;
  vertical-align: top;
}

.user-profile-tx-table td.user-profile-tx-ref {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text);
  padding-top: 12px;
  padding-bottom: 12px;
}

.user-profile-tx-ref-text {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Note column: free-text / admin notes — wide, wrap, readable (sans) */
.user-profile-tx-table th.user-profile-tx-note-head,
.user-profile-tx-table td.user-profile-tx-note {
  min-width: 18rem;
  max-width: 40rem;
  white-space: normal;
  vertical-align: top;
}

.user-profile-tx-table td.user-profile-tx-note {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  padding-top: 12px;
  padding-bottom: 12px;
}

.user-profile-tx-note-text {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 900px) {
  .user-profile-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .user-profile-hero-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  .user-profile-hero-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    justify-content: flex-start;
  }

  .user-profile-hero-actions .btn {
    width: 100%;
    box-sizing: border-box;
  }
}

.cashback-active-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 14px;
}

.cashback-end-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.card-kpi-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 6px;
}

.text-wrap-tight {
  max-width: 240px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

.audit-hero {
  margin-bottom: 0;
  padding: 22px;
  border: 1px solid rgba(31, 124, 255, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 124, 255, 0.12), rgba(0, 245, 212, 0.05));
}

.audit-kpi-grid {
  margin: 0;
}

.audit-kpi-card {
  min-height: 132px;
}

.audit-section {
  overflow: hidden;
}

.audit-section-primary {
  border-color: rgba(0, 245, 212, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.audit-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.audit-section-head .panel-title {
  margin-bottom: 6px;
  color: var(--text);
}

.audit-section-head .muted {
  margin: 0;
}

.audit-section-meta,
.audit-pagination,
.audit-pagination-actions,
.audit-action-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.audit-section-meta {
  justify-content: flex-end;
}

.audit-pagination {
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.audit-table th {
  white-space: nowrap;
}

.audit-table td {
  vertical-align: top;
}

.audit-user-link {
  display: grid;
  gap: 3px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.audit-user-link small {
  color: var(--muted);
  font-weight: 400;
}

.audit-detail-link {
  color: var(--accent);
  text-decoration: none;
}

.audit-time-stack {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
}

.audit-action-cell {
  min-width: 230px;
}

.amount-positive {
  color: var(--accent);
}

.dashboard-page {
  display: grid;
  gap: 22px;
}

.dashboard-page .panel {
  margin-top: 0;
}

.dashboard-hero {
  margin-bottom: 0;
  padding: 22px;
  border: 1px solid rgba(0, 245, 212, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.1), rgba(31, 124, 255, 0.08));
}

.dashboard-worker-card {
  min-width: min(360px, 100%);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(10, 11, 16, 0.38);
}

.dashboard-kpi-grid {
  margin: 0;
}

.dashboard-kpi-card {
  min-height: 138px;
}

.dashboard-control-panel {
  border-color: rgba(31, 124, 255, 0.22);
}

.dashboard-toggle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.dashboard-toggle-card p {
  margin: 6px 0 0;
}

.dashboard-section {
  overflow: hidden;
}

.dashboard-activity-grid {
  gap: 22px;
}

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

.partial-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.partial-wrap input {
  background: #0d1020;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
}

.table-wrap {
  overflow: auto;
  max-height: 360px;
}

.lottery-manage-page .cycle-tickets-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.table-wrap.limit-5 {
  max-height: 240px;
}

.table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(31, 124, 255, 0.35);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

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

th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

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

.form-grid-full {
  grid-column: 1 / -1;
}

.settings-layout {
  display: grid;
  gap: 22px;
}

.settings-section {
  border: 1px solid rgba(31, 124, 255, 0.22);
  background: linear-gradient(180deg, rgba(31, 124, 255, 0.08), rgba(10, 11, 16, 0.35));
  border-radius: 14px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 8px 20px rgba(0, 0, 0, 0.2);
}

.settings-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.settings-head .panel-title {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.settings-head .muted {
  margin: 0;
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.settings-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.settings-grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.settings-grid .field.full {
  grid-column: 1 / -1;
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.network-card {
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 245, 212, 0.07), rgba(13, 16, 32, 0.8));
  padding: 12px;
  display: grid;
  gap: 10px;
}

.network-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--accent);
  text-transform: uppercase;
}

.sticky-save {
  position: sticky;
  bottom: 14px;
  z-index: 2;
  padding: 10px;
  border-radius: 12px;
  background: rgba(10, 11, 16, 0.82);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  justify-content: flex-end;
}

.form-section {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.field input {
  background: #0d1020;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
}

.field select {
  background: #0d1020;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
}

.field textarea {
  background: #0d1020;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  resize: vertical;
}

.rtl-field {
  direction: rtl;
  text-align: right;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 52px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #0d1020;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch input:checked + .slider {
  background: rgba(0, 245, 212, 0.18);
  border-color: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
  background: var(--accent);
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.cycle-stack {
  display: grid;
  gap: 14px;
}

.cycle-card {
  border: 1px solid rgba(31, 124, 255, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 124, 255, 0.08), rgba(10, 11, 16, 0.35));
  overflow: hidden;
}

.cycle-card.history-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(10, 11, 16, 0.35));
}

.cycle-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
}

.cycle-summary::-webkit-details-marker {
  display: none;
}

.cycle-title {
  font-size: 16px;
  font-weight: 700;
}

.cycle-subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.cycle-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill,
.metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.status-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-pill.open {
  color: var(--accent);
  border-color: rgba(0, 245, 212, 0.28);
}

.status-pill.ready {
  color: #8bd3ff;
  border-color: rgba(31, 124, 255, 0.3);
}

.status-pill.closed {
  color: #ffb3c7;
  border-color: rgba(255, 92, 138, 0.28);
}

.metric-pill {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.cycle-body {
  padding: 0 18px 18px;
  display: grid;
  gap: 16px;
}

.cycle-tickets-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  background: rgba(10, 11, 16, 0.28);
}

.cycle-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.proxy-health-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  min-height: 20px;
}

.proxy-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(154, 163, 199, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.proxy-health-dot.is-ok {
  background: #2ee67d;
  box-shadow: 0 0 0 4px rgba(46, 230, 125, 0.14);
}

.proxy-health-dot.is-down {
  background: #ff5c8a;
  box-shadow: 0 0 0 4px rgba(255, 92, 138, 0.14);
}

.proxy-health-dot.is-pending {
  background: #f5c451;
  box-shadow: 0 0 0 4px rgba(245, 196, 81, 0.14);
}

.proxy-health-dot.is-disabled {
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(154, 163, 199, 0.12);
}

.proxy-health-text {
  font-size: 12px;
  color: var(--muted);
}

.actions {
  grid-column: 1 / -1;
}

.panel-stack {
  display: grid;
  gap: 18px;
}

.account-page .audit-kpi-card .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}

.account-page .account-ichancy-status {
  margin-bottom: 6px;
}

.account-page .account-backup-inner {
  display: grid;
  gap: 16px;
}

.account-page .account-backup-run {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4px;
}

.account-page .account-backup-hint {
  margin: 0;
  flex: 1 1 220px;
}

.account-page .account-logs-block .actions {
  margin-top: 4px;
}

.account-page .account-kpi-timestamp {
  font-size: 1.1rem;
  line-height: 1.25;
  font-weight: 600;
}

.jackpot-manage-page .audit-kpi-card .kpi-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}

.jackpot-manage-page .tickets-inline-form {
  display: inline-flex;
}

/* —— Jackpot: closed cycles history (large datasets) —— */
.jackpot-closed-history-section .jackpot-history-total-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(31, 124, 255, 0.16);
  border: 1px solid rgba(31, 124, 255, 0.35);
  color: #b8d4ff;
}

.jackpot-history-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.jackpot-history-toolbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.jackpot-history-range strong {
  color: var(--text);
  font-weight: 700;
}

.jackpot-history-toolbar-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: min(100%, 220px);
}

.jackpot-history-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.jackpot-history-per-page {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.jackpot-history-per-page-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.jackpot-history-per-page-select {
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1020;
  color: var(--text);
  font-weight: 600;
}

.jackpot-history-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.jackpot-history-pager-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.jackpot-history-pager-btn.jackpot-history-pager-num {
  min-width: 2.35rem;
  justify-content: center;
  padding-inline: 10px;
}

.jackpot-history-pager-current {
  min-width: 2.35rem;
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(31, 124, 255, 0.28);
  border: 1px solid rgba(31, 124, 255, 0.45);
  font-weight: 700;
  font-size: 13px;
}

.jackpot-history-pager-ellipsis {
  color: var(--muted);
  padding: 0 2px;
  user-select: none;
}

.jackpot-closed-history-wrap {
  max-height: min(70vh, 640px);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.12);
}

.jackpot-closed-history-wrap .audit-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel) 88%, rgba(10, 11, 16, 0.92) 100%);
  box-shadow: 0 1px 0 var(--border);
}

.jackpot-closed-history-table .jackpot-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.jackpot-closed-history-table .jackpot-col-cycle {
  min-width: 160px;
  max-width: min(320px, 40vw);
}

.jackpot-history-cycle-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jackpot-history-id {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.jackpot-history-title {
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.jackpot-winners-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.jackpot-winners-ratio {
  font-size: 13px;
  font-weight: 600;
}

.jackpot-winners-bar {
  width: 100%;
  max-width: 128px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.jackpot-winners-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 124, 255, 0.95), rgba(0, 245, 212, 0.88));
  min-width: 0;
  transition: width 0.2s ease;
}

.jackpot-payout-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.jackpot-payout-pill--bot_wallet {
  background: rgba(31, 124, 255, 0.18);
  color: #9ec5ff;
  border: 1px solid rgba(31, 124, 255, 0.38);
}

.jackpot-payout-pill--ichancy {
  background: rgba(0, 245, 212, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 245, 212, 0.3);
}

.jackpot-col-time {
  min-width: 118px;
}

.jackpot-time-stack {
  font-size: 12px;
  line-height: 1.35;
}

.jackpot-col-action {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.jackpot-history-view-btn {
  padding: 8px 14px;
  font-size: 13px;
}

.jackpot-mono {
  font-variant-numeric: tabular-nums;
}

.jackpot-history-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}

.jackpot-history-footer-pager {
  margin-top: 14px;
}

span.btn.is-disabled {
  pointer-events: none;
  opacity: 0.42;
  cursor: not-allowed;
}

/* Paginated admin tables: hash targets so Next/Prev land on the section, not page top */
#users-directory,
#user-profile-tx-ledger,
#jackpot-closed-history {
  scroll-margin-top: 88px;
}

/* —— Shared: paged directory / ledger (users list, user profile tx) —— */
.admin-pager-total-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(31, 124, 255, 0.16);
  border: 1px solid rgba(31, 124, 255, 0.35);
  color: #b8d4ff;
}

.admin-pager-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-pager-toolbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-pager-range strong {
  color: var(--text);
  font-weight: 700;
}

.admin-pager-toolbar-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: min(100%, 220px);
}

.admin-pager-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-pager-per-page {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-pager-per-page-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.admin-pager-per-page-select {
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1020;
  color: var(--text);
  font-weight: 600;
}

.admin-pager-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.admin-pager-side-btn {
  padding: 6px 12px;
  font-size: 13px;
}

.admin-pager-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-pager-side-btn.admin-pager-num {
  min-width: 2.35rem;
  justify-content: center;
  padding-inline: 10px;
}

.admin-pager-current {
  min-width: 2.35rem;
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(31, 124, 255, 0.28);
  border: 1px solid rgba(31, 124, 255, 0.45);
  font-weight: 700;
  font-size: 13px;
}

.admin-pager-ellipsis {
  color: var(--muted);
  padding: 0 2px;
  user-select: none;
}

.admin-table-sticky-wrap {
  max-height: min(70vh, 640px);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.12);
}

.admin-table-sticky-wrap .audit-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel) 88%, rgba(10, 11, 16, 0.92) 100%);
  box-shadow: 0 1px 0 var(--border);
}

.admin-pager-footer {
  margin-top: 14px;
}

.user-profile-tx-section .user-profile-tx-filter-shell {
  margin-bottom: 14px;
}

@media (min-width: 960px) {
  .admin-pager-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .admin-pager-toolbar-main {
    flex: 1;
    margin-bottom: 0;
  }

  .admin-pager-nav {
    flex: 1;
    justify-content: flex-end;
  }

  .jackpot-history-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .jackpot-history-toolbar-main {
    flex: 1;
    margin-bottom: 0;
  }

  .jackpot-history-pager {
    flex: 1;
    justify-content: flex-end;
  }
}

.account-page code {
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.account-cards {
  margin-bottom: 0;
}

.backup-details {
  gap: 18px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.status-badge.success {
  border-color: rgba(0, 245, 212, 0.35);
  color: var(--accent);
  background: rgba(0, 245, 212, 0.08);
}

.status-badge.warning {
  border-color: rgba(255, 184, 77, 0.35);
  color: #ffb84d;
  background: rgba(255, 184, 77, 0.08);
}

.status-badge.error {
  border-color: rgba(255, 92, 138, 0.35);
  color: var(--warning);
  background: rgba(255, 92, 138, 0.08);
}

.status-badge.neutral {
  color: var(--muted);
}

.status-badge.log-level-debug {
  color: #9ca3af;
}

.status-badge.log-level-info {
  border-color: rgba(31, 124, 255, 0.35);
  color: #6ea8ff;
  background: rgba(31, 124, 255, 0.08);
}

.status-badge.log-level-warning {
  border-color: rgba(255, 184, 77, 0.35);
  color: #ffb84d;
  background: rgba(255, 184, 77, 0.08);
}

.status-badge.log-level-error,
.status-badge.log-level-critical {
  border-color: rgba(255, 92, 138, 0.35);
  color: var(--warning);
  background: rgba(255, 92, 138, 0.08);
}

.live-logs-table td {
  vertical-align: top;
}

.log-metadata {
  max-width: 420px;
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1020;
  color: var(--muted);
  white-space: pre-wrap;
}

.field-toggle {
  grid-column: 1 / -1;
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.backup-run-row {
  align-items: center;
}

.env-hint {
  margin-top: -4px;
}

.form-section-head {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

.flash-wrap {
  margin-bottom: 16px;
}

.flash {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(31, 124, 255, 0.2);
  border: 1px solid rgba(31, 124, 255, 0.4);
}

.flash.error {
  background: rgba(255, 92, 138, 0.15);
  border-color: rgba(255, 92, 138, 0.4);
}

.global-loading {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 16, 0.55);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: start center;
  padding-top: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 60;
}

.global-loading.active {
  opacity: 1;
  pointer-events: auto;
}

.job-progress-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 90;
}

.job-progress-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.job-progress-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(6px);
}

.job-progress-card {
  position: relative;
  width: min(560px, calc(100vw - 28px));
  border-radius: 18px;
  border: 1px solid rgba(31, 124, 255, 0.24);
  background: linear-gradient(180deg, rgba(15, 20, 34, 0.96), rgba(10, 11, 16, 0.98));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.job-progress-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(0, 245, 212, 0.08);
  border: 1px solid rgba(0, 245, 212, 0.22);
}

.job-progress-title {
  font-size: 24px;
  font-weight: 700;
}

.job-progress-message {
  color: var(--muted);
  line-height: 1.6;
  min-height: 44px;
}

.job-progress-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.job-progress-metric {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.job-progress-metric span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.job-progress-metric strong {
  font-size: 22px;
}

.job-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.job-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

.job-progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.job-progress-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #8bd3ff;
  background: rgba(31, 124, 255, 0.12);
  border: 1px solid rgba(31, 124, 255, 0.24);
}

.job-progress-status-pill[data-status="success"] {
  color: var(--accent);
  background: rgba(0, 245, 212, 0.08);
  border-color: rgba(0, 245, 212, 0.24);
}

.job-progress-status-pill[data-status="failed"] {
  color: var(--warning);
  background: rgba(255, 92, 138, 0.08);
  border-color: rgba(255, 92, 138, 0.24);
}

.global-loading-card {
  width: min(520px, calc(100vw - 24px));
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.global-loading-title {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.global-loading-sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.global-loading-track {
  margin-top: 10px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.global-loading-bar {
  height: 100%;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  animation: globalLoadingSlide 1.05s ease-in-out infinite;
}

@keyframes globalLoadingSlide {
  0% {
    transform: translateX(-120%);
  }
  60% {
    transform: translateX(185%);
  }
  100% {
    transform: translateX(185%);
  }
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: 18px;
  width: min(420px, 90vw);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.login-title {
  font-size: 28px;
  font-weight: 700;
}

.login-sub {
  color: var(--muted);
  margin-bottom: 18px;
}

.form label span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form input {
  margin-top: 6px;
  width: 100%;
  margin-bottom: 14px;
}

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

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 8;
    height: 100vh;
    border-right: 0;
    border-bottom: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 12px 12px;
    transform: translateX(-108%);
    transition: transform 0.24s ease;
  }

  .admin-shell.mobile-menu-open .admin-sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 7;
    background: rgba(6, 9, 16, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .admin-shell.mobile-menu-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-brand-wrap {
    padding: 10px;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 6px;
    padding-bottom: 4px;
  }

  .sidebar-link {
    white-space: normal;
    padding: 10px 12px;
  }

  .logout-link {
    display: block;
    width: 100%;
  }

  .container {
    padding: 20px 14px;
  }

  .topbar {
    padding: 12px 14px;
    z-index: 6;
    gap: 10px;
    justify-content: flex-start;
  }

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

  .pulse-status-wrap {
    width: 100%;
  }

  .panel {
    padding: 16px;
  }

  .panel-actions {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .audit-section-head,
  .audit-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-section-meta,
  .audit-pagination-actions,
  .audit-action-buttons {
    justify-content: flex-start;
  }

  .audit-action-cell {
    min-width: 190px;
  }

  .dashboard-toggle-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard-worker-card {
    width: 100%;
  }

  .hero-actions input {
    min-width: 0;
    width: 100%;
  }

  .partial-wrap {
    grid-template-columns: 1fr;
  }

  .action-row .btn,
  .actions .btn {
    width: 100%;
  }

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

  .job-progress-metrics {
    grid-template-columns: 1fr;
  }

  .cycle-summary,
  .cycle-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cycle-badges {
    justify-content: flex-start;
  }

  .live-cycles-panel .table-wrap,
  .history-cycles-panel .table-wrap {
    max-height: none;
    overflow: visible;
  }

  .live-cycles-panel .tickets-table--live thead,
  .history-cycles-panel .tickets-table--history thead {
    display: none;
  }

  .live-cycles-panel .tickets-table--live,
  .live-cycles-panel .tickets-table--live tbody,
  .live-cycles-panel .tickets-table--live tr[data-ticket-row],
  .history-cycles-panel .tickets-table--history,
  .history-cycles-panel .tickets-table--history tbody,
  .history-cycles-panel .tickets-table--history tr[data-ticket-row] {
    display: block;
    width: 100%;
  }

  .live-cycles-panel .tickets-table--live,
  .history-cycles-panel .tickets-table--history {
    min-width: 0;
  }

  .live-cycles-panel .tickets-table--live tr[data-ticket-row],
  .history-cycles-panel .tickets-table--history tr[data-ticket-row] {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
  }

  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td,
  .history-cycles-panel .tickets-table--history tr[data-ticket-row] td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    word-break: break-word;
  }

  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td:last-child,
  .history-cycles-panel .tickets-table--history tr[data-ticket-row] td:last-child {
    border-bottom: 0;
  }

  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td::before,
  .history-cycles-panel .tickets-table--history tr[data-ticket-row] td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
  }

  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td input[type="number"],
  .history-cycles-panel .tickets-table--history tr[data-ticket-row] td input[type="number"] {
    width: 100% !important;
    min-width: 0;
  }

  /* Mobile live-cycle tickets: hide low-priority fields */
  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td[data-label="Status"],
  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td[data-label="Result"],
  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td[data-label="Prize"],
  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td[data-label="Spin Number"],
  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td[data-label="Purchased At"],
  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td[data-label="Revealed At"] {
    display: none;
  }

  .lottery-manage-page .details-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lottery-manage-page .meta-value {
    font-size: 15px;
  }

  .lottery-manage-page .cycle-summary {
    padding: 12px 14px;
  }

  .lottery-manage-page .cycle-title {
    font-size: 15px;
  }

  .lottery-manage-page .cycle-subtitle {
    font-size: 12px;
  }

  .lottery-manage-page .cycle-body {
    padding: 0 14px 14px;
    gap: 12px;
  }

  .lottery-manage-page .cycle-tickets-panel {
    padding: 10px;
  }

  .lottery-manage-page .status-pill,
  .lottery-manage-page .metric-pill {
    min-height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }

  .lottery-manage-page .panel-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px;
  }

  .lottery-manage-page .panel-actions > div {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .lottery-manage-page .panel-actions > div .btn {
    flex: 1 1 140px;
  }

  .lottery-manage-page .manual-hint-row,
  .lottery-manage-page .manual-actions-row {
    flex-direction: column;
    align-items: stretch !important;
  }

  .lottery-manage-page .manual-actions-row .btn {
    width: 100%;
  }

  table {
    font-size: 13px;
    min-width: 760px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 26px;
  }

  .brand {
    font-size: 14px;
    letter-spacing: 1px;
  }

  .card-value {
    font-size: 24px;
  }

  .btn {
    padding: 10px 12px;
  }

  .login-card {
    padding: 22px;
  }

  .live-cycles-panel .tickets-table--live tr[data-ticket-row] td,
  .history-cycles-panel .tickets-table--history tr[data-ticket-row] td {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .lottery-manage-page .cycle-body {
    padding: 0 12px 12px;
  }

  .lottery-manage-page .cycle-summary {
    padding: 10px 12px;
  }

  .lottery-manage-page .cycle-tickets-panel {
    padding: 8px;
  }
}

/* Periodic messages collapsible cards */
.periodic-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}

.periodic-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  list-style: none;
  flex-wrap: wrap;
}

.periodic-card-header::-webkit-details-marker {
  display: none;
}

.periodic-card-header::before {
  content: "▸";
  font-size: 12px;
  transition: transform 0.2s;
  color: var(--muted);
}

.periodic-card[open] > .periodic-card-header::before {
  transform: rotate(90deg);
}

.periodic-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.periodic-status-dot.active {
  background: var(--accent);
}
.periodic-status-dot.inactive {
  background: var(--warning);
}

.periodic-preview {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  direction: rtl;
}

.periodic-card-body {
  padding: 0 16px 16px;
}
