/* ═══════════════════════════════════════════════════════════════════
   GPI Server Monitor — Global Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg-0:      #080808;
  --bg-1:      #111111;
  --bg-2:      #1a1a1a;
  --bg-3:      #222222;
  --border:    #2a2a2a;
  --red:       #dc2626;
  --red-lt:    #ef4444;
  --red-dk:    #b91c1c;
  --green:     #16a34a;
  --green-lt:  #22c55e;
  --text:      #f1f1f1;
  --text-dim:  #a0a0a0;
  --text-muted:#666;
  --r:         8px;
  --r-lg:      12px;
  --r-xl:      20px;
  --t:         all 0.22s ease;
  --shadow:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-red:0 4px 18px rgba(220,38,38,0.35);
}

/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Custom Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: var(--bg-1); }
::-webkit-scrollbar-thumb        { background: #2a2a2a; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: #3a3a3a; }
::-webkit-scrollbar-corner       { background: var(--bg-1); }
* { scrollbar-width: thin; scrollbar-color: #2a2a2a var(--bg-1); }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select {
  font-family: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 14px;
  width: 100%;
  font-size: 14px;
  outline: none;
  transition: var(--t);
}
input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ═══════════════════════════════════════════════════════════════════
   SPLASH / LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════ */
.splash {
  position: fixed; inset: 0;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.particles {
  position: absolute; inset: 0; z-index: 0;
}
.particles canvas { display: block; }

.splash-content {
  position: relative; z-index: 10;
  text-align: center;
  padding: 40px 24px;
  width: 100%; max-width: 440px;
}

/* Logo */
.logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 28px;
}
.splash-logo {
  width: 120px; height: 120px;
  object-fit: contain;
  border-radius: var(--r-xl);
  opacity: 0;
  transform: scale(0.5) translateY(-30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.34,1.56,.64,1);
  filter: drop-shadow(0 0 30px rgba(220,38,38,0.4));
}
.splash-logo.anim-logo {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.logo-glow {
  position: absolute; inset: -20px;
  background: radial-gradient(circle, rgba(220,38,38,0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse { 0%,100%{opacity:0.4;transform:scale(1)} 50%{opacity:1;transform:scale(1.1)} }

/* Title */
.splash-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
  margin-bottom: 8px;
}
.splash-title.anim-title { opacity: 1; transform: translateY(0); }
.highlight { color: var(--red-lt); }

.splash-sub {
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
  margin-bottom: 32px;
}
.splash-sub.anim-sub { opacity: 1; transform: translateY(0); }

/* Login form */
.login-form {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.35s, transform 0.5s ease 0.35s;
}
.login-form.anim-form { opacity: 1; transform: translateY(0); }

.input-wrap {
  position: relative;
  margin-bottom: 16px;
}
.input-wrap input {
  padding: 14px 50px 14px 44px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 15px;
  letter-spacing: 2px;
  border-radius: var(--r-lg);
}
.input-wrap input:focus {
  border-color: var(--red);
  background: rgba(220,38,38,0.06);
}
.input-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px;
}
.eye-btn {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  background: none; border: none;
  font-size: 14px;
  transition: var(--t);
}
.eye-btn:hover { color: var(--text); }

.login-error {
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--red), var(--red-dk));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--r-lg);
  transition: var(--t);
  position: relative;
  overflow: hidden;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-red); }
.login-btn:disabled { opacity: 0.7; transform: none; }

.btn-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
}
.login-btn:hover .btn-shimmer { animation: shimmer 0.8s ease; }
@keyframes shimmer { to { transform: translateX(100%); } }

.splash-footer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 28px;
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════ */

/* ── Header ─────────────────────────────────────────────────────── */
.header {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.header-brand {
  display: flex; align-items: center; gap: 14px;
}
.header-logo {
  width: 42px; height: 42px;
  object-fit: contain; border-radius: 10px;
  filter: drop-shadow(0 2px 8px rgba(220,38,38,0.4));
}
.header-title {
  display: block;
  font-size: 17px; font-weight: 800;
  letter-spacing: -0.3px;
}
.header-sub {
  display: block;
  font-size: 11px; color: var(--text-muted);
}
.header-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r);
  font-size: 13px; font-weight: 600;
  transition: var(--t); border: 1px solid transparent;
}
.btn-red {
  background: var(--red); color: #fff;
}
.btn-red:hover { background: var(--red-lt); box-shadow: var(--shadow-red); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-outline:hover { border-color: var(--red); color: var(--red-lt); }
.btn-ghost {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--border); color: var(--text); background: rgba(255,255,255,0.08); }

/* ── Stats Grid ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  max-width: 1600px; margin: 28px auto 0;
  padding: 0 28px;
}
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--t);
}
.stat-card:hover { border-color: #333; background: var(--bg-2); transform: translateY(-1px); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-val   { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }

/* ── Toolbar ─────────────────────────────────────────────────────── */
.toolbar {
  max-width: 1600px; margin: 22px auto 0;
  padding: 0 28px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.search-wrap {
  position: relative; flex: 1; min-width: 200px;
}
.search-wrap i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}
.search-wrap input {
  padding-left: 38px;
  background: var(--bg-1);
  border-color: var(--border);
}
.filter-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.ftab {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-1);
  border: 1px solid var(--border);
  transition: var(--t);
}
.ftab:hover  { color: var(--text); border-color: #444; }
.ftab.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ── Table ───────────────────────────────────────────────────────── */
.table-wrap {
  max-width: 1600px; margin: 18px auto 40px;
  padding: 0 28px;
  overflow-x: auto;
}
table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
thead tr { background: var(--bg-2); }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}
tbody tr {
  border-top: 1px solid var(--border);
  transition: var(--t);
}
tbody tr:hover { background: rgba(255,255,255,0.02); }
td { padding: 13px 16px; font-size: 13px; vertical-align: middle; }

.td-no    { color: var(--text-muted); font-weight: 700; text-align: center; }
.td-email { color: var(--text-dim); }
.td-token .token-masked { font-family: monospace; font-size: 12px; color: var(--text-muted); background: var(--bg-2); padding: 3px 8px; border-radius: 5px; }
.td-date  { font-size: 12px; white-space: nowrap; }
.td-doinfo { font-size: 12px; }
.td-age   { white-space: nowrap; }
.age-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(139,92,246,0.12);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.25);
  white-space: nowrap;
}
.muted    { color: var(--text-muted); }
.acc-label { font-weight: 700; font-size: 13px; }

/* Status badges */
.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status-running { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.status-locked  { background: rgba(220,38,38,0.12);  color: #f87171; border: 1px solid rgba(220,38,38,0.25); }
.status-error   { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.status-unknown { background: rgba(100,116,139,0.12);color: #94a3b8; border: 1px solid rgba(100,116,139,0.25); }

/* Availability buttons */
.avail-btn {
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  transition: var(--t); border: 1px solid;
  white-space: nowrap;
}
.avail-available { background: rgba(34,197,94,0.1); color: #22c55e; border-color: rgba(34,197,94,0.25); }
.avail-available:hover { background: rgba(34,197,94,0.2); }
.avail-sold { background: rgba(239,68,68,0.1); color: #ef4444; border-color: rgba(239,68,68,0.25); }
.avail-sold:hover { background: rgba(239,68,68,0.2); }

/* Action buttons */
.action-btns { display: flex; gap: 6px; align-items: center; }
.act-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: var(--t);
}
.act-btn:hover { border-color: var(--red); color: var(--red-lt); }
.act-del:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden; transition: var(--t);
  backdrop-filter: blur(4px);
}
.modal-bg.on { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  transform: scale(0.96);
  transition: transform 0.22s ease;
}
.modal-bg.on .modal { transform: scale(1); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: var(--t);
}
.modal-close:hover { border-color: var(--red); color: var(--red-lt); }
.modal-body  { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* Field */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 11px; font-weight: 700; color: var(--text-dim); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.5px; }
.field input { width: 100%; }
.req  { color: var(--red); }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: block; }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to   { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0);     } to   { opacity:0; transform:translateX(20px); } }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner  { padding: 12px 16px; }
  .stats-grid    { padding: 0 16px; gap: 10px; }
  .toolbar       { padding: 0 16px; }
  .table-wrap    { padding: 0 16px; }
  .pagination-wrap { padding: 0 16px; flex-wrap: wrap; gap: 10px; }
  .header-actions .btn span { display: none; }
  .stat-val      { font-size: 22px; }
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination-wrap {
  max-width: 1600px; margin: 0 auto 40px;
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.page-info {
  font-size: 12px; color: var(--text-muted);
  min-width: 160px;
}
.page-btns {
  display: flex; align-items: center; gap: 4px;
}
.pg-btn {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  border-radius: var(--r);
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  transition: var(--t);
  display: flex; align-items: center; justify-content: center;
}
.pg-btn:hover:not(.pg-disabled) {
  border-color: var(--red);
  color: var(--red-lt);
}
.pg-btn.pg-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.pg-btn.pg-disabled {
  opacity: 0.3; cursor: not-allowed;
}
.pg-dot {
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 4px;
  display: flex; align-items: center;
}
.page-size-wrap {
  display: flex; align-items: center; gap: 8px;
}
.page-size-wrap select {
  width: auto; padding: 6px 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 12px; color: var(--text-dim);
  cursor: pointer;
}
.page-size-wrap select:focus { border-color: var(--red); }
