:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #101522;
  --panel-2: #151b2a;
  --panel-3: #1a2132;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .15);
  --text: #f6f7fb;
  --muted: #9da7ba;
  --faint: #697386;
  --pink: #ff4de1;
  --pink-soft: rgba(255, 77, 225, .13);
  --lime: #63ff57;
  --lime-soft: rgba(99, 255, 87, .11);
  --amber: #ffbf47;
  --red: #ff5d6c;
  --blue: #62a8ff;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-body {
  background:
    radial-gradient(circle at 88% 5%, rgba(99,255,87,.045), transparent 28rem),
    radial-gradient(circle at 18% 92%, rgba(255,77,225,.045), transparent 32rem),
    var(--bg);
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,77,225,.15), transparent 30rem),
    radial-gradient(circle at 82% 78%, rgba(99,255,87,.10), transparent 28rem),
    linear-gradient(145deg, #070910, #0b1019 60%, #070a10);
}

.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: .18;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.auth-shell {
  position: relative;
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: rgba(12,16,25,.88);
  box-shadow: 0 40px 110px rgba(0,0,0,.48);
  backdrop-filter: blur(20px);
}

.auth-brand {
  min-height: 590px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4.5rem);
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,77,225,.08), transparent 45%, rgba(99,255,87,.05));
}

.auth-brand p { margin: 1rem 0 0; color: var(--muted); }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 6vw, 4.5rem); }
.auth-card h1 { margin: 0 0 .55rem; font-size: clamp(1.65rem, 4vw, 2.15rem); letter-spacing: -.035em; }
.auth-card > p, .subtle { color: var(--muted); }

.brand-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255,77,225,.22), rgba(99,255,87,.15));
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -.08em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 15px 34px rgba(0,0,0,.25);
}

.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: .8rem; }
.wordmark { display: flex; gap: .18em; flex-wrap: wrap; font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 950; line-height: .9; letter-spacing: -.07em; text-transform: uppercase; }
.wordmark span { color: var(--pink); }
.wordmark strong { color: var(--lime); }
.wordmark.compact { display: grid; grid-template-columns: auto auto; gap: 0 .2rem; font-size: 1rem; letter-spacing: -.04em; }
.wordmark.compact small { grid-column: 1 / -1; color: var(--muted); font-size: .65rem; letter-spacing: .18em; }

.form-stack { display: grid; gap: 1rem; margin-top: 1.7rem; }
.field { display: grid; gap: .48rem; }
.field label { color: #dce1ec; font-size: .88rem; font-weight: 700; }
.field-hint { color: var(--faint); font-size: .78rem; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: #0d121c;
  padding: .78rem .9rem;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(255,77,225,.7); box-shadow: 0 0 0 4px rgba(255,77,225,.09); background: #101622; }
input::placeholder, textarea::placeholder { color: #596277; }

.button, button.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  padding: .7rem 1rem;
  color: #071008;
  background: var(--lime);
  text-decoration: none;
  font-weight: 850;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(99,255,87,.25); outline-offset: 2px; }
.button.secondary { color: var(--text); border-color: var(--line-strong); background: var(--panel-3); }
.button.pink { color: #170513; background: var(--pink); }
.button.danger { color: #fff; background: #9b2737; }
.button.small { min-height: 34px; padding: .45rem .7rem; font-size: .82rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }

.notice { margin: 0 0 1rem; padding: .82rem 1rem; border: 1px solid var(--line); border-radius: 11px; color: #dce2ed; background: var(--panel-2); }
.notice-success { border-color: rgba(99,255,87,.25); background: var(--lime-soft); }
.notice-error { border-color: rgba(255,93,108,.32); background: rgba(255,93,108,.10); }
.notice-warning { border-color: rgba(255,191,71,.3); background: rgba(255,191,71,.09); }

.secret-box { margin: 1rem 0; padding: 1rem; border: 1px dashed rgba(99,255,87,.35); border-radius: 12px; background: rgba(99,255,87,.06); }
.secret-box code { display: block; overflow-wrap: anywhere; color: #dfffdc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: 1rem 0; }
.recovery-grid code { padding: .65rem; border: 1px solid var(--line); border-radius: 8px; text-align: center; background: #0c111a; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 250px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(11,15,23,.96);
  backdrop-filter: blur(18px);
}
.sidebar-brand { display: flex; gap: .8rem; align-items: center; padding: 1.25rem; color: inherit; text-decoration: none; }
.sidebar-nav { display: grid; gap: .28rem; padding: .6rem .75rem; }
.sidebar-nav a { padding: .72rem .85rem; border: 1px solid transparent; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 680; }
.sidebar-nav a:hover { color: var(--text); background: rgba(255,255,255,.035); }
.sidebar-nav a.active { border-color: rgba(255,77,225,.18); color: #fff; background: linear-gradient(90deg, rgba(255,77,225,.13), rgba(99,255,87,.05)); box-shadow: inset 3px 0 0 var(--pink); }
.sidebar-user { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; margin-top: auto; padding: 1rem; border-top: 1px solid var(--line); }
.sidebar-user strong, .sidebar-user span { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: .82rem; }
.sidebar-user span { color: var(--muted); font-size: .72rem; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #160514; background: var(--pink); font-weight: 900; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--muted); background: var(--panel-2); }

.main-content { min-height: 100vh; margin-left: 250px; padding: 2rem clamp(1.1rem, 3vw, 3rem) 4rem; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; }
.page-header h1 { margin: .18rem 0 0; font-size: clamp(1.65rem, 3vw, 2.4rem); letter-spacing: -.04em; }
.eyebrow { color: var(--pink); font-size: .73rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.secure-pill { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; border: 1px solid rgba(99,255,87,.18); border-radius: 999px; color: #caffc6; background: rgba(99,255,87,.06); font-size: .75rem; font-weight: 750; }
.secure-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(99,255,87,.55); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(19,25,38,.96), rgba(13,18,28,.96)); box-shadow: 0 14px 35px rgba(0,0,0,.12); }
.stat-card { padding: 1.05rem; }
.stat-card span { color: var(--muted); font-size: .8rem; }
.stat-card strong { display: block; margin-top: .35rem; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.05em; }
.stat-card.accent-pink { border-top-color: rgba(255,77,225,.6); }
.stat-card.accent-lime { border-top-color: rgba(99,255,87,.6); }
.stat-card.accent-amber { border-top-color: rgba(255,191,71,.6); }
.stat-card.accent-blue { border-top-color: rgba(98,168,255,.6); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 1rem; margin-top: 1rem; }
.panel { overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 1rem; }
.panel-body { padding: 1rem 1.1rem; }
.panel-body.flush { padding: 0; }
.panel + .panel { margin-top: 1rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .78rem 1rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--faint); font-size: .69rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
td { color: #dce1eb; font-size: .86rem; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.018); }
.cell-main { display: block; color: var(--text); font-weight: 750; }
.cell-sub { display: block; margin-top: .1rem; color: var(--faint); font-size: .73rem; }

.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .52rem; border: 1px solid var(--line); border-radius: 999px; color: #cfd6e2; background: rgba(255,255,255,.035); font-size: .7rem; font-weight: 800; text-transform: capitalize; }
.badge.open, .badge.high, .badge.critical { border-color: rgba(255,93,108,.28); color: #ffb0b8; background: rgba(255,93,108,.08); }
.badge.reviewed, .badge.medium, .badge.in_progress { border-color: rgba(255,191,71,.28); color: #ffdb99; background: rgba(255,191,71,.08); }
.badge.resolved, .badge.closed, .badge.online, .badge.low { border-color: rgba(99,255,87,.25); color: #caffc5; background: rgba(99,255,87,.07); }
.badge.owner { color: #ffb8f3; border-color: rgba(255,77,225,.3); background: rgba(255,77,225,.09); }
.badge.admin { color: #c5ffbf; border-color: rgba(99,255,87,.25); background: rgba(99,255,87,.07); }

.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin-bottom: 1rem; }
.toolbar .field { min-width: 180px; flex: 1; }
.toolbar .button { flex: 0 0 auto; }
.split-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.span-2 { grid-column: 1 / -1; }

.timeline { display: grid; gap: .8rem; }
.timeline-item { position: relative; padding: .85rem 1rem .85rem 1.2rem; border-left: 2px solid var(--line-strong); background: rgba(255,255,255,.018); }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 1.1rem; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
.timeline-item strong { display: block; font-size: .86rem; }
.timeline-item p { margin: .35rem 0 0; color: var(--muted); white-space: pre-wrap; }
.timeline-item time { color: var(--faint); font-size: .72rem; }

.empty-state { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-size: 1rem; }
.empty-state p { max-width: 520px; margin: .45rem auto 1rem; }
.definition-list { display: grid; grid-template-columns: 160px 1fr; gap: .65rem 1rem; }
.definition-list dt { color: var(--faint); }
.definition-list dd { margin: 0; color: #dbe1eb; overflow-wrap: anywhere; }
.code-block { overflow-x: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; color: #d8ffda; background: #090d14; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; white-space: pre-wrap; }
.mobile-menu { display: none; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .auth-body { padding: 1rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: auto; padding: 2rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-brand .brand-mark { margin-bottom: 1rem; }
  .auth-brand .wordmark { font-size: 2rem; }
  .auth-card { padding: 2rem; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding-top: 4.5rem; }
  .mobile-menu { position: fixed; top: .85rem; left: .85rem; z-index: 40; display: block; padding: .55rem .75rem; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: var(--panel-2); }
  .page-header { align-items: flex-start; }
  .secure-pill { display: none; }
  .split-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding-left: .8rem; padding-right: .8rem; }
  .recovery-grid { grid-template-columns: 1fr; }
  .definition-list { grid-template-columns: 1fr; gap: .2rem; }
  .definition-list dd { margin-bottom: .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

