/* ── PixelServe Dashboard Styles ─────────────────────────────────────────── */

:root {
  --bg-base:      #08080A;
  --bg-elevated:  #0F0F12;
  --bg-floating:  #17171C;
  --bg-sidebar:   #0C0C0F;
  --gold-dark:    #8B6914;
  --gold-mid:     #C49A1C;
  --gold-light:   #F2C94C;
  --text-primary: #F5F5F7;
  --text-muted:   #71717A;
  --border:       rgba(255,255,255,0.06);
  --border-gold:  rgba(196,154,28,0.35);
  --sidebar-w:    240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #2A2A30; border-radius: 3px; }

/* ── Layout ── */
.ds-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.ds-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

.ds-sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ds-sidebar-logo img {
  height: 28px;
  width: auto;
}

.ds-sidebar-section {
  padding: 20px 12px 8px;
}
.ds-sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 4px;
}

.ds-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #A1A1AA;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
  margin-bottom: 2px;
}
.ds-nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.ds-nav-link.active {
  background: rgba(196,154,28,0.12);
  color: var(--gold-light);
}
.ds-nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.ds-nav-link.active svg { opacity: 1; }

.ds-sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.ds-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}
.ds-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #08080A;
  flex-shrink: 0;
}
.ds-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.ds-user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Main content ── */
.ds-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ds-topbar {
  height: 60px;
  background: rgba(8,8,10,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.ds-topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.ds-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ds-content {
  padding: 28px;
  flex: 1;
}

/* ── Stat cards ── */
.ds-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.ds-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.25s, transform 0.25s;
}
.ds-stat:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
}
.ds-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.ds-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.ds-stat-value.gold { color: var(--gold-light); }
.ds-stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Section header ── */
.ds-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ds-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Table ── */
.ds-table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ds-table thead tr {
  border-bottom: 1px solid var(--border);
}
.ds-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ds-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: #D4D4D8;
  vertical-align: middle;
}
.ds-table tbody tr:last-child td { border-bottom: none; }
.ds-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.18s cubic-bezier(0.16,1,0.3,1), filter 0.18s, background 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(0) !important; }
.btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(135deg, #C49A1C, #F2C94C);
  color: #08080A;
  box-shadow: 0 2px 12px rgba(196,154,28,0.3);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 4px 20px rgba(196,154,28,0.45); }

.btn-secondary {
  background: var(--bg-floating);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }

.btn-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: #F87171;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); transform: translateY(-1px); }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

/* ── Forms ── */
.ds-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}
.ds-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #A1A1AA;
  letter-spacing: 0.03em;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  background: var(--bg-floating);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  padding: 9px 13px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(196,154,28,0.5);
  box-shadow: 0 0 0 3px rgba(196,154,28,0.08);
}
input::placeholder, textarea::placeholder { color: #52525B; }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
select option { background: var(--bg-floating); }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--gold-mid);
}
.form-check label { font-size: 0.875rem; color: var(--text-primary); cursor: pointer; }

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.form-error {
  font-size: 0.75rem;
  color: #F87171;
}

/* ── Alert banners ── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert-success {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.25);
  color: #4ADE80;
}
.alert-error {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #F87171;
}
.alert-info {
  background: rgba(96,165,250,0.08);
  border-color: rgba(96,165,250,0.25);
  color: #60A5FA;
}
.alert-warning {
  background: rgba(196,154,28,0.1);
  border-color: rgba(196,154,28,0.3);
  color: var(--gold-light);
}

/* ── Empty state ── */
.ds-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.ds-empty svg {
  margin: 0 auto 14px;
  opacity: 0.35;
}
.ds-empty p { font-size: 0.9rem; }

/* ── Pagination ── */
.ds-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.ds-pagination a, .ds-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s;
}
.ds-pagination a:hover { border-color: var(--border-gold); color: var(--gold-light); }
.ds-pagination .current { border-color: var(--border-gold); color: var(--gold-light); background: rgba(196,154,28,0.08); }

/* ── Modal ── */
.ds-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ds-modal {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.ds-modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.ds-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(196,154,28,0.1) 0%, transparent 65%),
    var(--bg-base);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
}
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-logo img {
  height: 34px;
  width: auto;
}
.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span { font-size: 0.75rem; color: var(--text-muted); }

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

/* ── Grad text ── */
.grad-text {
  background: linear-gradient(120deg, #8B6914 0%, #C49A1C 30%, #F2C94C 65%, #FFD166 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── PayPal sidebar block ── */
.ds-paypal-block {
  margin: 0 12px 16px;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-floating);
  border: 1px solid var(--border);
}
.ds-paypal-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.ds-paypal-amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 12px;
}
.ds-paypal-amount.zero { color: var(--text-muted); }
.ds-paypal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  background: #0070BA;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.18s, transform 0.18s cubic-bezier(0.16,1,0.3,1);
  font-family: 'Outfit', sans-serif;
}
.ds-paypal-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ds-paypal-btn:active { transform: translateY(0); }
.ds-paypal-btn.disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

/* ── SSH details box ── */
.ssh-box {
  background: #0C0C0E;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  color: #4ADE80;
  line-height: 1.7;
}
.ssh-box span { color: #71717A; }
