/* SentinelaAC v2 — Tailwind-Design FACEIT / Esports SaaS Dark UI (Offline-Ready Production CSS) */
:root {
  --tw-bg-base: #060911;
  --tw-bg-surface: #0b111e;
  --tw-bg-card: rgba(13, 19, 34, 0.90);
  --tw-bg-elevated: #121b2e;
  --tw-border: rgba(51, 65, 85, 0.65);
  --tw-border-hi: rgba(56, 189, 248, 0.42);
  --tw-text: #f1f5f9;
  --tw-muted: #94a3b8;
  --tw-dim: #64748b;
  --tw-cyan: #38bdf8;
  --tw-emerald: #34d399;
  --tw-amber: #fbbf24;
  --tw-rose: #fb7185;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--tw-bg-base);
  background-image:
    radial-gradient(1000px 440px at 8% -10%, rgba(56, 189, 248, 0.14), transparent 62%),
    radial-gradient(880px 420px at 92% -12%, rgba(16, 185, 129, 0.11), transparent 58%),
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  color: var(--tw-text);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tw-cyan); text-decoration: none; transition: color .15s ease; }
a:hover { color: #7dd3fc; text-decoration: underline; }
code, .mono {
  font-family: 'JetBrains Mono', Consolas, ui-monospace, monospace;
  font-size: 11.75px;
  background: rgba(9, 14, 25, 0.92);
  border: 1px solid rgba(51, 65, 85, 0.7);
  padding: 2px 6px;
  border-radius: 0.375rem;
  color: #7dd3fc;
}

/* Tailwind-style utility helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--tw-muted); }

/* Topbar Glassmorphism (FACEIT / SaaS) */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tw-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.topbar-in {
  max-width: 1380px; margin: 0 auto; padding: 0.72rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.85rem; flex-wrap: wrap;
}
.brand-box { display: flex; align-items: center; gap: 0.7rem; text-decoration: none !important; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 0.625rem;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #10b981 100%);
  display: grid; place-items: center; font-size: 18px;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255,255,255,0.28);
}
.brand-title { font-size: 1.08rem; font-weight: 800; color: #ffffff; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.7rem; color: var(--tw-muted); display: flex; align-items: center; }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 9999px; background: #22c55e;
  display: inline-block; margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: sacPulse 2.2s infinite;
}
@keyframes sacPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.nav-links { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.nav-link {
  padding: 0.44rem 0.78rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.8rem;
  color: #cbd5e1; border: 1px solid transparent; transition: all 0.16s ease;
}
.nav-link:hover { background: rgba(30, 41, 59, 0.72); border-color: var(--tw-border); text-decoration: none; color: #fff; }
.nav-link.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(16, 185, 129, 0.12));
  border-color: rgba(56, 189, 248, 0.42);
  color: #7dd3fc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Main Container & Cards */
.wrap { max-width: 1380px; margin: 1.35rem auto; padding: 0 1.25rem 3.5rem; }
.card {
  background: var(--tw-bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--tw-border);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.card-title {
  margin: 0 0 0.85rem; font-size: 0.96rem; font-weight: 700; color: #f8fafc;
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; flex-wrap: wrap;
}
.ecd-sec-title {
  font-size: 1rem; font-weight: 700; color: #e2e8f0; margin: 1.25rem 0 0.6rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap;
}

/* Hero Esports Card */
.hero {
  background: linear-gradient(135deg, rgba(14, 24, 44, 0.96), rgba(9, 34, 56, 0.94));
  border: 1px solid rgba(56, 189, 248, 0.32);
  display: grid; grid-template-columns: 1.45fr 1fr; gap: 1.5rem; align-items: center;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; top: -40%; right: -10%; width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16), transparent 68%);
  pointer-events: none;
}
.hero h1 { margin: 0 0 0.5rem; font-size: 1.62rem; line-height: 1.22; color: #ffffff; letter-spacing: -0.02em; }
.hero p { margin: 0 0 0.85rem; color: #cbd5e1; font-size: 0.86rem; }
.steps { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.step-chip {
  background: rgba(8, 13, 24, 0.82); border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 0.5rem; padding: 0.35rem 0.65rem; font-size: 0.76rem; color: #e2e8f0; font-weight: 600;
}
.dl-box {
  background: rgba(6, 10, 19, 0.85); border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 0.75rem; padding: 1.05rem; text-align: center; position: relative; z-index: 1;
  box-shadow: 0 8px 28px rgba(2, 132, 199, 0.18);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: rgba(26, 35, 54, 0.9); color: #e2e8f0;
  border: 1px solid rgba(71, 85, 105, 0.75);
  padding: 0.48rem 0.92rem; border-radius: 0.5rem; font-weight: 700; font-size: 0.8rem;
  cursor: pointer; transition: all 0.15s ease; text-decoration: none !important;
}
.btn:hover { border-color: var(--tw-cyan); background: rgba(30, 48, 74, 0.95); color: #ffffff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  border-color: #38bdf8; color: #ffffff;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 8px 24px rgba(56, 189, 248, 0.45); }
.btn.dl-big { width: 100%; padding: 0.78rem 1.1rem; font-size: 0.9rem; border-radius: 0.6rem; }
.btn.success { background: linear-gradient(135deg, #059669, #10b981); border-color: #34d399; color: #ffffff; }
.btn.danger { background: rgba(127, 29, 29, 0.85); border-color: rgba(239, 68, 68, 0.65); color: #fecaca; }
.btn.danger:hover { background: #b91c1c; border-color: #f87171; color: #fff; }
.btn.sm { padding: 0.3rem 0.62rem; font-size: 0.74rem; border-radius: 0.42rem; }
.btn.ecd-tab {
  min-width: 120px; padding: 0.65rem 1.1rem; font-size: 0.84rem;
  background: rgba(15, 23, 42, 0.92); border: 1px solid var(--tw-border);
  border-radius: 0.5rem; color: #cbd5e1;
}
.btn.ecd-tab:hover, .btn.ecd-tab.active {
  background: rgba(14, 165, 233, 0.18); border-color: var(--tw-cyan); color: #7dd3fc;
}

/* KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; margin-bottom: 1.1rem; }
.kpi {
  background: var(--tw-bg-card); border: 1px solid var(--tw-border);
  border-radius: 0.75rem; padding: 0.9rem 1.05rem;
  position: relative; overflow: hidden; transition: border-color .15s ease, transform .15s ease;
}
.kpi:hover { border-color: rgba(56, 189, 248, 0.4); transform: translateY(-1px); }
.kpi-lbl { font-size: 0.7rem; color: var(--tw-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-val { font-size: 1.65rem; font-weight: 800; margin: 0.22rem 0 0.15rem; color: #ffffff; letter-spacing: -0.02em; }
.kpi-sub { font-size: 0.74rem; color: var(--tw-dim); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.95rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.grid-charts { display: grid; grid-template-columns: 1.45fr 1fr; gap: 0.95rem; margin-bottom: 1.1rem; }

/* Verdict Banners (ECD + Tailwind SaaS polish) */
.ecd-banner {
  padding: 1rem 1.2rem; border-radius: 0.75rem; border: 1px solid; margin-bottom: 1.1rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}
.ecd-banner.ok { background: linear-gradient(135deg, rgba(5, 46, 22, 0.9), rgba(6, 78, 59, 0.45)); border-color: rgba(34, 197, 94, 0.5); }
.ecd-banner.warn { background: linear-gradient(135deg, rgba(45, 31, 4, 0.92), rgba(120, 53, 15, 0.42)); border-color: rgba(245, 158, 11, 0.55); }
.ecd-banner.crit { background: linear-gradient(135deg, rgba(49, 10, 14, 0.94), rgba(127, 29, 29, 0.5)); border-color: rgba(239, 68, 68, 0.55); }
.ecd-banner-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.ecd-banner-title { font-size: 1.28rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; letter-spacing: -0.01em; }
.ecd-banner.ok .ecd-banner-title { color: #4ade80; }
.ecd-banner.warn .ecd-banner-title { color: #fbbf24; }
.ecd-banner.crit .ecd-banner-title { color: #f87171; }
.ecd-banner-lines { font-size: 0.82rem; line-height: 1.65; }
.ecd-banner-note { color: #7dd3fc; }

/* Pills & Badges */
.pill { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.16rem 0.56rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.pill.ok { background: rgba(6, 78, 59, 0.82); border: 1px solid rgba(16, 185, 129, 0.5); color: #a7f3d0; }
.pill.warn { background: rgba(120, 53, 15, 0.82); border: 1px solid rgba(245, 158, 11, 0.55); color: #fde68a; }
.pill.crit { background: rgba(127, 29, 29, 0.88); border: 1px solid rgba(239, 68, 68, 0.6); color: #fecaca; }
.pill.info { background: rgba(12, 74, 110, 0.72); border: 1px solid rgba(56, 189, 248, 0.5); color: #bae6fd; }

.ecd-mini-num { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 800; margin-right: 4px; }
.ecd-mini-num.y { background: #a16207; color: #fef3c7; }
.ecd-mini-num.g { background: #334155; color: #e2e8f0; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--tw-border); border-radius: 0.625rem; }
table { width: 100%; border-collapse: collapse; background: rgba(10, 15, 28, 0.92); }
th, td { padding: 0.58rem 0.72rem; border-bottom: 1px solid rgba(30, 41, 59, 0.85); text-align: left; vertical-align: middle; font-size: 0.8rem; }
th { background: rgba(17, 24, 39, 0.95); color: #94a3b8; font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr { transition: background-color 0.14s ease, opacity 0.25s ease; }
tr:hover td { background: rgba(30, 41, 59, 0.48); }
tr.sac-removing { opacity: 0; transform: translateX(10px); }
.kv td { padding: 0.52rem 0.78rem; border-bottom: 1px solid rgba(30, 41, 59, 0.75); }
.kv td:first-child { width: 42%; color: #94a3b8; background: rgba(15, 23, 42, 0.75); font-weight: 600; }
.kv td:last-child { color: #f1f5f9; }

.risk-bar { width: 82px; height: 6px; border-radius: 9999px; background: #1e293b; overflow: hidden; display: inline-block; vertical-align: middle; }
.risk-fill { height: 100%; border-radius: 9999px; transition: width 0.3s ease; }

.filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.tab-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tab-pill { padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.78rem; font-weight: 700; border: 1px solid var(--tw-border); background: rgba(15, 23, 42, 0.8); color: #cbd5e1; transition: all .15s; }
.tab-pill.active, .tab-pill:hover { border-color: var(--tw-cyan); color: #ffffff; background: rgba(14, 165, 233, 0.18); text-decoration: none; }

input[type=text], input[type=password], input[type=file], select, textarea {
  background: rgba(7, 11, 20, 0.92); border: 1px solid rgba(71, 85, 105, 0.75); color: var(--tw-text);
  padding: 0.46rem 0.7rem; border-radius: 0.5rem; font-size: 0.8rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--tw-cyan); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16); }

.sev-CRITICAL { color: #fb7185; font-weight: 800; }
.sev-HIGH { color: #fbbf24; font-weight: 700; }
.sev-MEDIUM { color: #60a5fa; font-weight: 700; }
.sev-LOW { color: #94a3b8; font-weight: 600; }

.flash { padding: 0.7rem 0.95rem; border-radius: 0.625rem; margin-bottom: 1rem; border: 1px solid; font-weight: 600; font-size: 0.82rem; }
.flash.ok { background: rgba(6, 78, 59, 0.45); border-color: rgba(16, 185, 129, 0.5); color: #a7f3d0; }
.flash.err { background: rgba(127, 29, 29, 0.55); border-color: rgba(239, 68, 68, 0.55); color: #fecaca; }

.extra-panel {
  display: none; margin-top: 0.75rem; background: rgba(11, 17, 30, 0.96);
  border: 1px solid var(--tw-border); border-radius: 0.75rem; padding: 0.95rem;
}
.extra-panel.open { display: block; animation: sacFadeIn .18s ease-out; }
@keyframes sacFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Toast & Custom Confirm Modal */
.sac-toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.sac-toast {
  background: rgba(11, 17, 30, 0.96); backdrop-filter: blur(12px);
  border: 1px solid var(--tw-border-hi); border-radius: 0.65rem;
  padding: 0.72rem 0.95rem; color: #f8fafc; font-weight: 600; font-size: 0.8rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45); animation: sacSlideUp .2s ease-out;
}
.sac-toast.ok { border-color: rgba(52, 211, 153, 0.6); }
.sac-toast.err { border-color: rgba(251, 113, 133, 0.65); color: #fecaca; }
@keyframes sacSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.sac-modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 1rem;
}
.sac-modal-backdrop.open { display: flex; }
.sac-modal {
  background: #0f172a; border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 0.85rem; padding: 1.25rem; max-width: 440px; width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

.footer {
  max-width: 1380px; margin: 0 auto; padding: 1.15rem 1.25rem 2rem;
  border-top: 1px solid var(--tw-border); color: var(--tw-dim); font-size: 0.76rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.7rem;
}

@media (max-width: 960px) {
  .hero, .grid-2, .grid-3, .grid-charts { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
