/* ============================================================================
   Dashboard layout + components
   ============================================================================ */

.dash-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 32px 80px;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.dash-header h1 {
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.dash-header p {
  color: var(--text-meta);
  font-size: 14.5px;
  max-width: 560px;
  margin: 0;
}
.dash-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.dash-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  margin-bottom: 32px;
  background: rgba(255, 140, 105, 0.06);
  border: 1px solid rgba(255, 140, 105, 0.20);
  border-left: 2px solid var(--warn);
  border-radius: 2px;
  font-size: 13px;
  color: var(--text-secondary);
}
.dash-banner .material-icons { color: var(--warn); font-size: 18px; }

/* ============================================================================
   Login card
   ============================================================================ */
.dash-login {
  max-width: 460px;
  margin: 64px auto 0;
  padding: 36px;
  background:
    radial-gradient(ellipse 500px 300px at 80% 20%, var(--accent-tint-08) 0%, transparent 60%),
    linear-gradient(to bottom, rgba(14, 18, 26, 0.96), rgba(8, 11, 17, 0.92));
  border: 1px solid var(--border-14);
  border-top: 3px solid var(--accent);
  border-radius: 2px;
  box-shadow: var(--shadow-panel);
  text-align: center;
}
.dash-login .login-icon {
  width: 56px;
  height: 56px;
  border-radius: 2px;
  background: var(--accent-tint-12);
  border: 1px solid var(--accent-tint-35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.dash-login .login-icon .material-icons { font-size: 28px; color: var(--accent); }
.dash-login h1 { font-size: 26px; letter-spacing: -0.015em; margin-bottom: 10px; }
.dash-login p { color: var(--text-meta); font-size: 14px; line-height: 1.65; margin-bottom: 22px; }
.dash-login .login-note {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--text-hint);
  line-height: 1.6;
}
.btn-steam {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #1b2838;
  border: 1px solid #2a475e;
  border-radius: 2px;
  color: #c7d5e0;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  cursor: pointer;
}
.btn-steam:hover { background: #2a475e; border-color: #66c0f4; color: #ffffff; }
.btn-steam .steam-mark {
  display: block;
  width: 22px;
  height: 22px;
  color: #ffffff;
  flex-shrink: 0;
}
.btn-steam:hover .steam-mark { color: #66c0f4; }
.btn-steam.is-loading {
  pointer-events: none;
  opacity: 0.85;
}
.btn-steam.is-loading .steam-mark {
  animation: dash-spin 0.9s linear infinite;
}
@keyframes dash-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   User strip
   ============================================================================ */
.dash-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface-03);
  border: 1px solid var(--border-08);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
}
.dash-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(139, 200, 255, 0.30), rgba(255, 210, 100, 0.10)),
    var(--surface-06);
  border: 1px solid var(--border-14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  overflow: hidden;
}
.dash-user-avatar.has-image { background: var(--surface-06); }
.dash-user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-user-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dash-user-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-user-steamid {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-hint);
}
.dash-user-actions { margin-left: auto; display: flex; gap: 8px; }

/* ============================================================================
   Servers grid
   ============================================================================ */
.dash-section {
  margin-top: 32px;
}
.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.dash-section-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-primary);
}
.dash-section-head .count-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-hint);
  padding: 2px 8px;
  background: var(--surface-06);
  border: 1px solid var(--border-10);
  border-radius: 2px;
}

.dash-servers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.dash-server {
  background: linear-gradient(to bottom, rgba(14, 18, 26, 0.96), rgba(8, 11, 17, 0.92));
  border: 1px solid var(--border-10);
  border-top: 2px solid var(--accent);
  border-radius: 2px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s ease, transform 0.18s ease;
  text-decoration: none;
  color: inherit;
}
.dash-server:hover { border-color: var(--border-20); transform: translateY(-1px); }
.dash-server[data-status='revoked'],
.dash-server[data-status='banned'] { border-top-color: var(--danger); }
.dash-server[data-status='offline'] { border-top-color: var(--text-faint); }

.dash-server-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.dash-server-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  word-break: break-word;
}
.dash-server-region {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-hint);
  margin-top: 2px;
}
.dash-server-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.dash-server-meta .meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-hint);
}
.dash-server-meta .meta-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-pill.is-active { color: var(--money); background: rgba(121, 224, 143, 0.10); border: 1px solid rgba(121, 224, 143, 0.30); }
.status-pill.is-active .dot { background: var(--money); box-shadow: 0 0 6px rgba(121, 224, 143, 0.55); animation: dash-pulse 2.2s ease-in-out infinite; }
@keyframes dash-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.status-pill.is-offline { color: var(--text-hint); background: var(--surface-06); border: 1px solid var(--border-10); }
.status-pill.is-offline .dot { background: var(--text-faint); }
.status-pill.is-revoked { color: var(--warn); background: rgba(255, 140, 105, 0.10); border: 1px solid rgba(255, 140, 105, 0.30); }
.status-pill.is-revoked .dot { background: var(--warn); }
.status-pill.is-banned { color: var(--danger); background: rgba(255, 107, 107, 0.10); border: 1px solid rgba(255, 107, 107, 0.30); }
.status-pill.is-banned .dot { background: var(--danger); }

/* ============================================================================
   Empty state
   ============================================================================ */
.dash-empty {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--border-14);
  border-radius: 2px;
  background: var(--surface-02);
}
.dash-empty .material-icons {
  font-size: 36px;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.dash-empty h3 { font-size: 17px; margin-bottom: 6px; }
.dash-empty p { color: var(--text-meta); font-size: 13.5px; margin: 0 0 18px; }

/* ============================================================================
   Server detail page
   ============================================================================ */
.dash-detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.dash-panel {
  background: linear-gradient(to bottom, rgba(14, 18, 26, 0.96), rgba(8, 11, 17, 0.92));
  border: 1px solid var(--border-14);
  border-top: 2px solid var(--accent);
  border-radius: 2px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-panel h2 {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-primary);
}
.dash-panel .help {
  font-size: 12.5px;
  color: var(--text-hint);
  line-height: 1.6;
  margin: 0;
}
.dash-panel.is-danger { border-top-color: var(--danger); }

.dash-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-field .label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-hint);
}
.dash-field .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
}
.dash-field input,
.dash-field select,
.dash-field textarea {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  padding: 10px 12px;
  background: var(--surface-04);
  border: 1px solid var(--border-14);
  border-radius: 2px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.12s ease, background 0.12s ease;
  width: 100%;
}
.dash-field input:focus,
.dash-field select:focus,
.dash-field textarea:focus {
  border-color: var(--accent-tint-35);
  background: var(--surface-06);
}
.dash-field .error {
  font-size: 12px;
  color: var(--danger);
  display: none;
}
.dash-field.has-error input,
.dash-field.has-error select { border-color: rgba(255, 107, 107, 0.5); }
.dash-field.has-error .error { display: block; }

.dash-field-check { gap: 6px; }
.dash-field-check > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
}
.dash-field-check input[type="checkbox"] {
  margin: 2px 0 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.dash-field-check > label a {
  color: var(--accent);
  text-decoration: underline;
}
.dash-field-check > label a:hover { text-decoration: none; }

.dash-form { display: flex; flex-direction: column; gap: 16px; }
.dash-form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

/* ============================================================================
   Token reveal
   ============================================================================ */
.token-reveal {
  background: linear-gradient(to bottom, rgba(14, 18, 26, 0.96), rgba(5, 7, 11, 0.94));
  border: 1px solid var(--border-14);
  border-top: 3px solid var(--money);
  border-radius: 2px;
  padding: 22px;
  margin-bottom: 24px;
}
.token-reveal h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--money);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.token-reveal h3 .material-icons { font-size: 16px; }
.token-reveal p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}
.token-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(5, 7, 11, 0.6);
  border: 1px solid var(--border-14);
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
  margin-bottom: 14px;
}
.token-display .token-text { flex: 1; }
.btn-copy-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--accent-tint-08);
  border: 1px solid var(--accent-tint-35);
  border-radius: 2px;
  color: var(--accent);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-copy-token:hover { background: var(--accent-tint-20); }
.btn-copy-token.copied { color: var(--money); border-color: rgba(121, 224, 143, 0.35); background: rgba(121, 224, 143, 0.08); }
.btn-copy-token .material-icons { font-size: 14px; }

.token-reveal-warning {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 140, 105, 0.06);
  border: 1px solid rgba(255, 140, 105, 0.20);
  border-left: 2px solid var(--warn);
  border-radius: 2px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.token-reveal-warning .material-icons { color: var(--warn); font-size: 18px; flex-shrink: 0; }

/* ============================================================================
   Modal / confirmation dialog
   ============================================================================ */
.dash-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: dash-modal-fade 0.12s ease;
}
.dash-modal-backdrop[hidden] { display: none !important; }
@keyframes dash-modal-fade { from { opacity: 0; } to { opacity: 1; } }
.dash-modal {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(to bottom, rgba(14, 18, 26, 0.98), rgba(8, 11, 17, 0.96));
  border: 1px solid var(--border-14);
  border-top: 2px solid var(--accent);
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  padding: 22px;
}
.dash-modal.is-danger { border-top-color: var(--danger); }
.dash-modal h3 {
  font-size: 17px;
  letter-spacing: -0.005em;
  margin-bottom: 8px;
}
.dash-modal p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 18px;
}
.dash-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn-danger {
  background: rgba(255, 107, 107, 0.10);
  border-color: rgba(255, 107, 107, 0.30);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.20); border-color: rgba(255, 107, 107, 0.50); }

/* ============================================================================
   Backend placeholder note
   ============================================================================ */
.dash-placeholder-note {
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(139, 200, 255, 0.04);
  border: 1px solid rgba(139, 200, 255, 0.18);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  font-size: 12.5px;
  color: var(--text-meta);
  line-height: 1.65;
}
.dash-placeholder-note strong { color: var(--text-secondary); }

/* ============================================================================
   Responsive
   ============================================================================ */

/* Tablet portrait: stack the two-column panels, allow header to wrap. */
@media (max-width: 820px) {
  .dash-shell { padding: 90px 20px 60px; }
  .dash-detail-grid { grid-template-columns: 1fr; gap: 16px; }
  .dash-servers { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; align-items: stretch; gap: 16px; }
  .dash-header-actions { width: 100%; }
  .dash-header-actions .btn { flex: 1; justify-content: center; }
}

/* Phone: tighter spacing, full-width actions, smaller user strip. */
@media (max-width: 520px) {
  .dash-shell { padding: 80px 16px 56px; }
  .dash-header h1 { font-size: 24px; }
  .dash-user { flex-wrap: wrap; gap: 10px; }
  .dash-user-actions { width: 100%; justify-content: flex-end; }
  .dash-login { padding: 28px 22px; margin-top: 32px; }
  .dash-login h1 { font-size: 22px; }
  .dash-login p { font-size: 13px; }
  .dash-panel { padding: 18px; }
  .dash-panel h2 { font-size: 13.5px; }
  .dash-form-actions { flex-direction: column; }
  .dash-form-actions .btn,
  .dash-form-actions .btn-big { width: 100%; justify-content: center; }
  /* Token reveal: tokens are 43-44 chars, must wrap. */
  .token-display { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
  .token-display .token-text { font-size: 11.5px; }
  .btn-copy-token { width: 100%; justify-content: center; padding: 10px 12px; }
  /* Modal: keep readable on small screens. */
  .dash-modal-backdrop { padding: 12px; align-items: flex-end; }
  .dash-modal { max-width: 100%; padding: 18px; border-radius: 2px 2px 0 0; }
  .dash-modal h3 { font-size: 16px; }
  .dash-modal-actions { flex-direction: column-reverse; }
  .dash-modal-actions .btn { width: 100%; justify-content: center; }
  .dash-server { padding: 16px; }
  .dash-server-meta { grid-template-columns: 1fr; gap: 6px; }
  .dash-server-name { font-size: 15px; }
}
