﻿/* ============================================================
   Genesis Doantetta — Admin Dashboard stylesheet
   Dark theme (Genesis palette)
   ============================================================ */

/* ---- Typography & color tokens ---- */
@font-face {
  font-family: 'InterLocal';
  src: local("Inter");
}

:root {
  color-scheme: dark;
  font-family: InterLocal, Inter, ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Genesis palette */
  --bg:       #080a0d;
  --surface:  #101318;
  --surface2: #151920;
  --line:     #272c34;
  --muted:    #929aa6;
  --accent:   #d6f36a;

  /* Status palette */
  --amber: #e3d391;
  --green: #a9dca5;
  --red:   #f29b9b;
  --gray:  #929aa6;
  --blue:  #7ab7ff;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: #f2f4f7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Form controls ---- */
input, select, button {
  font: inherit;
}

input, select {
  padding: 10px 12px;
  border: 1px solid #303640;
  border-radius: 9px;
  background: #11151a;
  color: #f2f4f7;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus {
  border-color: #69737f;
  outline: 2px solid #d6f36a22;
}

button {
  padding: 10px 16px;
  border: 1px solid #3b424c;
  border-radius: 9px;
  background: var(--accent);
  color: #11150a;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}

button:hover {
  background: #e0f985;
}

button:active {
  transform: scale(.97);
}

/* ============================================================
   Topbar / branding
   ============================================================ */
.topbar {
  height: 74px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #0b0d10;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

/* Genesis mark */
.mark {
  width: 36px;
  height: 36px;
  border: 1px solid #3b424c;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent)22, #11151a);
  box-shadow: 0 0 0 2px #d6f36a11 inset, 0 0 12px #d6f36a22;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 17px;
  color: var(--accent);
}

.brand strong {
  display: block;
  font-size: 13px;
  letter-spacing: .16em;
  font-weight: 800;
  color: #f2f4f7;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: #6f7782;
  font-size: 9px;
  letter-spacing: .14em;
}

.admin {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Main layout
   ============================================================ */
main {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

/* ---- Hero ---- */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 9px;
  letter-spacing: .18em;
  color: #737b87;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 42px;
  letter-spacing: -.045em;
  margin: 9px 0 6px;
  line-height: 1.05;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

/* ---- State / live badge ---- */
.state {
  border: 1px solid #334038;
  background: #101711;
  color: #a9dca5;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 9px;
  letter-spacing: .14em;
  font-weight: 800;
}

/* ============================================================
   Metrics grid
   ============================================================ */
.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metrics article {
  padding: 19px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.metrics small {
  display: block;
  color: #737b87;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 9px;
}

.metrics b {
  display: block;
  font-size: 24px;
  font-weight: 700;
  margin-top: 9px;
}

/* ---- Metrics loading skeleton ---- */
.metrics.loading article {
  border: 0;
  padding: 19px 17px;
  background: var(--line);
  border-radius: 13px;
  position: relative;
  overflow: hidden;
}

.metrics.loading article::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--surface2), #1f2229, var(--surface2));
  background-size: 120% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 13px;
}

@keyframes shimmer {
  0%   { background-position: -120% 0; }
  100% { background-position: 120% 0; }
}

/* ============================================================
   Panels
   ============================================================ */
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  margin-top: 14px;
}

.head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.head h2 {
  margin: 5px 0 0;
  font-size: 18px;
  font-weight: 600;
  color: #f2f4f7;
}

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

/* ============================================================
   Status badges
   PENDING=amber  PAID/FULFILLED=green  FAILED=red
   EXPIRED=gray   REFUNDED=blue
   ============================================================ */
.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid #323842;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
}

.status.PENDING {
  border-color: #5a5132;
  color: var(--amber);
  background: #17150e;
}

.status.PAID,
.status.FULFILLED {
  border-color: #38563a;
  color: var(--green);
  background: #101711;
}

.status.FAILED {
  border-color: #593535;
  color: var(--red);
  background: #171010;
}

.status.EXPIRED {
  border-color: #3a4049;
  color: var(--gray);
  background: #1a1c20;
}

.status.REFUNDED {
  border-color: #27447a;
  color: var(--blue);
  background: #0f172a;
}

/* ============================================================
   Tables
   ============================================================ */
.tableWrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  padding: 14px 17px;
  text-align: left;
  border-bottom: 1px solid #1d2128;
  vertical-align: middle;
}

th {
  font-size: 9px;
  letter-spacing: .12em;
  color: #737b87;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

td {
  font-size: 12px;
}

/* zebra stripes on row hover */
tbody tr:hover {
  background: #0d0f13;
}

#donations.loading td {
  color: var(--muted);
}

/* sub text under a primary cell value */
.sub {
  display: block;
  color: #6f7782;
  font-size: 10px;
  margin-top: 4px;
}

/* ---- Result-limit footer ---- */
.donationsInfo {
  padding: 12px 20px;
  font-size: 11px;
  color: #737b87;
  letter-spacing: .06em;
  border-top: 1px solid var(--line);
}

/* ============================================================
   Backup list
   ============================================================ */
.backupList {
  padding: 16px 20px;
  color: #8f97a2;
  line-height: 2;
}

.backupItem {
  padding: 10px 12px;
  border-bottom: 1px solid #1d2128;
  border-radius: 6px;
  transition: background .15s ease;
}

.backupItem:hover {
  background: #0d0f13;
}

.backupItem:last-child {
  border-bottom: 0;
}

.backupItem strong {
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   Toast notifications (fade in / out)
   ============================================================ */
#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: block;
  padding: 13px 16px;
  border: 1px solid #3a414b;
  background: #11151a;
  border-radius: 10px;
  box-shadow: 0 15px 45px #0009;
  color: #f2f4f7;
  max-width: min(420px, calc(100% - 36px));
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 10;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#toast .time {
  display: block;
  margin-top: 5px;
  color: #737b87;
  font-size: 10px;
  letter-spacing: .06em;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: 74px;
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }
  .admin {
    width: 100%;
  }
  .admin input {
    flex: 1;
  }
  main {
    width: min(100% - 28px, 1280px);
    padding-top: 28px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .head {
    align-items: stretch;
    flex-direction: column;
  }
  .filters > * {
    flex: 1;
  }
  .hero h1 {
    font-size: 34px;
  }
}
