/* =========================================================
   PINNACLE UI KIT (Zeus Edition)
   - Tokens
   - Layout shell
   - Components
========================================================= */

:root{
  --bg: #070A12;
  --bg2:#0A1020;

  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.09);

  --border: rgba(255,255,255,.12);
  --border2: rgba(255,255,255,.18);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);

  --b1:#3B82F6;
  --b2:#06B6D4;
  --b3:#22C55E;
  --b4:#A855F7;
  --warn:#F59E0B;
  --danger:#EF4444;

  --radius: 16px;
  --radius2: 22px;
  --shadow: 0 22px 70px rgba(0,0,0,.62);
  --shadow2: 0 12px 30px rgba(0,0,0,.45);

  --gap: 18px;
  --max: 1180px;
}

*{ box-sizing:border-box; }
*::before, *::after { pointer-events:none; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(59,130,246,.22), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(34,197,94,.16), transparent 58%),
    radial-gradient(900px 700px at 60% 120%, rgba(168,85,247,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment: fixed;
}

/* =========================
   Layout shell
========================= */
.app-shell{ min-height:100%; display:flex; flex-direction:column; }
.container{ width:100%; max-width: var(--max); margin:0 auto; padding: 0 18px; }

.topbar{
  position: sticky; top:0; z-index:50;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(7,10,18,.70);
  backdrop-filter: blur(12px);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 0;
  gap: 14px;
}
.brand{
  display:flex; align-items:center; gap:12px;
  font-weight:900; letter-spacing:.2px;
  text-decoration: none;
  color: var(--text);
}
.brand-badge{
  width:38px; height:38px; border-radius:12px;
  background: linear-gradient(135deg, var(--b1), var(--b2));
  box-shadow: 0 16px 50px rgba(59,130,246,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.brand-title{ font-size: 1.02rem; }
.nav{
  display:flex; gap:10px; flex-wrap:wrap;
}
.nav a{
  color: var(--muted);
  text-decoration:none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all .12s ease;
  font-weight: 600;
}
.nav a:hover{
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}
.nav a.active{
  color: var(--text);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}

.page{
  padding: 22px 0 38px;
  flex: 1;
}
.page-header{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap: 14px; flex-wrap:wrap;
  margin-bottom: 16px;
}
.h1{
  font-size: 1.55rem;
  margin:0;
  font-weight: 950;
  letter-spacing: -.02em;
}
.sub{
  margin:6px 0 0;
  color: var(--muted);
  font-weight: 600;
}

/* =========================
   Cards / Panels
========================= */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.card-pad{ padding: 18px; }
.card-title{ font-weight: 900; margin:0 0 6px; }
.card-muted{ color: var(--muted); font-weight:600; }

/* =========================
   Grid
========================= */
.grid{ display:grid; gap: var(--gap); }
.grid-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4{ grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 980px){ .grid-4{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 720px){
  .grid-2,.grid-3,.grid-4{ grid-template-columns: 1fr; }
}

/* =========================
   KPI tiles (premium)
========================= */
.kpi{
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow2);
}
.kpi-top{ display:flex; align-items:center; justify-content:space-between; gap: 10px; }
.kpi-label{ color: var(--muted); font-weight:800; letter-spacing:.04em; font-size:.78rem; text-transform:uppercase; }
.kpi-value{ font-size: 1.6rem; font-weight: 950; margin-top: 8px; }
.kpi-chip{
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .78rem;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}
.chip-live{ background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.22); color: rgba(210,255,228,.92); }

/* =========================
   Buttons
========================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
  color: var(--text);
  font-weight: 900;
  letter-spacing: .2px;
  text-decoration:none;
  box-shadow: 0 12px 30px rgba(0,0,0,.38);
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 18px 44px rgba(0,0,0,.48);
}
.btn:active{ transform: translateY(0); }

.btn-primary{
  border:0;
  background: linear-gradient(135deg, var(--b1), var(--b2));
  color: #061019;
  box-shadow: 0 18px 56px rgba(59,130,246,.22);
}
.btn-primary:hover{
  background: linear-gradient(135deg, var(--b1), var(--b2));
  opacity: 0.9;
}
.btn-success{
  border:0;
  background: linear-gradient(135deg, var(--b3), #A3E635);
  color: #07120B;
  box-shadow: 0 18px 56px rgba(34,197,94,.18);
}
.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,.16);
}
.btn-danger{
  border:0;
  background: linear-gradient(135deg, var(--danger), #DC2626);
  color: #fff;
}
.btn-sm{
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 10px;
}

/* =========================
   Tables (enterprise style)
========================= */
.table-wrap{
  overflow:auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--panel);
}
table{ width:100%; border-collapse: collapse; min-width: 760px; }
th,td{ padding: 12px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
th{
  text-align:left;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 950;
  background: rgba(255,255,255,.03);
}
tr:hover td{ background: rgba(255,255,255,.04); }

/* =========================
   Badges
========================= */
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: .78rem;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}
.badge-ok{ border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.10); color: #86efac; }
.badge-warn{ border-color: rgba(245,158,11,.26); background: rgba(245,158,11,.10); color: #fcd34d; }
.badge-bad{ border-color: rgba(239,68,68,.26); background: rgba(239,68,68,.10); color: #fca5a5; }
.badge-info{ border-color: rgba(59,130,246,.25); background: rgba(59,130,246,.10); color: #93c5fd; }

/* =========================
   Forms
========================= */
.form-group{ margin-bottom: 16px; }
.form-label{
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
  font-size: 1rem;
}
.input:focus, input:focus, select:focus, textarea:focus{
  border-color: rgba(59,130,246,.40);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}
.input::placeholder, input::placeholder, textarea::placeholder{
  color: var(--muted);
  opacity: 0.6;
}
select option{
  color: #0B1220;
  background: #FFFFFF;
}

/* =========================
   Alerts
========================= */
.alert{
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.12);
}
.alert-success{ background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25); color: #86efac; }
.alert-error{ background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.25); color: #fca5a5; }
.alert-warning{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); color: #fcd34d; }
.alert-info{ background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.25); color: #93c5fd; }

/* =========================
   Footer
========================= */
footer{
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

/* =========================
   Hero section
========================= */
.hero{
  padding: 32px;
  border-radius: var(--radius2);
  background: var(--panel);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.hero h1{
  font-size: 2rem;
  font-weight: 950;
  margin: 0 0 8px;
}
.hero p{
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0;
}

/* =========================
   Status pills
========================= */
.pill{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.pill-ok{ background: rgba(34,197,94,.15); color: #86efac; }
.pill-warn{ background: rgba(245,158,11,.15); color: #fcd34d; }
.pill-bad{ background: rgba(239,68,68,.15); color: #fca5a5; }

/* =========================
   Progress steps
========================= */
.progress-steps{
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.progress-step{
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.2s ease;
}
.progress-step.active{
  background: rgba(59,130,246,.15);
  border-color: rgba(59,130,246,.3);
  color: var(--b1);
}
.progress-step.complete{
  background: rgba(34,197,94,.15);
  border-color: rgba(34,197,94,.3);
  color: var(--b3);
}

/* =========================
   Demo mode banner
========================= */
.demo-banner{
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.3);
  color: #fcd34d;
  padding: 8px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* =========================
   Utilities
========================= */
.text-center{ text-align: center; }
.text-muted{ color: var(--muted); }
.mt-1{ margin-top: 8px; }
.mt-2{ margin-top: 16px; }
.mt-3{ margin-top: 24px; }
.mb-1{ margin-bottom: 8px; }
.mb-2{ margin-bottom: 16px; }
.mb-3{ margin-bottom: 24px; }
.flex{ display: flex; }
.flex-wrap{ flex-wrap: wrap; }
.gap-2{ gap: 10px; }
.items-center{ align-items: center; }
.justify-between{ justify-content: space-between; }

/* =========================
   PATCH: OVERRIDE LAYER
   (bottom = highest priority)
========================= */

/* Ensure clicks work everywhere, then disable on decorative elements */
* { pointer-events: auto; }
.page-bg::before, .page-bg::after,
.hero::before, .hero::after,
.card::before, .card::after,
.glass::before, .glass::after { pointer-events: none !important; }

/* z-index stacking */
nav, header, .topbar { position: relative; z-index: 50; }
main, .container, .content { position: relative; z-index: 10; }

/* Universal button override */
.btn, button, a.btn, input[type="submit"], input[type="button"]{
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 10px 16px;
  line-height: 1.2;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: visible;
}
.btn:hover, button:hover, a.btn:hover, input[type="submit"]:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.12);
}
.btn:active, button:active { transform: translateY(0); }

.btn-primary{
  border: 1px solid rgba(47,128,255,.45);
  background: linear-gradient(135deg, rgba(47,128,255,.95), rgba(0,212,255,.75));
  color: #061022;
  box-shadow: 0 10px 30px rgba(47,128,255,.20);
}
.btn-primary:hover{ filter: brightness(1.04); background: linear-gradient(135deg, rgba(47,128,255,.95), rgba(0,212,255,.75)); }

.btn-ghost{
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
}

.btn-danger{
  background: rgba(239,68,68,.16);
  border: 1px solid rgba(239,68,68,.35);
}

.btn-success{
  background: rgba(34,197,94,.16);
  border: 1px solid rgba(34,197,94,.35);
}

/* Input/select override */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select, textarea{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
  outline: none;
}
select option{
  background: #0B1020;
  color: #EAF0FF;
}
