:root {
  color-scheme: light;
  --ink: #14212b;
  --muted: #61717d;
  --line: #d8e1e8;
  --panel: #ffffff;
  --page: #f4f7f5;
  --brand: #101820;
  --accent: #0f7c66;
  --accent-strong: #095c4b;
  --danger-bg: #fff1f0;
  --danger: #a52821;
  --shadow: 0 18px 45px rgba(20, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

html.login-document,
html.login-document body.login-page {
  background: #02070a;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  width: 100%;
}

body.login-page {
  inset: 0;
  min-height: 100dvh;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  align-items: center;
  background: var(--brand);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
}

.brand {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.topnav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.topnav a {
  color: #e6eef3;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 42px 24px 72px;
}

.narrow {
  max-width: 720px;
}

.auth-shell {
  align-items: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(13, 210, 184, 0.11), transparent 28%),
    radial-gradient(ellipse at 78% 3%, rgba(20, 210, 163, 0.2), transparent 31%),
    radial-gradient(ellipse at 18% 49%, rgba(0, 199, 220, 0.07), transparent 26%),
    linear-gradient(155deg, rgba(3, 17, 22, 0.92) 0%, rgba(2, 7, 10, 0.99) 42%, rgba(2, 12, 15, 1) 100%),
    #02070a;
  color: #f6fbff;
  display: flex;
  justify-content: center;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding:
    max(24px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  position: relative;
}

.auth-ambient {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

.auth-ambient::before {
  background-image:
    radial-gradient(circle, rgba(24, 244, 209, 0.72) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(53, 207, 255, 0.38) 0 1px, transparent 1.5px);
  background-position: 0 0, 38px 44px;
  background-size: 96px 96px, 132px 132px;
  content: "";
  inset: 0;
  opacity: 0.09;
  position: absolute;
  transform: translateY(-8%);
}

.auth-ambient::after {
  background:
    radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.14) 52%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(180deg, transparent 52%, rgba(1, 7, 10, 0.92) 100%);
  bottom: 0;
  content: "";
  inset: 0;
  opacity: 0.86;
  position: absolute;
}

.auth-glow {
  background: linear-gradient(110deg, transparent, rgba(28, 230, 191, 0.1), transparent);
  filter: blur(34px);
  height: 28%;
  position: absolute;
  transform: rotate(-18deg);
  width: 72%;
}

.auth-glow-one {
  right: -22%;
  top: 0;
}

.auth-glow-two {
  bottom: 8%;
  left: -26%;
}

.auth-particles {
  display: none;
}

.auth-wave {
  background: url("/login-wave.svg?v=20260428-login4") center bottom / 112% 100% no-repeat;
  bottom: -7%;
  display: block;
  height: 35%;
  left: -6%;
  opacity: 0.74;
  position: absolute;
  right: -6%;
}

.login-stage {
  align-items: center;
  display: flex;
  flex-direction: column;
  max-width: 398px;
  position: relative;
  text-align: center;
  transform: translateY(-2vh);
  width: 100%;
  z-index: 1;
}

.login-mark {
  filter: drop-shadow(0 0 17px rgba(25, 234, 205, 0.3));
  height: 66px;
  margin-bottom: 24px;
  opacity: 0.9;
  width: 66px;
}

.login-stage h1 {
  color: #ffffff;
  font-size: 2.05rem;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

.login-stage h1 span {
  background: linear-gradient(120deg, #12ffd1 0%, #7cf269 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-subtitle {
  color: rgba(158, 182, 199, 0.68);
  font-size: 0.9rem;
  margin: 12px 0 26px;
}

.login-panel {
  background:
    linear-gradient(148deg, rgba(7, 30, 36, 0.54), rgba(2, 9, 13, 0.58)) padding-box,
    linear-gradient(132deg, rgba(96, 255, 231, 0.5), rgba(18, 242, 200, 0.08) 46%, rgba(120, 247, 96, 0.28)) border-box;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid transparent;
  border-radius: 18px;
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 38px rgba(15, 255, 193, 0.022),
    0 0 22px rgba(12, 210, 190, 0.08);
  max-width: 378px;
  padding: 23px;
  text-align: left;
  width: 100%;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  color: rgba(248, 251, 255, 0.92);
  font-size: 0.83rem;
  font-weight: 650;
  gap: 7px;
}

.login-input-shell {
  align-items: center;
  background:
    linear-gradient(145deg, rgba(2, 11, 15, 0.68), rgba(2, 15, 19, 0.55)) padding-box,
    linear-gradient(135deg, rgba(35, 236, 220, 0.2), rgba(97, 165, 178, 0.11), rgba(18, 242, 200, 0.12)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: 18px 1fr auto;
  min-height: 47px;
  padding: 0 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-input-shell:focus-within {
  background:
    linear-gradient(145deg, rgba(2, 13, 18, 0.78), rgba(2, 17, 22, 0.64)) padding-box,
    linear-gradient(135deg, rgba(49, 255, 231, 0.52), rgba(18, 242, 200, 0.18), rgba(124, 242, 105, 0.28)) border-box;
  box-shadow: 0 0 0 2px rgba(18, 244, 211, 0.055), 0 0 17px rgba(10, 227, 206, 0.11);
}

.login-input-shell svg {
  fill: none;
  height: 17px;
  stroke: rgba(15, 255, 193, 0.92);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
  width: 17px;
}

.login-input-shell input {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #f6fbff;
  font-size: 1rem;
  font-weight: 450;
  min-width: 0;
  outline: 0;
  padding: 0;
}

.login-input-shell input::placeholder {
  color: rgba(126, 150, 165, 0.58);
  opacity: 1;
}

.login-input-shell input:focus {
  border-color: transparent;
  outline: 0;
}

.login-input-shell input:-webkit-autofill,
.login-input-shell input:-webkit-autofill:hover,
.login-input-shell input:-webkit-autofill:focus,
.login-input-shell input:-webkit-autofill:active {
  -webkit-text-fill-color: #f6fbff;
  caret-color: #f6fbff;
  box-shadow: 0 0 0 1000px rgba(2, 13, 18, 0.96) inset;
  -webkit-box-shadow: 0 0 0 1000px rgba(2, 13, 18, 0.96) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: rgba(139, 166, 181, 0.78);
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}

.password-toggle svg {
  stroke: currentColor;
}

.password-toggle:hover,
.password-toggle.is-active {
  color: #0fffc1;
}

.login-check {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 520;
  gap: 9px;
  line-height: 1.2;
  margin-top: 4px;
}

.login-check input {
  appearance: none;
  background: rgba(2, 14, 18, 0.82);
  border: 1px solid rgba(15, 255, 193, 0.88);
  border-radius: 5px;
  display: grid;
  height: 19px;
  inline-size: 19px;
  place-content: center;
  width: 19px;
}

.login-check input::before {
  border-bottom: 2px solid #061014;
  border-right: 2px solid #061014;
  content: "";
  height: 8px;
  opacity: 0;
  transform: rotate(45deg) translate(-1px, -1px);
  width: 4px;
}

.login-check input:checked {
  background: #0fffc1;
  box-shadow: 0 0 13px rgba(15, 255, 193, 0.38);
}

.login-check input:checked::before {
  opacity: 1;
}

.button.primary.login-submit {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 46%),
    linear-gradient(104deg, #08d9ff 0%, #0df1cf 44%, #8cf45a 100%);
  border-color: rgba(183, 255, 194, 0.58);
  border-radius: 12px;
  box-shadow:
    0 15px 34px rgba(13, 216, 192, 0.25),
    0 0 22px rgba(21, 245, 207, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -16px 24px rgba(0, 62, 58, 0.15);
  color: #ffffff;
  display: grid;
  font-size: 0.98rem;
  font-weight: 780;
  grid-template-columns: 1fr 18px;
  isolation: isolate;
  margin-top: 8px;
  min-height: 49px;
  overflow: hidden;
  padding: 0 17px;
  position: relative;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25);
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button.primary.login-submit::before {
  background:
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.58), transparent 22%),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
  content: "";
  inset: 1px;
  opacity: 0.42;
  position: absolute;
  transform: translateX(-18%);
  z-index: -1;
}

.button.primary.login-submit span,
.button.primary.login-submit svg {
  position: relative;
  z-index: 1;
}

.button.primary.login-submit svg {
  fill: none;
  height: 18px;
  justify-self: end;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.button.primary.login-submit:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 46%),
    linear-gradient(104deg, #10e3ff 0%, #19f8d5 44%, #9aff63 100%);
  box-shadow:
    0 18px 42px rgba(13, 216, 192, 0.35),
    0 0 30px rgba(21, 245, 207, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -16px 24px rgba(0, 62, 58, 0.12);
  filter: saturate(1.1);
  transform: translateY(-1px);
}

.secure-note {
  align-items: center;
  color: rgba(141, 167, 181, 0.48);
  display: flex;
  font-size: 0.74rem;
  gap: 7px;
  justify-content: center;
  margin: 30px 0 0;
}

.secure-note svg {
  fill: none;
  height: 15px;
  stroke: rgba(15, 255, 193, 0.76);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.secure-note[hidden] {
  display: none;
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading h1,
.login-panel h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  margin: 0;
}

.section-heading p,
.muted {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.row-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.form-stack {
  display: grid;
  gap: 16px;
}

label {
  color: var(--ink);
  display: grid;
  font-weight: 700;
  gap: 7px;
}

input,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 11px 12px;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 124, 102, 0.16);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 4px 0 0;
  padding: 16px;
}

legend {
  font-weight: 800;
  padding: 0 6px;
}

.check-row {
  align-items: center;
  display: flex;
  font-weight: 650;
  gap: 10px;
}

.check-row input {
  inline-size: 18px;
  margin: 0;
}

.check-list {
  display: grid;
  gap: 10px;
}

.button,
button.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: inherit;
}

.topbar .button.ghost {
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notice {
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.notice.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.danger-zone {
  align-items: center;
  background: #fff;
  border: 1px solid #f0c7c3;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding: 16px;
}

.danger-zone p {
  margin: 2px 0 0;
}

.app-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.app-card {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
  text-decoration: none;
}

.app-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(20, 33, 43, 0.08);
  text-decoration: none;
}

.app-icon {
  align-items: center;
  background: #e7f3ef;
  border-radius: 8px;
  color: var(--accent-strong);
  display: inline-flex;
  flex: 0 0 46px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  overflow: hidden;
}

.app-card strong,
.app-card small {
  display: block;
}

.app-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty-state,
.table-section,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty-state {
  color: var(--muted);
  padding: 24px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tabs a {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  padding: 9px 12px;
}

.tabs a.active {
  background: var(--brand);
  color: #fff;
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
}

.stat {
  padding: 20px;
}

.stat span {
  color: var(--muted);
  display: block;
}

.stat strong {
  display: block;
  font-size: 2.1rem;
}

.table-section {
  overflow-x: auto;
}

.table-header {
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.table-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

table {
  border-collapse: collapse;
  min-width: 680px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 680px) {
  .topbar,
  .row-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    padding: 18px;
  }

  .topnav {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .page {
    padding: 30px 16px 56px;
  }

  .auth-shell {
    padding:
      max(20px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }

  .login-stage {
    max-width: 370px;
    transform: translateY(-1.5vh);
  }

  .login-panel {
    padding: 22px;
  }

  .auth-wave {
    background-size: 160% 100%;
    height: 30%;
  }
}
