:root {
  color-scheme: light;
  --ink: #0a2938;
  --ink-soft: #244552;
  --deep: #061c2b;
  --deep-2: #09283a;
  --deep-3: #0d3449;
  --aqua: #0fa9a1;
  --aqua-bright: #4fe0d2;
  --aqua-deep: #087e7b;
  --aqua-soft: #dff7f3;
  --aqua-wash: #effbf9;
  --lime: #c9f27c;
  --coral: #ff6f61;
  --coral-soft: #ffebe7;
  --amber: #ef9b24;
  --amber-soft: #fff3dc;
  --success: #15966f;
  --success-soft: #e4f7ef;
  --danger: #d94a4a;
  --danger-soft: #fdeaea;
  --blue: #2479c9;
  --blue-soft: #e8f2fd;
  --canvas: #f2f7f7;
  --surface: #ffffff;
  --surface-soft: #f8fbfb;
  --line: #dbe8e7;
  --line-strong: #c6d9d8;
  --muted: #617c82;
  --muted-2: #8aa1a5;
  --white: #ffffff;
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --shadow-sm: 0 2px 8px rgba(8, 42, 55, 0.05);
  --shadow-md: 0 16px 38px rgba(8, 42, 55, 0.08);
  --shadow-lg: 0 30px 80px rgba(5, 30, 42, 0.16);
  --shadow-aqua: 0 16px 34px rgba(15, 169, 161, 0.22);
  --font-sans: "Segoe UI Variable Text", "Aptos", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Bahnschrift", "Aptos Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --sidebar-width: 276px;
  --topbar-height: 84px;
  --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
strong {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

:focus-visible {
  outline: 3px solid rgba(15, 169, 161, 0.35);
  outline-offset: 3px;
}

::selection {
  background: rgba(79, 224, 210, 0.35);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--aqua-deep);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  content: "";
}

.eyebrow-light {
  color: var(--aqua-bright);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--aqua-bright), var(--aqua) 60%, var(--aqua-deep));
  color: var(--deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 24px rgba(15, 169, 161, 0.2);
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.brand-copy b {
  color: var(--aqua-bright);
  font-weight: 700;
}

.brand-light {
  color: var(--white);
}

.brand-light .brand-copy b {
  color: var(--aqua-bright);
}

.brand-dark .brand-copy b {
  color: var(--aqua);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-deep));
  color: var(--white);
  box-shadow: var(--shadow-aqua);
}

.btn-primary:hover {
  box-shadow: 0 18px 40px rgba(15, 169, 161, 0.3);
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--aqua);
  color: var(--aqua-deep);
}

.btn-ghost {
  background: var(--aqua-wash);
  color: var(--aqua-deep);
}

.btn-ghost:hover {
  background: var(--aqua-soft);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 12px 26px rgba(217, 74, 74, 0.22);
}

.btn-block {
  width: 100%;
  min-height: 52px;
  font-size: 15px;
}

.btn[disabled] {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink-soft);
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.icon-button:hover {
  border-color: var(--aqua);
  background: var(--aqua-wash);
  color: var(--aqua-deep);
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button .icon {
  width: 19px;
  height: 19px;
}

.status-dot,
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aqua-bright);
  box-shadow: 0 0 0 5px rgba(79, 224, 210, 0.12);
}

.live-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(21, 150, 111, 0.12);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(21, 150, 111, 0.12); }
  50% { box-shadow: 0 0 0 8px rgba(21, 150, 111, 0.02); }
}

/* Login */
.login-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 15%, rgba(79, 224, 210, 0.18), transparent 34%),
    radial-gradient(circle at 48% 95%, rgba(15, 169, 161, 0.16), transparent 40%),
    linear-gradient(135deg, #041723 0%, #082738 46%, #0b3548 100%);
  color: var(--white);
}

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

.login-ambient::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, #000, transparent 70%);
  content: "";
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.orb-one {
  top: -14%;
  left: 28%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(79, 224, 210, 0.16), transparent 67%);
  animation: drift 12s ease-in-out infinite alternate;
}

.orb-two {
  bottom: -28%;
  left: -8%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(15, 169, 161, 0.18), transparent 68%);
  animation: drift 16s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate3d(-10px, 0, 0) scale(1); }
  to { transform: translate3d(30px, -18px, 0) scale(1.05); }
}

.water-line {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 220px;
  border-radius: 50%;
  border-top: 1px solid rgba(79, 224, 210, 0.16);
  transform: rotate(-4deg);
}

.line-one {
  bottom: 5%;
}

.line-two {
  bottom: -2%;
  border-top-color: rgba(255, 255, 255, 0.08);
  transform: rotate(2deg);
}

.bubble {
  position: absolute;
  border: 1px solid rgba(159, 244, 235, 0.22);
  border-radius: 50%;
  background: rgba(79, 224, 210, 0.03);
  animation: bubble-rise 12s linear infinite;
}

.bubble-one {
  right: 8%;
  bottom: -60px;
  width: 72px;
  height: 72px;
}

.bubble-two {
  right: 22%;
  bottom: -30px;
  width: 26px;
  height: 26px;
  animation-delay: -3s;
  animation-duration: 9s;
}

.bubble-three {
  right: 41%;
  bottom: -80px;
  width: 120px;
  height: 120px;
  animation-delay: -6s;
  animation-duration: 18s;
}

@keyframes bubble-rise {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-118vh) scale(1.12); opacity: 0; }
}

.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
}

.login-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  padding: clamp(28px, 4.5vw, 68px) clamp(32px, 5vw, 86px);
}

.story-copy {
  max-width: 760px;
  padding: 4vh 0;
}

.story-copy h1 {
  margin: 22px 0 24px;
  font-size: clamp(48px, 6.6vw, 92px);
  font-weight: 650;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.story-copy h1 span {
  background: linear-gradient(100deg, var(--aqua-bright), var(--lime) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.story-lead {
  max-width: 560px;
  color: rgba(230, 247, 248, 0.7);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.7;
}

.story-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 670px;
  margin-top: 44px;
}

.story-stat {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(165, 241, 232, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(14px);
}

.story-stat strong {
  color: var(--aqua-bright);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
}

.story-stat span {
  color: rgba(230, 247, 248, 0.58);
  font-size: 11.5px;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.story-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(230, 247, 248, 0.52);
  font-size: 12px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: clamp(24px, 4vw, 54px);
  background:
    radial-gradient(circle at 85% 12%, rgba(79, 224, 210, 0.12), transparent 30%),
    linear-gradient(160deg, rgba(244, 252, 251, 0.98), rgba(228, 245, 242, 0.96));
  color: var(--ink);
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(24px, 3.4vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 40px 90px rgba(4, 35, 48, 0.2);
  backdrop-filter: blur(18px);
}

.login-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #d4ebe7;
  border-radius: 99px;
  background: var(--aqua-wash);
  color: var(--aqua-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-badge .icon {
  width: 13px;
  height: 13px;
}

.login-time {
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.login-heading h2 {
  margin: 9px 0 8px;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.login-heading > p:last-child {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.login-users {
  display: grid;
  gap: 8px;
  margin: 26px 0 22px;
}

.login-user {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.login-user:hover {
  border-color: #abdcd5;
  background: var(--aqua-wash);
  transform: translateY(-1px);
}

.login-user.is-selected {
  border-color: var(--aqua);
  background: linear-gradient(100deg, var(--aqua-wash), #f8fffd);
  box-shadow: 0 8px 24px rgba(15, 169, 161, 0.12);
}

.login-user .avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.login-user-copy {
  min-width: 0;
}

.login-user-copy strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-user-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.login-user-mark {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  transition: all var(--transition);
}

.login-user-mark .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.login-user.is-selected .login-user-mark {
  border-color: var(--aqua);
  background: var(--aqua);
  color: var(--white);
}

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

.field-label {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pin-field {
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pin-field:focus-within {
  border-color: var(--aqua);
  box-shadow: 0 0 0 4px rgba(15, 169, 161, 0.1);
}

.pin-prefix {
  display: grid;
  width: 46px;
  place-items: center;
  color: var(--muted-2);
}

.pin-prefix .icon {
  width: 17px;
  height: 17px;
}

.pin-field input {
  width: 100%;
  min-width: 0;
  height: 50px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.26em;
  font-variant-numeric: tabular-nums;
}

.pin-field input::placeholder {
  color: #a8bbbd;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.pin-toggle {
  width: 38px;
  height: 38px;
  margin-right: 6px;
  border: 0;
  background: transparent;
}

.field-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.45;
}

.form-error {
  padding: 9px 12px;
  border: 1px solid #f5c8c8;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.login-form .btn-block {
  margin-top: 8px;
}

.login-note {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.login-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  flex: none;
}

.login-foot {
  display: flex;
  width: min(460px, 100%);
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--aqua-soft), #c6eee9);
  color: var(--aqua-deep);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar[data-tone="coral"] {
  background: var(--coral-soft);
  color: #c84a3d;
}

.avatar[data-tone="amber"] {
  background: var(--amber-soft);
  color: #b37113;
}

.avatar[data-tone="blue"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.avatar[data-tone="dark"] {
  background: #e3edf1;
  color: var(--deep-3);
}

/* Application shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% -6%, rgba(79, 224, 210, 0.08), transparent 26%),
    var(--canvas);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 100vh;
  height: 100svh;
  flex-direction: column;
  overflow: hidden auto;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 224, 210, 0.13), transparent 28%),
    linear-gradient(180deg, #061d2d, #08283a 62%, #061c2b);
  color: rgba(237, 250, 250, 0.82);
}

.sidebar::after {
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(79, 224, 210, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(79, 224, 210, 0.025), 0 0 0 76px rgba(79, 224, 210, 0.018);
  content: "";
  pointer-events: none;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 24px 20px 18px;
}

.sidebar-brand-row .brand {
  gap: 10px;
  font-size: 18px;
}

.sidebar-brand-row .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.sidebar-brand-row .brand-mark .icon {
  width: 21px;
  height: 21px;
}

.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-context {
  margin: 6px 14px 20px;
  padding: 14px 15px;
  border: 1px solid rgba(148, 230, 220, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
}

.context-label {
  display: block;
  margin-bottom: 3px;
  color: rgba(175, 222, 220, 0.46);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-context strong {
  display: block;
  overflow: hidden;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-sub {
  display: block;
  margin-top: 3px;
  color: rgba(175, 222, 220, 0.5);
  font-size: 10.5px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px;
}

.nav-section-label {
  margin: 16px 10px 7px;
  color: rgba(175, 222, 220, 0.34);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.side-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  color: rgba(226, 244, 244, 0.64);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.side-nav-link .icon {
  width: 18px;
  height: 18px;
  color: rgba(164, 220, 216, 0.6);
  transition: color var(--transition);
}

.side-nav-link:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--white);
}

.side-nav-link.is-active {
  background: linear-gradient(90deg, rgba(15, 169, 161, 0.22), rgba(15, 169, 161, 0.08));
  color: var(--white);
}

.side-nav-link.is-active::before {
  position: absolute;
  left: -14px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--aqua-bright);
  box-shadow: 0 0 16px rgba(79, 224, 210, 0.55);
  content: "";
}

.side-nav-link.is-active .icon {
  color: var(--aqua-bright);
}

.nav-badge {
  display: grid;
  min-width: 21px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 111, 97, 0.17);
  color: #ffaba1;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
}

.sidebar-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 18px 14px 20px;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: rgba(175, 222, 220, 0.46);
  font-size: 10px;
}

.sidebar-status .live-dot {
  width: 6px;
  height: 6px;
  background: var(--aqua-bright);
  box-shadow: none;
  animation: none;
}

.sidebar-version {
  margin-left: auto;
  color: rgba(175, 222, 220, 0.3);
  font-variant-numeric: tabular-nums;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 230, 220, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  font-size: 11px;
  background: rgba(79, 224, 210, 0.13);
  color: var(--aqua-bright);
}

.sidebar-user-copy {
  min-width: 0;
}

.sidebar-user-copy strong {
  display: block;
  overflow: hidden;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy span {
  display: block;
  margin-top: 1px;
  color: rgba(175, 222, 220, 0.46);
  font-size: 10px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: transparent;
  color: rgba(226, 244, 244, 0.55);
  font-size: 11px;
  transition: background var(--transition), color var(--transition);
}

.sidebar-logout:hover {
  background: rgba(255, 111, 97, 0.1);
  color: #ffb1a9;
}

.sidebar-logout .icon {
  width: 15px;
  height: 15px;
}

.app-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid rgba(198, 217, 216, 0.62);
  background: rgba(242, 247, 247, 0.83);
  backdrop-filter: blur(18px);
}

.topbar-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.menu-button {
  display: none;
}

.topbar-title {
  min-width: 0;
}

.topbar-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--aqua-deep);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-title h1 {
  overflow: hidden;
  font-size: clamp(21px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-clock {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 6px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.topbar-clock #live-clock {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}

.topbar-clock #live-date {
  color: var(--muted-2);
}

.topbar-button {
  width: 40px;
  height: 40px;
}

.topbar-button.is-spinning .icon {
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 4px 5px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.user-pill .avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 10px;
}

.user-pill-copy {
  display: none;
  min-width: 0;
  padding-right: 5px;
  text-align: left;
}

.user-pill-copy strong {
  display: block;
  max-width: 128px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill-copy span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
}

.page-root {
  flex: 1;
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: clamp(20px, 2.7vw, 38px) clamp(20px, 3vw, 42px) 54px;
  outline: none;
}

.bottom-nav {
  display: none;
}

.drawer-backdrop {
  display: none;
}

/* Shared surfaces */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 22px 0;
}

.panel-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.panel-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.panel-body {
  padding: 18px 22px 22px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--aqua-deep);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.panel-link .icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.panel-link:hover .icon {
  transform: translateX(2px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge-ok {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warn {
  background: var(--amber-soft);
  color: #b46e0d;
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-info {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-neutral {
  background: #edf3f3;
  color: #6c8589;
}

.badge-solid {
  background: var(--ink);
  color: var(--white);
}

.badge-solid::before {
  background: var(--aqua-bright);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip .icon {
  width: 14px;
  height: 14px;
}

.empty-state {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  place-items: center;
  border-radius: 15px;
  background: var(--aqua-wash);
  color: var(--aqua-deep);
}

.empty-state strong {
  font-size: 14px;
  font-weight: 600;
}

.empty-state p {
  max-width: 340px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state .btn {
  margin-top: 8px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.form-field.is-wide {
  grid-column: 1 / -1;
}

.field-label .optional {
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input,
.select {
  height: 44px;
  padding: 0 12px;
}

.textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 4px rgba(15, 169, 161, 0.1);
}

.input::placeholder,
.textarea::placeholder {
  color: #a5b8bb;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 32px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.form-error-inline {
  margin-top: 4px;
  color: var(--danger);
  font-size: 12px;
}

/* Modal and toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow: auto;
  padding: 24px;
  place-items: center;
  background: rgba(4, 24, 35, 0.58);
  backdrop-filter: blur(7px);
  animation: fade-in 160ms ease-out;
}

.modal {
  width: min(660px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.is-wide {
  width: min(780px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 0;
}

.modal-head h2 {
  margin-top: 5px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
}

.modal-body {
  padding: 22px 26px 6px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 26px 24px;
}

.modal-close {
  width: 38px;
  height: 38px;
  flex: none;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-error {
  border-color: #f3c7c7;
  background: #fffafa;
  color: #9e3737;
}

.toast.is-success {
  border-color: #c3e9dc;
  background: #fbfffd;
}

.toast-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: var(--aqua-wash);
  color: var(--aqua-deep);
}

.toast.is-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast-icon .icon {
  width: 15px;
  height: 15px;
}

.toast.is-leaving {
  animation: toast-out 180ms ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(242, 247, 247, 0.7);
  backdrop-filter: blur(4px);
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--aqua-soft);
  border-top-color: var(--aqua);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--deep);
  color: var(--white);
  font-size: 13px;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #b7cdcb transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: #b7cdcb;
  background-clip: content-box;
}

@media (min-width: 1240px) {
  .user-pill-copy {
    display: block;
  }
}

@media (max-width: 1120px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(400px, 0.86fr);
  }

  .story-copy h1 {
    font-size: clamp(46px, 6vw, 72px);
  }

  .story-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 32px;
  }

  .story-stat {
    min-height: 98px;
    padding: 14px;
  }
}

@media (max-width: 960px) {
  .login-page {
    overflow: auto;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: auto;
    gap: 20px;
    padding-bottom: 18px;
  }

  .story-copy {
    padding: 16px 0 0;
  }

  .story-copy h1 {
    margin: 14px 0 14px;
    font-size: clamp(40px, 9vw, 62px);
  }

  .story-lead {
    max-width: 620px;
    font-size: 14px;
  }

  .story-stats {
    display: none;
  }

  .story-footer {
    margin-top: 10px;
  }

  .login-panel {
    justify-content: flex-start;
    padding: 18px 20px 42px;
    background: transparent;
    color: var(--white);
  }

  .login-card {
    color: var(--ink);
  }

  .login-foot {
    color: rgba(230, 247, 248, 0.5);
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(310px, 88vw);
    transform: translateX(-104%);
    box-shadow: 28px 0 80px rgba(3, 22, 32, 0.3);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .app-shell.is-drawer-open .sidebar {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    visibility: hidden;
    background: rgba(4, 24, 35, 0.48);
    opacity: 0;
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  .app-shell.is-drawer-open .drawer-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .sidebar-close,
  .menu-button {
    display: grid;
  }

  .topbar {
    min-height: 74px;
    padding: 12px 18px;
  }

  .topbar-clock #live-date {
    display: none;
  }

  .page-root {
    padding: 18px 18px 92px;
  }

  .bottom-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 22;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(198, 217, 216, 0.8);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 40px rgba(6, 36, 50, 0.16);
    backdrop-filter: blur(18px);
  }

  .bottom-nav-link {
    display: flex;
    min-width: 0;
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 12px;
    color: var(--muted-2);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .bottom-nav-link .icon {
    width: 19px;
    height: 19px;
  }

  .bottom-nav-link.is-active {
    background: var(--aqua-wash);
    color: var(--aqua-deep);
  }

  .toast-root {
    bottom: 86px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .login-story {
    padding: 22px 20px 10px;
  }

  .story-copy h1 {
    font-size: clamp(36px, 11.5vw, 52px);
  }

  .story-copy {
    padding-top: 12px;
  }

  .story-copy .eyebrow {
    font-size: 10px;
  }

  .story-lead {
    display: none;
  }

  .login-panel {
    padding: 14px 12px 30px;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 26px;
  }

  .login-heading h2 {
    font-size: 27px;
  }

  .login-card-top {
    margin-bottom: 22px;
  }

  .login-users {
    margin: 20px 0 18px;
  }

  .login-user {
    padding: 9px 10px;
  }

  .login-foot {
    padding: 0 8px;
    font-size: 9.5px;
  }

  .topbar-eyebrow {
    display: none;
  }

  .topbar-title h1 {
    font-size: 19px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-clock {
    display: none;
  }

  .user-pill {
    min-height: 38px;
    padding: 3px;
  }

  .user-pill .avatar {
    width: 30px;
    height: 30px;
  }

  .page-root {
    padding: 14px 12px 90px;
  }

  .panel-head {
    padding: 17px 16px 0;
  }

  .panel-body {
    padding: 14px 16px 18px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
  }

  .modal-head {
    padding: 20px 18px 0;
  }

  .modal-body {
    padding: 18px 18px 4px;
  }

  .modal-foot {
    position: sticky;
    bottom: 0;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .modal-foot .btn {
    flex: 1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field.is-wide {
    grid-column: auto;
  }

  .bottom-nav {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .toast-root {
    right: 12px;
    bottom: 78px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
