:root {
  --navy: #0a1f5c;
  --white: #ffffff;
  --muted: color-mix(in srgb, var(--navy) 52%, white);
  --line: color-mix(in srgb, var(--navy) 12%, white);
  --wash: color-mix(in srgb, var(--navy) 5%, white);
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--navy);
  background: var(--white);
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.muted { color: var(--muted); }
.tight { margin: 0; }

.rise {
  animation: rise .7s var(--ease) both;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes ken {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}
@keyframes draw {
  from { width: 0; }
  to { width: 36px; }
}
@keyframes pulseLine {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* LOGIN */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 42%) 1fr;
}
.auth-left {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.auth-left__inner { width: min(360px, 100%); }
.wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.wordmark span {
  display: block;
  margin-top: 6px;
  height: 1px;
  background: var(--navy);
  animation: draw .8s var(--ease) both;
}
.auth-left h1 {
  font-size: 32px;
  font-weight: 500;
  margin: 36px 0 8px;
  letter-spacing: -0.03em;
}
.auth-left .lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.auth-form { display: grid; gap: 16px; }
.field span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.field-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: var(--white);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field-wrap:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 10%, transparent);
}
.field-wrap svg {
  width: 18px; height: 18px;
  stroke: var(--navy); fill: none; stroke-width: 1.6; flex: none;
}
.field-wrap input {
  border: 0; outline: 0; width: 100%; background: transparent; font-size: 16px;
}
.btn-navy {
  height: 50px;
  border: 0;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease);
}
.btn-navy::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  transform: translateX(-120%);
  animation: sheen 3.2s ease-in-out infinite;
}
@keyframes sheen {
  0%, 55% { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}
.btn-navy:hover { transform: translateY(-1px); }
.btn-navy svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; position: relative; z-index: 1; }
.btn-navy span { position: relative; z-index: 1; }
.btn-ghost {
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--white) 35%, transparent);
  background: transparent;
  color: var(--white);
  padding: 0 16px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  letter-spacing: .04em;
}
.demo-hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.alert {
  padding: 10px 12px;
  border: 1px solid var(--navy);
  background: var(--wash);
  font-size: 13px;
  margin-bottom: 4px;
}

.auth-right {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
}
.auth-right img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  mix-blend-mode: luminosity;
  opacity: .55;
  animation: ken 18s var(--ease) alternate infinite;
}
.auth-right__veil {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--navy) 62%, transparent);
}
.auth-right__copy {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
}
.auth-right__copy p {
  max-width: 380px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 12px;
}
.auth-right__copy small {
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 11px;
  opacity: .8;
}

/* ADMIN */
.app-body {
  height: 100svh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 248px 1fr;
  overflow: hidden;
}
.sidebar {
  background: var(--navy);
  color: var(--white);
  padding: 28px 16px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100svh;
  position: sticky;
  top: 0;
}
.sidebar__brand {
  padding: 0 10px 28px;
  margin: 0 6px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--white) 14%, transparent);
}
.menu-open, .menu-close { display: none; }
.icon-btn--on-navy {
  border-color: color-mix(in srgb, var(--white) 28%, transparent);
  background: transparent;
}
.icon-btn--on-navy svg { stroke: var(--white); }
.topbar__left {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}
.nav-scrim {
  display: none;
}
.sidebar__brand strong {
  display: block;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
}
.sidebar__brand small {
  display: block;
  margin-top: 6px;
  opacity: .65;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar__nav {
  display: grid;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
}
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 44px;
  color: color-mix(in srgb, var(--white) 72%, transparent);
  position: relative;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.sidebar__nav a svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6;
}
.sidebar__nav a::before {
  content: "";
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--white);
  transform: scaleY(0);
  transition: transform .25s var(--ease);
}
.sidebar__nav a:hover,
.sidebar__nav a.is-active {
  color: var(--white);
  background: color-mix(in srgb, var(--white) 8%, transparent);
}
.sidebar__nav a.is-active::before { transform: scaleY(1); }
.sidebar__logout {
  flex-shrink: 0;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--white) 42%, transparent);
  background: color-mix(in srgb, var(--white) 8%, transparent);
  transition: background .2s var(--ease);
}
.sidebar__logout svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
.sidebar__logout:hover {
  background: color-mix(in srgb, var(--white) 16%, transparent);
}

.main {
  background: var(--white);
  padding: 28px 36px 56px;
  overflow: auto;
  min-height: 0;
  height: 100svh;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-title {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.topbar__right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--white);
  display: grid; place-items: center;
  transition: background .2s var(--ease);
}
.icon-btn.menu-open,
.icon-btn.menu-close { display: none; }
.icon-btn:hover { background: var(--wash); }
.icon-btn svg { width: 18px; height: 18px; stroke: var(--navy); fill: none; stroke-width: 1.6; }
.avatar {
  display: flex; align-items: center; gap: 10px;
}
.avatar strong {
  width: 36px; height: 36px;
  background: var(--navy); color: var(--white);
  display: grid; place-items: center;
  font-size: 13px;
}
.avatar span { display: block; font-size: 13px; font-weight: 600; }
.avatar small { color: var(--muted); }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  background: var(--white);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--navy) 8%, transparent);
}
.kpi-card .kpi-icon {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}
.kpi-card strong {
  display: block;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.kpi-card small { color: var(--muted); }

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  min-height: 220px;
  background: var(--navy);
  color: var(--white);
  margin-bottom: 28px;
  overflow: hidden;
  position: relative;
}
.hero-panel__copy { padding: 32px; position: relative; z-index: 1; }
.hero-panel h2 {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 8px 0 12px;
  max-width: 420px;
}
.kicker {
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 11px;
  opacity: .75;
}
.hero-panel__photo {
  position: relative;
  overflow: hidden;
}
.hero-panel__photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1);
  mix-blend-mode: luminosity;
  opacity: .5;
  animation: ken 16s var(--ease) alternate infinite;
}
.hero-panel__photo::after {
  content: "";
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--navy) 35%, transparent);
}

.block { margin-bottom: 28px; }
.block__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.block__head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.block__head a {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}
.block__head a:hover { color: var(--navy); }

.product-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.product-card {
  border: 1px solid var(--line);
  padding: 10px 10px 14px;
  transition: transform .25s var(--ease);
}
.product-card:hover { transform: translateY(-4px); }
.product-card__img {
  height: 92px;
  margin-bottom: 10px;
  background:
    linear-gradient(135deg, var(--wash), color-mix(in srgb, var(--navy) 18%, white));
  position: relative;
  overflow: hidden;
}
.product-card__img::after {
  content: "";
  position: absolute; inset: 18% 18%;
  border: 1px solid color-mix(in srgb, var(--navy) 22%, white);
  animation: pulseLine 2.8s ease-in-out infinite;
}
.product-card strong { display: block; font-size: 14px; }
.product-card small { color: var(--muted); font-size: 12px; }

.trust-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.trust-row article {
  background: var(--white);
  padding: 18px;
}
.trust-row strong { display: block; margin-bottom: 4px; }
.trust-row p { margin: 0; color: var(--muted); font-size: 13px; }

.auth-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--navy);
  padding: 18px 20px;
  margin-bottom: 28px;
}
.auth-cta p { margin: 4px 0 0; color: var(--muted); }
.btn-navy.sm {
  height: 42px;
  padding: 0 18px;
  width: auto;
  display: inline-flex;
  text-decoration: none;
}
.locked {
  max-width: 640px;
  padding: 48px 8px 24px;
}
.locked h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 10px 0 16px;
  line-height: 1.25;
}
.locked__kicker { color: var(--navy); opacity: .7; }
.locked__body {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 16px;
  font-size: 16px;
}
.locked__note {
  color: var(--navy);
  line-height: 1.65;
  margin: 0 0 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.table { border: 1px solid var(--line); }
.table__row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.table__row:last-child { border-bottom: 0; }
.table__row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--navy);
}
.dot.off { background: transparent; box-shadow: inset 0 0 0 1px var(--navy); }

.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--navy); color: var(--white);
  padding: 12px 14px; font-size: 13px;
  transform: translateY(8px);
  animation: rise .35s var(--ease) both;
}

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .product-row { grid-template-columns: repeat(3, 1fr); }
  .trust-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }
  .auth-left { padding: 28px 20px 36px; order: 1; }
  .auth-right { min-height: 34svh; order: 0; }
  .auth-right__copy { padding: 24px; }
  .auth-right__copy p { font-size: 18px; }
  .hero-panel { grid-template-columns: 1fr; min-height: 0; }
  .hero-panel__photo { min-height: 160px; }
  .hero-panel h2 { font-size: 22px; }
  .hero-panel__copy { padding: 24px; }
  .auth-cta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .btn-navy.sm { width: 100%; }
  .main { padding: 16px 16px 40px; }
  .page-title { font-size: 22px; }
  .avatar__meta { display: none; }
  .table__row { grid-template-columns: 10px 1fr; }
  .table__row small { grid-column: 2; }
  .toast { left: 16px; right: 16px; bottom: 16px; }

  .app-body { grid-template-columns: 1fr; }
  .icon-btn.menu-open,
  .icon-btn.menu-close { display: grid; }
  .nav-scrim {
    display: block;
    position: fixed; inset: 0;
    background: color-mix(in srgb, var(--navy) 45%, transparent);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s var(--ease);
  }
  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .32s var(--ease);
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  .sidebar__nav a { min-height: 46px; }
}

@media (max-width: 640px) {
  .kpi-row, .product-row, .trust-row { grid-template-columns: 1fr 1fr; }
  .auth-left__inner { width: 100%; }
  .auth-left h1 { font-size: 28px; margin-top: 24px; }
}

@media (max-width: 420px) {
  .kpi-row, .product-row, .trust-row { grid-template-columns: 1fr; }
}
