:root {
  --radius: 18px;
  --hud-cut: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

body[data-theme="dark"] {
  --bg: #07070e;
  --bg-soft: #121226;
  --ink: #fcfbff;
  --muted: #c9c4e4;
  --accent: #00e5ff;
  --accent-2: #ff2ed1;
  --accent-3: #ffd300;
  --danger: #ff3b3b;
  --warn: #ff9f1c;
  --surface: rgba(10, 9, 27, 0.95);
  --surface-strong: rgba(17, 11, 38, 0.9);
  --glass: rgba(255, 255, 255, 0.06);
  --border: rgba(151, 235, 255, 0.2);
  --shadow: 0 30px 80px rgba(1, 2, 8, 0.75);
  --glow-strong: rgba(0, 229, 255, 0.52);
  --glow-soft: rgba(255, 46, 209, 0.4);
  --hero-image: url("https://static.cdprojektred.com/cms.cdprojektred.com/16x9_big/872822c5e50dc71f345416098d29fc3ae5cd26c1-1280x720.jpg");
  --grain-image: url("https://static.cdprojektred.com/cms.cdprojektred.com/16x9_big/872822c5e50dc71f345416098d29fc3ae5cd26c1-1280x720.jpg");
  --grid-line: rgba(0, 229, 255, 0.12);
  --hud-shadow: 0 0 22px rgba(0, 229, 255, 0.22), 0 0 42px rgba(255, 46, 209, 0.16);
}

body[data-theme="light"] {
  --bg: #f4efbe;
  --bg-soft: #fff8d9;
  --ink: #111319;
  --muted: #4b5163;
  --accent: #00b7ff;
  --accent-2: #ff3dbf;
  --accent-3: #f4d200;
  --danger: #d91f4a;
  --warn: #d97300;
  --surface: rgba(255, 251, 228, 0.95);
  --surface-strong: rgba(255, 246, 203, 0.94);
  --glass: rgba(255, 255, 255, 0.78);
  --border: rgba(17, 19, 25, 0.18);
  --shadow: 0 20px 50px rgba(49, 38, 8, 0.22);
  --glow-strong: rgba(0, 183, 255, 0.22);
  --glow-soft: rgba(255, 61, 191, 0.2);
  --hero-image: url("https://static.cdprojektred.com/cms.cdprojektred.com/16x9_big/872822c5e50dc71f345416098d29fc3ae5cd26c1-1280x720.jpg");
  --grain-image: url("https://static.cdprojektred.com/cms.cdprojektred.com/16x9_big/872822c5e50dc71f345416098d29fc3ae5cd26c1-1280x720.jpg");
  --grid-line: rgba(17, 19, 25, 0.06);
  --hud-shadow: 0 0 14px rgba(0, 183, 255, 0.16), 0 0 24px rgba(255, 61, 191, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Sora", system-ui, sans-serif;
  background:
    linear-gradient(transparent 95%, var(--grid-line) 100%),
    linear-gradient(90deg, transparent 95%, var(--grid-line) 100%),
    radial-gradient(circle at 20% 20%, var(--glow-soft), transparent 40%),
    radial-gradient(circle at 80% 10%, var(--glow-strong), transparent 45%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.35;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: var(--grain-image);
  background-size: cover;
  opacity: 0.08;
  mix-blend-mode: soft-light;
  z-index: 0;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px);
  z-index: 10;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow), inset 0 -1px 0 rgba(0, 229, 255, 0.25);
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-badge {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bdf4ff;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(0, 229, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px var(--glow-soft);
  transform: rotate(45deg);
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 26px;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--accent);
}

.btn {
  border: 1px solid transparent;
  padding: 12px 20px;
  border-radius: 10px;
  clip-path: var(--hud-cut);
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #05040a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px var(--glow-strong), 0 14px 40px rgba(0, 0, 0, 0.35);
}

.btn::after {
  content: "";
  position: absolute;
  inset: -30% 40% auto -40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-60%) skewX(-15deg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::after {
  opacity: 0.6;
  animation: sweep 1.2s linear;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.12);
}

main {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 0 6vw;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--glow-soft), transparent 35%),
    linear-gradient(300deg, var(--glow-strong), transparent 40%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: heroPulse 5.5s ease-in-out infinite;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      120deg,
      color-mix(in srgb, var(--bg) 95%, transparent) 20%,
      color-mix(in srgb, var(--bg) 60%, transparent) 50%,
      color-mix(in srgb, var(--bg) 92%, transparent) 80%
    ),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  transition: transform 1.2s ease;
}

.hero-content {
  max-width: 560px;
  position: relative;
  z-index: 1;
  padding-top: 110px;
}

.welcome-banner {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(0, 229, 255, 0.1);
  color: #d8fbff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
  transform: translateY(-8px);
  opacity: 0.86;
}

.welcome-banner.show {
  animation: welcomePop 700ms ease;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--accent-3);
}

.hero h1 {
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  margin: 16px 0;
  line-height: 1.1;
  text-shadow: 0 0 34px var(--glow-soft), 0 0 10px rgba(0, 229, 255, 0.25);
}

.hero h1::after {
  content: "";
  display: block;
  height: 4px;
  width: 120px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 18px var(--glow-strong);
}

.hero-copy {
  color: var(--muted);
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 30px;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  clip-path: var(--hud-cut);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.kpi-value {
  display: block;
  font-size: 1.4rem;
  margin-top: 6px;
}

section {
  padding: 110px 6vw;
}

.section-head {
  max-width: 620px;
  margin-bottom: 50px;
}

.section-head h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-head p {
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow), var(--hud-shadow);
  clip-path: var(--hud-cut);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.app-shell:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), var(--hud-shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.nav-btn {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
}

.nav-btn.is-active,
.nav-btn:hover {
  background: color-mix(in srgb, var(--accent-2) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent-2) 50%, transparent);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.32);
}

.status-pill {
  font-size: 0.85rem;
  color: var(--accent);
}

.workspace-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric {
  padding: 18px;
  border-radius: 10px;
  clip-path: var(--hud-cut);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.06);
}

.metric:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 229, 255, 0.2);
}

.metric span {
  font-size: 0.85rem;
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 1.3rem;
  margin: 8px 0 4px;
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.chart-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  clip-path: var(--hud-cut);
  padding: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 46, 209, 0.08);
}

.chart-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(255, 46, 209, 0.18);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
}

.donut {
  width: 100%;
}

.donut-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 12;
}

.donut-seg {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  stroke-dasharray: 90 220;
  filter: drop-shadow(0 0 12px var(--glow-soft));
}

.donut-seg.a {
  stroke: var(--accent);
}

.donut-seg.b {
  stroke: var(--accent-2);
  stroke-dasharray: 60 220;
  stroke-dashoffset: -100;
}

.donut-seg.c {
  stroke: var(--accent-3);
  stroke-dasharray: 40 220;
  stroke-dashoffset: -160;
}

.donut-seg.d {
  stroke: var(--danger);
  stroke-dasharray: 30 220;
  stroke-dashoffset: -200;
}

.donut-label {
  fill: var(--ink);
  font-weight: 600;
}

.legend text {
  fill: var(--muted);
  font-size: 0.7rem;
}

.line {
  width: 100%;
}

.line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px var(--glow-strong));
}

.line-point {
  fill: var(--accent-2);
}

.table {
  display: grid;
  gap: 6px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.6fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  clip-path: var(--hud-cut);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.table-head {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--muted);
  background: transparent;
  border: none;
}

.tag {
  padding: 4px 10px;
  border-radius: 10px;
  clip-path: var(--hud-cut);
  font-size: 0.75rem;
  width: fit-content;
}

.tag.ok {
  background: rgba(0, 229, 255, 0.18);
  color: var(--accent);
}

.tag.warn {
  background: rgba(255, 159, 28, 0.18);
  color: var(--warn);
}

.tag.danger {
  background: rgba(255, 59, 59, 0.2);
  color: var(--danger);
}

.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  align-items: center;
}

.sim-inputs {
  display: grid;
  gap: 18px;
}

.sim-inputs label {
  font-size: 0.85rem;
  color: var(--muted);
}

.sim-inputs input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-value {
  font-size: 0.85rem;
  color: var(--accent-3);
  margin-top: -10px;
}

.sim-output {
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  clip-path: var(--hud-cut);
  padding: 24px;
}

.sim-kpi span {
  color: var(--muted);
  font-size: 0.85rem;
}

.sim-kpi strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 6px;
}

.sim-bar {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  clip-path: var(--hud-cut);
  height: 12px;
  overflow: hidden;
}

.sim-bar-fill {
  position: absolute;
  inset: 0;
  width: 60%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.sim-bar span {
  position: absolute;
  top: 18px;
  font-size: 0.75rem;
  color: var(--muted);
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.diagnostic-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  clip-path: var(--hud-cut);
  padding: 24px;
}

.diagnostic-panel ul {
  list-style: none;
  display: grid;
  gap: 14px;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.alert.warning {
  background: rgba(255, 159, 28, 0.18);
  color: var(--warn);
}

.alert.success {
  background: rgba(0, 229, 255, 0.18);
  color: var(--accent);
}

.alert.danger {
  background: rgba(255, 59, 59, 0.2);
  color: var(--danger);
}

.goal-board {
  display: grid;
  gap: 18px;
}

.goal {
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  clip-path: var(--hud-cut);
  padding: 20px;
}

.progress {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  clip-path: var(--hud-cut);
  height: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  clip-path: var(--hud-cut);
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.goal-status {
  color: var(--muted);
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 8px;
  clip-path: var(--hud-cut);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 20;
  box-shadow: var(--hud-shadow), 0 16px 40px rgba(0, 0, 0, 0.5);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 10, 0.7);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal * {
  pointer-events: auto;
}

.modal-content {
  background: linear-gradient(160deg, rgba(8, 7, 30, 0.97), rgba(4, 3, 18, 0.97));
  border: 1px solid rgba(0, 229, 255, 0.35);
  padding: 28px;
  border-radius: 10px;
  display: grid;
  gap: 12px;
  min-width: 280px;
  color: #eff8ff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 28px rgba(0, 229, 255, 0.22);
  position: relative;
  z-index: 1;
  animation: glowPulse 3s ease-in-out infinite;
  clip-path: var(--hud-cut);
}

.modal.open .modal-content {
  animation: modalEnter 320ms ease-out, glowPulse 3s ease-in-out infinite;
}

.modal-content h3 {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

.modal-content p {
  color: #b7cae6;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.form-error {
  font-size: 0.8rem;
  color: #ff8fa7;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-radius: 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.auth-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  position: relative;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(0, 20, 40, 0.45);
  overflow: hidden;
}

.auth-toggle::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 7px);
  border-radius: 8px;
  background: linear-gradient(120deg, rgba(0, 229, 255, 0.22), rgba(255, 46, 209, 0.22));
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
  transition: transform 260ms ease;
  pointer-events: none;
}

.auth-toggle[data-mode="register"]::before {
  transform: translateX(calc(100% + 3px));
}

.auth-toggle .btn-ghost {
  color: #9ec5e8;
  background: rgba(0, 229, 255, 0.04);
  position: relative;
  z-index: 1;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
  border-color: rgba(0, 229, 255, 0.18);
}

.auth-toggle .btn-ghost.is-active {
  border-color: rgba(0, 229, 255, 0.65);
  color: #d6f9ff;
  background: rgba(0, 229, 255, 0.06);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.24);
}

.is-hidden {
  display: none;
}

.private-shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.private-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  clip-path: var(--hud-cut);
  padding: 22px;
}

.private-card ul {
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
  margin-top: 10px;
}

.private[data-locked="true"] .private-card {
  opacity: 0.72;
}

.modal-content input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(5, 10, 25, 0.88);
  color: #f7fbff;
  width: 100%;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.14);
}

.modal-content input::placeholder {
  color: #89a1c2;
}

.modal-content input:focus-visible {
  outline: 2px solid rgba(0, 229, 255, 0.7);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

.auth-label {
  font-size: 0.8rem;
  color: #9ec4e8;
  margin-top: 6px;
}

.modal-content .btn-ghost {
  color: #bfefff;
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.06);
}

.modal-content .btn-ghost:hover {
  color: #ffffff;
  border-color: rgba(0, 229, 255, 0.8);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.28);
}

.modal-content .btn:not(.btn-ghost) {
  color: #070b18;
  font-weight: 700;
}

.quick-form {
  margin-top: 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  gap: 12px;
}

.quick-form h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
}

.form-grid label {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-grid input,
.form-grid select,
.sim-actions input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 10px;
  background: color-mix(in srgb, var(--bg-soft) 76%, black 6%);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.12);
}

.sim-actions {
  display: grid;
  gap: 10px;
}

.btn-mini {
  padding: 6px 10px;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.goal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

body[data-theme="light"] .scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(17, 19, 25, 0.06) 0px,
    rgba(17, 19, 25, 0.06) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.16;
}

body[data-theme="light"] .particles {
  opacity: 0.45;
}

body[data-theme="light"] .hud-panel::before {
  border-color: rgba(0, 183, 255, 0.34);
}

body[data-theme="light"] .hud-panel::after {
  border-color: rgba(255, 61, 191, 0.28);
}

body[data-theme="dark"] .section-head h2,
body[data-theme="dark"] .chart-header h3,
body[data-theme="dark"] .goal h4 {
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
}

body[data-theme="dark"] .btn-ghost {
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.05);
}

body[data-theme="dark"] .btn-ghost:hover {
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.25);
}

body[data-theme="dark"] .table-head {
  color: #bff5ff;
}

body[data-theme="dark"] .metric strong,
body[data-theme="dark"] .sim-kpi strong,
body[data-theme="dark"] .donut-label,
body[data-theme="dark"] .kpi-value {
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.32);
}

body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .link-btn {
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.42);
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .nav {
    padding: 16px 5vw;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 90px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .table-head {
    display: none;
  }

  .sidebar {
    gap: 16px;
  }
}

@media (max-width: 520px) {
  section {
    padding: 80px 5vw;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .workspace-row {
    grid-template-columns: 1fr;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.2), 0 0 50px rgba(255, 46, 209, 0.15);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.35), 0 0 80px rgba(255, 46, 209, 0.3);
  }
}

@keyframes heroPulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes sweep {
  0% {
    transform: translateX(-60%) skewX(-15deg);
  }
  100% {
    transform: translateX(200%) skewX(-15deg);
  }
}

/* Cyberpunk extras */
body::after {
  content: "";
  position: fixed;
  inset: -20% 0 0;
  background: linear-gradient(transparent, rgba(0, 229, 255, 0.08), transparent);
  opacity: 0.35;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  animation: scanSweep 8s linear infinite;
}

.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0px,
    rgba(0, 0, 0, 0.2) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 229, 255, 0.35) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 20%, rgba(255, 46, 209, 0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 70%, rgba(255, 211, 0, 0.35) 0 1px, transparent 2px),
    radial-gradient(circle at 85% 80%, rgba(0, 255, 156, 0.35) 0 1px, transparent 2px);
  animation: drift 18s linear infinite;
  opacity: 0.6;
}

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}

.glitch::before {
  color: var(--accent);
  text-shadow: -2px 0 var(--accent);
  animation: glitchTop 2.6s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--accent-2);
  text-shadow: 2px 0 var(--accent-2);
  animation: glitchBottom 2.2s infinite linear alternate-reverse;
}

.hud-panel {
  position: relative;
  isolation: isolate;
}

.hud-panel::before,
.hud-panel::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 14px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

.hud-panel::after {
  inset: 6px;
  border: 1px solid rgba(255, 46, 209, 0.25);
  opacity: 0.35;
}

.hud-panel > * {
  position: relative;
  z-index: 1;
}

/* Interaction safety: keeps HUD visuals but preserves full click/tap areas */
.btn,
.btn-mini,
.modal-content input,
.form-grid input,
.form-grid select,
.sim-actions input,
.quick-form select,
.quick-form input {
  clip-path: none;
}

.table-row:hover {
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.25), 0 0 12px rgba(255, 46, 209, 0.18);
}

.donut-seg,
.line-path {
  animation: neonPulse 3s ease-in-out infinite;
}

@keyframes glitchTop {
  0% { clip-path: inset(0 0 85% 0); transform: translate(-1px, -1px); }
  20% { clip-path: inset(0 0 70% 0); transform: translate(1px, 0); }
  40% { clip-path: inset(0 0 60% 0); transform: translate(-2px, 1px); }
  60% { clip-path: inset(0 0 80% 0); transform: translate(2px, -1px); }
  80% { clip-path: inset(0 0 65% 0); transform: translate(-1px, 0); }
  100% { clip-path: inset(0 0 75% 0); transform: translate(1px, 1px); }
}

@keyframes glitchBottom {
  0% { clip-path: inset(80% 0 0 0); transform: translate(1px, 1px); }
  20% { clip-path: inset(70% 0 0 0); transform: translate(-2px, 0); }
  40% { clip-path: inset(60% 0 0 0); transform: translate(2px, -1px); }
  60% { clip-path: inset(75% 0 0 0); transform: translate(-1px, 1px); }
  80% { clip-path: inset(65% 0 0 0); transform: translate(1px, 0); }
  100% { clip-path: inset(85% 0 0 0); transform: translate(-1px, -1px); }
}

@keyframes neonPulse {
  0%, 100% { filter: drop-shadow(0 0 10px var(--glow-strong)); }
  50% { filter: drop-shadow(0 0 20px var(--glow-strong)); }
}

@keyframes scanSweep {
  0% { transform: translateY(-120%); }
  100% { transform: translateY(140%); }
}

@keyframes drift {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-20px) translateX(10px); }
  100% { transform: translateY(0) translateX(0); }
}

@keyframes welcomePop {
  0% { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes modalEnter {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
