/* ── SwiftShield v2 — Tactical Dark Theme ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;800&display=swap');

:root {
  --bg:        #050810;
  --bg2:       #080d18;
  --panel:     rgba(10,18,38,0.85);
  --border:    rgba(0,220,180,0.12);
  --accent:    #00dcb4;
  --accent2:   #0099ff;
  --warn:      #ffb347;
  --danger:    #ff4d6d;
  --text:      #d4e8e0;
  --muted:     #5a7a72;
  --radius:    10px;
  --mono:      'Space Mono', monospace;
  --sans:      'Syne', sans-serif;
  --glow:      0 0 24px rgba(0,220,180,0.15);
}

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

html, body { height: 100%; }

body {
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(0,153,255,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 10% 100%, rgba(0,220,180,0.06) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Scanline overlay for tactical feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(0,220,180,0.012) 3px,
    rgba(0,220,180,0.012) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ─── Panel / glass ──────────────────────────────────────────────────────── */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 60px; }

/* ─── Access page ────────────────────────────────────────────────────────── */
.access-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.access-card {
  width: 100%;
  max-width: 480px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

/* Corner brackets */
.access-card::before,
.access-card::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.5;
}
.access-card::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; border-radius: 3px 0 0 0; }
.access-card::after  { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-radius: 0 0 3px 0; }

.card-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.brand-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(0,220,180,0.4);
}

.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.brand-sub  { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.field { margin-bottom: 18px; }
.label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 11px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,220,180,0.1);
}
.input option { background: #0a1226; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .18s ease;
  letter-spacing: 0.02em;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #050810;
  border: none;
  box-shadow: 0 4px 20px rgba(0,220,180,0.2);
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 13px;
}
.btn.primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,220,180,0.3); }
.btn.ghost { border: 1px solid var(--border); color: var(--muted); }
.btn.ghost:hover  { border-color: var(--accent); color: var(--accent); }
.btn.danger { border-color: rgba(255,77,109,0.3); color: var(--danger); }
.btn.danger:hover { background: rgba(255,77,109,0.08); }

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background .3s;
}
.status-dot.active  { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.status-dot.warn    { background: var(--warn);   box-shadow: 0 0 8px var(--warn); }
.status-dot.danger  { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.card-footer-note {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,16,0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
}
.modal.hidden { display: none; }
.modal-panel {
  width: 100%; max-width: 520px;
  padding: 28px;
  margin: 16px;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal-sub   { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.modal-textarea {
  width: 100%; min-height: 110px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px;
  resize: vertical;
}
.modal-textarea:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ─── Admin topbar ───────────────────────────────────────────────────────── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  margin: 16px auto;
  max-width: 1120px;
  border-radius: var(--radius);
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo-small {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(0,220,180,0.4);
}
.app-title { font-weight: 800; font-size: 16px; }
.muted-sm  { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* ─── Stats row ─────────────────────────────────────────────────────────── */
.stats-row   { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.stat        { flex: 1; min-width: 140px; padding: 20px; }
.stat-label  { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value  { font-size: 32px; font-weight: 800; color: var(--accent); margin-top: 6px; font-family: var(--mono); }
.stat-value.warn   { color: var(--warn); }
.stat-value.danger { color: var(--danger); }

/* ─── Filters ───────────────────────────────────────────────────────────── */
.filter-card { padding: 14px 16px; margin-bottom: 14px; }
.filter-row  { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-row .input { flex: 1; min-width: 140px; }

/* ─── Log table ─────────────────────────────────────────────────────────── */
.logs-card   { padding: 0; overflow: hidden; }
.table-wrap  { overflow: auto; max-height: 560px; }

.logs-table  { width: 100%; border-collapse: collapse; }
.logs-table thead th {
  position: sticky; top: 0;
  background: rgba(5,8,16,0.95);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.logs-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.025);
  font-size: 13px;
  vertical-align: middle;
}
.logs-table tbody tr { transition: background .15s; }
.logs-table tbody tr:hover { background: rgba(0,220,180,0.03); }

.logs-table pre.mono {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.badge.low    { background: rgba(0,220,180,0.12); color: var(--accent);  border: 1px solid rgba(0,220,180,0.25); }
.badge.medium { background: rgba(255,179,71,0.12); color: var(--warn);   border: 1px solid rgba(255,179,71,0.25); }
.badge.high   { background: rgba(255,77,109,0.12); color: var(--danger); border: 1px solid rgba(255,77,109,0.25); }
.badge.action { background: rgba(0,153,255,0.1); color: var(--accent2);  border: 1px solid rgba(0,153,255,0.2); }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 56px 24px;
  color: var(--muted);
}
.empty-icon { font-size: 36px; opacity: 0.4; }
.empty h4   { font-size: 16px; font-weight: 700; }
.empty p    { font-family: var(--mono); font-size: 12px; text-align: center; max-width: 340px; line-height: 1.7; }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 10000; }
.toast {
  padding: 11px 16px;
  background: rgba(10,18,38,0.95);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: opacity .4s ease;
  max-width: 320px;
}
.toast.warn   { color: var(--warn);   border-color: rgba(255,179,71,0.2); }
.toast.danger { color: var(--danger); border-color: rgba(255,77,109,0.2); }

/* ─── Auth banner ────────────────────────────────────────────────────────── */
.auth-banner {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px;
  background: rgba(255,77,109,0.07);
  border: 1px solid rgba(255,77,109,0.2);
  border-radius: 8px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--danger);
}

/* ─── Key input area ─────────────────────────────────────────────────────── */
.key-row { display: flex; gap: 8px; margin-bottom: 14px; }
.key-row .input { font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .stats-row { gap: 10px; }
  .stat      { min-width: 100%; }
  .topbar    { flex-direction: column; gap: 12px; }
  .filter-row { flex-direction: column; }
}

.brand-icon, .logo-small {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-icon:hover, .logo-small:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(0,220,180,0.7);
}