/* ── Drop2Host Design System ───────────────────────────────────────────────── */

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg: #060608;
  --surface: #0d0d14;
  --surface2: #131320;
  --border: #1a1a2e;
  --border2: #252540;
  --accent: #7c6aff;
  --accent2: #ff6a9e;
  --text: #e8e8f0;
  --muted: #4a4a6a;
  --muted2: #6a6a8a;
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;
  --mono: 'DM Mono', monospace;
  --sans: 'Bricolage Grotesque', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Background grid ─────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a4fd8);
  color: #fff;
}
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted2);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-danger {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.2);
  color: var(--error);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  border: 1px solid transparent;
}
.badge.active { background: rgba(74,222,128,.1); color: var(--success); border-color: rgba(74,222,128,.2); }
.badge.expired, .badge.error { background: rgba(248,113,113,.1); color: var(--error); border-color: rgba(248,113,113,.2); }
.badge.pending, .badge.warning { background: rgba(251,191,36,.1); color: var(--warning); border-color: rgba(251,191,36,.2); }
.badge.info { background: rgba(96,165,250,.1); color: var(--info); border-color: rgba(96,165,250,.2); }

/* ── Error message ────────────────────────────────────────────────────────── */
.error-msg {
  display: none;
  padding: 10px 14px;
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.2);
  border-radius: 8px;
  color: var(--error);
  font-size: 13px;
  margin-bottom: 12px;
}
.error-msg.show { display: block; }

/* ── Toast notifications ──────────────────────────────────────────────────── */
.toasts, .toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .25s ease;
  max-width: 400px;
}
.toast.success { background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.25); color: var(--success); }
.toast.error   { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.25); color: var(--error); }
.toast.info    { background: rgba(96,165,250,.12); border: 1px solid rgba(96,165,250,.25); color: var(--info); }

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.logo-text {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

/* ── Form fields ──────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
  margin-bottom: 6px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: var(--mono);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  vertical-align: middle;
}
tr:hover td {
  background: rgba(124,106,255,.02);
}

/* ── Action buttons (small icon buttons in tables) ────────────────────────── */
.action-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s ease;
}
.action-btn:hover { border-color: var(--accent); background: rgba(124,106,255,.05); }
.action-btn.danger:hover { border-color: var(--error); background: rgba(248,113,113,.05); }

/* ── Stats grid ───────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}
.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.error { color: var(--error); }
.stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--mono);
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: rgba(6,6,8,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-center { text-align: center; }
