/* =====================================================================
   DIGIXGOLD design system
   Palette pulled from the logo: near-black stage, warm gold gradient,
   white primary text. Signature motif: a thin "uptrend" gold rule
   (echoes the arrow+bar-chart in the mark) used as a section divider
   instead of a generic gradient blob.
   ===================================================================== */

:root {
  --ink:          #0A0A0C;   /* page background - near black */
  --panel:        #151519;   /* card / sidebar surface */
  --panel-raised: #1D1D22;   /* hover / raised surface */
  --line:         #2A2A31;   /* hairline borders */

  --gold-1:       #F4D876;   /* light gold - highlight */
  --gold-2:       #D4AF37;   /* core gold */
  --gold-3:       #9C7A1E;   /* deep gold - shadow edge */
  --gold-grad:    linear-gradient(100deg, var(--gold-3), var(--gold-2) 45%, var(--gold-1) 100%);

  --text-hi:      #F5F3EC;   /* primary text on dark */
  --text-mid:     #B7B3A6;   /* secondary text */
  --text-low:     #726E63;   /* tertiary / placeholder */

  --ok:           #3DDC84;
  --warn:         #F2B84B;
  --danger:       #E5484D;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  color: var(--text-hi);
}

a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--gold-1); }

/* ---- signature divider: the "uptrend line" ---- */
.uptrend-rule {
  height: 2px;
  width: 100%;
  background: var(--gold-grad);
  border: 0;
  border-radius: 2px;
  opacity: 0.85;
  margin: 0 0 24px;
}

/* ---- layout shells ---- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(212,175,55,0.08), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(212,175,55,0.06), transparent 40%),
    var(--ink);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}

.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-logo img { height: 64px; }

.auth-title { text-align: center; font-size: 22px; margin-bottom: 4px; }
.auth-sub   { text-align: center; color: var(--text-mid); font-size: 13px; margin-bottom: 24px; }

/* ---- form controls ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input, .field select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--text-hi);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--gold-2); }
.field .hint { font-size: 12px; color: var(--text-low); margin-top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: var(--gold-grad);
  color: #1A1200;
}
.btn-gold:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-hi);
}
.btn-ghost:hover { border-color: var(--gold-2); color: var(--gold-1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; }

.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-mid); }

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error   { background: rgba(229,72,77,0.12); border-color: rgba(229,72,77,0.4); color: #FF9A9D; }
.alert-success { background: rgba(61,220,132,0.10); border-color: rgba(61,220,132,0.35); color: #8CF0B4; }

/* ---- app shell (dashboard layout, shared by user + admin) ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 50;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.sidebar .brand img { height: 30px; }
.sidebar .brand span { font-family: var(--font-display); font-weight: 700; font-size: 15px; }

/* ---- mobile nav toggle + backdrop (hidden on desktop) ---- */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  cursor: pointer;
  z-index: 60;
}
.mobile-nav-toggle svg { width: 18px; height: 18px; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}
.sidebar-backdrop.open { display: block; }

.nav-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-low);
  padding: 14px 10px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--panel-raised); color: var(--text-hi); }
.nav-link.active { background: var(--panel-raised); color: var(--gold-1); border-left: 2px solid var(--gold-2); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,12,0.7);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .page-title { font-size: 16px; font-family: var(--font-display); font-weight: 700; }
.content { padding: 28px; }

/* ---- cards / stats ---- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---- responsive app shell ---- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-nav-toggle { display: flex; }
  .topbar { padding: 14px 16px 14px 64px; }
  .topbar .page-title { font-size: 15px; }
  .content { padding: 16px; }
  .card { padding: 16px; }
  table { font-size: 12.5px; }
  thead th, tbody td { padding: 8px; }
  .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .stat-value { font-size: 21px; }
  .grid { gap: 12px; }
}

/* make wide tables scroll instead of overflowing the viewport */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}
.stat-label { font-size: 12px; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; margin-top: 6px; color: var(--text-hi); }
.stat-value.gold { color: var(--gold-1); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--text-hi); }
tbody tr:hover { background: var(--panel-raised); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-ok      { background: rgba(61,220,132,0.12); color: var(--ok); }
.badge-warn    { background: rgba(242,184,75,0.12); color: var(--warn); }
.badge-danger  { background: rgba(229,72,77,0.12); color: var(--danger); }
.badge-mono    { background: var(--panel-raised); color: var(--text-mid); }

.text-mid { color: var(--text-mid); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
