:root{
  --bg: #09111c;
  --panel: rgba(255,255,255,.07);
  --panel-2: rgba(255,255,255,.10);
  --stroke: rgba(255,255,255,.11);
  --stroke-2: rgba(255,255,255,.18);
  --text: rgba(255,255,255,.94);
  --muted: rgba(255,255,255,.66);
  --muted-2: rgba(255,255,255,.48);
  --accent: #39c2a1;
  --accent-2: rgba(57,194,161,.22);
  --warn: #f2b84b;
  --shadow: 0 18px 55px rgba(0,0,0,.38);
  --shadow-soft: 0 12px 30px rgba(0,0,0,.24);
  --radius: 18px;
  --max: 1180px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 760px at 15% 8%, rgba(57,194,161,.18), transparent 55%),
    radial-gradient(840px 640px at 86% 18%, rgba(242,184,75,.12), transparent 54%),
    linear-gradient(180deg, #071019, var(--bg));
  overflow-x: hidden;
}

.bg{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .16;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.14) 1px, transparent 0);
  background-size: 18px 18px;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(3,10,17,.82), rgba(3,10,17,.48));
  border-bottom: 1px solid var(--stroke);
}

.topbar-inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo{
  width: 38px;
  height: 38px;
}

.brand-name{
  font-weight: 800;
  letter-spacing: -.02em;
}

.topbar-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-link,
.btn{
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.icon-link:hover,
.btn:hover,
.mini-btn:hover,
.filter-pill:hover{
  transform: translateY(-1px);
  border-color: var(--stroke-2);
}

.btn.primary{
  background: linear-gradient(90deg, rgba(57,194,161,.96), rgba(57,194,161,.74));
  color: #031813;
  border-color: rgba(57,194,161,.40);
}

.btn.ghost{
  background: rgba(255,255,255,.04);
}

.btn:disabled,
.mini-btn:disabled{
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.shell{
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 18px 54px;
}

.hero-card,
.panel,
.unlock-card{
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-card,
.panel,
.unlock-card{
  padding: 22px;
}

.hero-card::before,
.panel::before,
.unlock-card::before{
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background:
    radial-gradient(760px 360px at 15% 0%, rgba(57,194,161,.16), transparent 58%),
    radial-gradient(520px 300px at 90% 12%, rgba(242,184,75,.10), transparent 60%);
}

.hero-top,
.panel-head,
.toolbar,
.stack,
.result-list,
.log-list,
.section-tools,
.unlock-card > *{
  position: relative;
  z-index: 1;
}

.unlock-shell{
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.unlock-card{
  width: min(100%, 520px);
}

.unlock-title{
  margin: 8px 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.04em;
}

.unlock-copy{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hero-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 12px;
}

.dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(57,194,161,.15);
}

.hero-title{
  position: relative;
  z-index: 1;
  margin: 18px 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.hero-sub{
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 72ch;
}

.hero-grid{
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card{
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.14);
  padding: 16px;
}

.metric-label{
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.metric-value{
  margin-top: 10px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.metric-meta{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.panel-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  gap: 14px;
}

.panel-kicker{
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .34px;
}

.panel-title{
  margin: 6px 0 0;
  font-size: 20px;
  letter-spacing: -.02em;
}

.stack{
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.field{
  display: grid;
  gap: 8px;
}

.field span{
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.82);
}

input,
select{
  width: 100%;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input:focus,
select:focus{
  border-color: rgba(57,194,161,.48);
  box-shadow: 0 0 0 4px var(--accent-2);
  background: rgba(255,255,255,.08);
}

.section-tools{
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-note,
.pager-label{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.pager{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.result-list,
.log-list{
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.result-card,
.log-card,
.callout{
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.15);
  padding: 14px;
}

.result-name,
.log-title{
  font-weight: 800;
  letter-spacing: -.01em;
}

.result-meta,
.log-meta,
.callout{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.callout.compact{
  margin-top: 16px;
}

.result-actions{
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-btn,
.filter-pill{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, opacity .2s ease;
}

.toolbar{
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill{
  background: rgba(255,255,255,.04);
  color: var(--muted);
}

.filter-pill.active{
  color: var(--text);
  background: rgba(57,194,161,.14);
  border-color: rgba(57,194,161,.28);
}

.logs-panel{
  margin-top: 18px;
}

.log-head{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.tag{
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
}

.tag.impersonation{ background: rgba(57,194,161,.16); color: #aaf1df; }
.tag.activity{ background: rgba(148,163,255,.16); color: #d7deff; }
.tag.approval{ background: rgba(102,168,255,.16); color: #c8deff; }
.tag.auth{ background: rgba(102,168,255,.16); color: #c8deff; }
.tag.sync{ background: rgba(242,184,75,.16); color: #ffe0a4; }

.mini-btn.approve{
  background: rgba(57,194,161,.12);
  border-color: rgba(57,194,161,.22);
}

.mini-btn.revoke{
  background: rgba(255,107,107,.12);
  border-color: rgba(255,107,107,.22);
}

@media (max-width: 980px){
  .hero-grid,
  .panel-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px){
  .topbar-inner{
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions,
  .hero-actions{
    width: 100%;
  }

  .icon-link,
  .btn{
    width: 100%;
  }

  .section-tools{
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}
