:root {
  --navy-950: #061827;
  --navy-900: #092338;
  --navy-800: #10354b;
  --teal-500: #12b8a6;
  --teal-100: #d9f5f1;
  --blue-500: #3b82f6;
  --gold-500: #e9ad35;
  --red-500: #ef6461;
  --ink: #143144;
  --muted: #728592;
  --line: #dce6eb;
  --surface: #ffffff;
  --background: #eef3f6;
  --shadow: 0 14px 40px rgba(30, 64, 82, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(18, 184, 166, 0.08), transparent 26%),
    var(--background);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.welcome-splash {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding:
    max(24px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(18, 184, 166, 0.32),
      transparent 32%
    ),
    linear-gradient(145deg, #041725, #083c52 52%, #087d82);
  color: white;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 500ms ease,
    visibility 500ms ease;
}

.welcome-splash::before,
.welcome-splash::after {
  position: absolute;
  width: min(70vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.welcome-splash::before {
  inset-block-start: -42%;
  inset-inline-start: -18%;
}

.welcome-splash::after {
  inset-block-end: -52%;
  inset-inline-end: -14%;
}

.welcome-light-beam {
  position: absolute;
  inset-block-start: -35%;
  inset-inline-start: -50%;
  width: 48%;
  height: 180%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(82, 239, 221, 0.04),
    rgba(247, 201, 103, 0.2),
    rgba(82, 239, 221, 0.08),
    transparent
  );
  filter: blur(20px);
  transform: rotate(20deg) translateX(-120%);
  pointer-events: none;
}

.welcome-splash.is-visible .welcome-light-beam {
  animation: welcomeLightSweep 4.6s 300ms ease-in-out infinite;
}

.welcome-star-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.welcome-star-field i {
  position: absolute;
  inset-block-start: var(--y);
  inset-inline-start: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: white;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.95),
    0 0 18px rgba(49, 226, 207, 0.76);
  opacity: 0;
}

.welcome-star-field i:nth-child(3n) {
  background: #f7c967;
  box-shadow:
    0 0 9px rgba(247, 201, 103, 0.95),
    0 0 21px rgba(247, 201, 103, 0.58);
}

.welcome-splash.is-visible .welcome-star-field i {
  animation: welcomeStarDrift 3.2s var(--d) ease-in-out infinite;
}

.welcome-splash[hidden] {
  display: none;
}

.welcome-splash.is-visible {
  opacity: 1;
  visibility: visible;
}

.welcome-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.welcome-splash-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(92vw, 620px);
  text-align: center;
  transform: translateY(24px) scale(0.96);
  opacity: 0;
}

.welcome-splash.is-visible .welcome-splash-content {
  animation: welcomeContentIn 800ms 120ms cubic-bezier(0.2, 0.9, 0.2, 1)
    forwards;
}

.welcome-logo-stage {
  position: relative;
  display: grid;
  width: clamp(170px, 24vw, 230px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 22px;
}

.welcome-company-logo {
  position: relative;
  z-index: 2;
  width: 68%;
  aspect-ratio: 1;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 28px 65px rgba(0, 0, 0, 0.34),
    0 0 0 12px rgba(18, 184, 166, 0.14);
  transform: rotate(-18deg) scale(0.42);
  opacity: 0;
}

.welcome-splash.is-visible .welcome-company-logo {
  animation:
    welcomeLogoIn 900ms 240ms cubic-bezier(0.18, 0.9, 0.2, 1.15) forwards,
    welcomeLogoFloat 2.4s 1.2s ease-in-out infinite;
}

.welcome-orbit {
  position: absolute;
  inset: 4%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  opacity: 0;
}

.welcome-orbit::after {
  position: absolute;
  inset-block-start: 12%;
  inset-inline-end: 9%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #31e2cf;
  box-shadow: 0 0 20px #31e2cf;
  content: "";
}

.welcome-orbit-two {
  inset: 16%;
  border-style: dashed;
  border-color: rgba(233, 173, 53, 0.5);
}

.welcome-splash.is-visible .welcome-orbit-one {
  animation: welcomeOrbit 5s 400ms linear infinite;
  opacity: 1;
}

.welcome-splash.is-visible .welcome-orbit-two {
  animation: welcomeOrbitReverse 7s 520ms linear infinite;
  opacity: 1;
}

.welcome-spark {
  position: absolute;
  z-index: 3;
  color: #f7c967;
  font-size: 24px;
  opacity: 0;
}

.welcome-spark-one {
  inset-block-start: 10%;
  inset-inline-start: 10%;
}

.welcome-spark-two {
  inset-block-end: 10%;
  inset-inline-end: 6%;
  color: #59ead9;
  font-size: 17px;
}

.welcome-splash.is-visible .welcome-spark {
  animation: welcomeSpark 1.5s 900ms ease-in-out infinite;
}

.welcome-company-name {
  margin: 0 0 10px;
  color: #93f2e7;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0;
}

.welcome-splash h2 {
  margin: 0;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1.15;
  opacity: 0;
}

.welcome-user-name {
  margin-top: 7px;
  color: white;
  font-size: clamp(24px, 4vw, 38px);
  opacity: 0;
}

.welcome-subtitle {
  margin: 11px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(15px, 2vw, 19px);
  opacity: 0;
}

.welcome-designer {
  display: grid;
  gap: 4px;
  margin-top: 22px;
  padding: 12px 28px 14px;
  border-top: 1px solid rgba(247, 201, 103, 0.5);
  border-bottom: 1px solid rgba(247, 201, 103, 0.22);
  color: rgba(255, 255, 255, 0.74);
  opacity: 0;
}

.welcome-designer span {
  font-size: 13px;
}

.welcome-designer strong {
  color: #f7c967;
  font-size: clamp(18px, 3vw, 25px);
}

.welcome-splash.is-visible .welcome-company-name,
.welcome-splash.is-visible h2,
.welcome-splash.is-visible .welcome-user-name,
.welcome-splash.is-visible .welcome-subtitle,
.welcome-splash.is-visible .welcome-designer {
  animation: welcomeTextIn 650ms ease forwards;
}

.welcome-splash.is-visible .welcome-company-name {
  animation-delay: 820ms;
}

.welcome-splash.is-visible h2 {
  animation-delay: 980ms;
}

.welcome-splash.is-visible .welcome-user-name {
  animation-delay: 1.12s;
}

.welcome-splash.is-visible .welcome-subtitle {
  animation-delay: 1.24s;
}

.welcome-splash.is-visible .welcome-designer {
  animation-delay: 1.48s;
}

.welcome-skip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 24px;
  padding: 11px 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 800;
  opacity: 0;
  backdrop-filter: blur(10px);
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.welcome-splash.is-visible .welcome-skip {
  animation: welcomeTextIn 500ms 1.75s ease forwards;
}

.welcome-skip:hover,
.welcome-skip:focus-visible {
  background: rgba(18, 184, 166, 0.34);
  transform: translateY(-2px);
}

@keyframes welcomeContentIn {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes welcomeLogoIn {
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

@keyframes welcomeLogoFloat {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

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

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

@keyframes welcomeSpark {
  0%,
  100% {
    transform: scale(0.7) rotate(0);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.2) rotate(22deg);
    opacity: 1;
  }
}

@keyframes welcomeTextIn {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes welcomeLightSweep {
  0% {
    transform: rotate(20deg) translateX(-130%);
    opacity: 0;
  }
  18% {
    opacity: 0.8;
  }
  62% {
    opacity: 0.62;
  }
  100% {
    transform: rotate(20deg) translateX(430%);
    opacity: 0;
  }
}

@keyframes welcomeStarDrift {
  0%,
  100% {
    transform: translate3d(0, 8px, 0) scale(0.45);
    opacity: 0.12;
  }
  45% {
    transform: translate3d(9px, -10px, 0) scale(1.25);
    opacity: 0.9;
  }
  70% {
    transform: translate3d(-5px, -15px, 0) scale(0.72);
    opacity: 0.4;
  }
}

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

  .welcome-light-beam {
    display: none;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr 260px;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  min-height: 100vh;
  max-height: 100vh;
  flex-direction: column;
  padding: 28px 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 80% 12%, rgba(18, 184, 166, 0.18), transparent 25%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  background: linear-gradient(135deg, var(--teal-500), #2d8ba9);
  box-shadow: 0 10px 22px rgba(18, 184, 166, 0.22);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.company-logo {
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 28, 43, 0.18);
}

.company-logo-sidebar {
  width: 58px;
}

.company-logo-auth {
  width: 72px;
}

.company-logo-users {
  width: 76px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 3px;
  color: #9db4c2;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #b8cbd6;
  text-align: right;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-list a.nav-item {
  text-decoration: none;
}

.nav-item:hover:not(:disabled) {
  color: white;
  transform: translateX(-2px);
}

.nav-item.active {
  background: rgba(18, 184, 166, 0.16);
  color: white;
  box-shadow: inset -3px 0 var(--teal-500);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
}

.nav-item.active .nav-icon {
  background: var(--teal-500);
}

.nav-item em {
  margin-right: auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #8da4b2;
  font-size: 9px;
  font-style: normal;
}

.nav-item-soon {
  cursor: default;
  opacity: 0.72;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(18, 184, 166, 0.14);
}

.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-status strong {
  font-size: 12px;
}

.sidebar-status small {
  margin-top: 3px;
  color: #91a8b5;
  font-size: 10px;
}

.main-content {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  padding: 32px clamp(20px, 3vw, 46px) 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow,
.panel-kicker,
.card-kicker {
  margin: 0 0 6px;
  color: var(--teal-500);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.topbar h1 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.topbar p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.connection-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 14px;
  border: 1px solid #cfe8e4;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #337569;
  font-size: 12px;
  font-weight: 700;
}

.connection-pill.offline {
  border-color: #f4cccc;
  color: #b64f4f;
}

.connection-pill.offline .status-dot {
  background: var(--red-500);
  box-shadow: 0 0 0 4px rgba(239, 100, 97, 0.12);
}

.demo-banner {
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px solid #f0d28e;
  border-radius: 14px;
  background: #fff8e7;
  color: #89661c;
  font-size: 12px;
}

.filter-panel {
  display: grid;
  grid-template-columns: 160px 160px 190px auto 1fr;
  align-items: end;
  gap: 12px;
  margin-top: 26px;
  padding: 16px;
  border: 1px solid rgba(205, 219, 226, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 30px rgba(30, 64, 82, 0.04);
  backdrop-filter: blur(12px);
}

.date-field {
  display: grid;
  gap: 7px;
}

.date-field label,
.last-update span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.date-field input,
.date-field select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: white;
  color: var(--ink);
  transition:
    border 160ms ease,
    box-shadow 160ms ease;
}

.date-field input:focus,
.date-field select:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(18, 184, 166, 0.1);
}

.primary-button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-500), #159aae);
  box-shadow: 0 10px 22px rgba(18, 184, 166, 0.18);
  color: white;
  font-weight: 800;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.last-update {
  justify-self: end;
  text-align: left;
}

.last-update strong {
  display: block;
  margin-top: 6px;
  color: var(--navy-800);
  font-size: 12px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.net-card,
.insight-card {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.net-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 30px;
  background:
    radial-gradient(circle at 12% 10%, rgba(18, 184, 166, 0.42), transparent 35%),
    linear-gradient(135deg, var(--navy-900), #0b3e52);
  color: white;
}

.net-card::after {
  position: absolute;
  left: -30px;
  bottom: -65px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.net-card .card-kicker {
  color: #93e7dd;
}

.net-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(31px, 4.2vw, 48px);
  letter-spacing: -0.04em;
}

.net-card small {
  display: block;
  margin-top: 9px;
  color: #a9c3cf;
  font-size: 11px;
}

.net-card-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: #92e9df;
  font-size: 30px;
}

.insight-card {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 24px;
  border: 1px solid #d7e9e7;
  background: linear-gradient(145deg, white, #f3fbfa);
}

.insight-icon {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 17px;
  background: var(--teal-100);
  color: #058b7d;
  font-size: 25px;
}

.insight-card span {
  color: var(--teal-500);
  font-size: 10px;
  font-weight: 800;
}

.insight-card strong {
  display: block;
  margin-top: 8px;
  color: var(--navy-800);
  font-size: 14px;
  line-height: 1.8;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.kpi-card {
  padding: 20px;
  border: 1px solid rgba(219, 229, 235, 0.9);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(30, 64, 82, 0.045);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.kpi-head i {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  font-size: 11px;
  font-style: normal;
}

.tone-teal {
  background: var(--teal-100);
  color: #058b7d;
}

.tone-blue {
  background: #e5efff;
  color: var(--blue-500);
}

.tone-gold {
  background: #fff3d9;
  color: #b47700;
}

.tone-red {
  background: #ffebea;
  color: var(--red-500);
}

.kpi-card > strong {
  display: block;
  margin-top: 16px;
  color: var(--navy-900);
  font-size: clamp(21px, 2vw, 27px);
}

.kpi-card > small {
  display: block;
  margin-top: 8px;
  color: #93a1aa;
  font-size: 10px;
}

.content-grid,
.tables-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.tables-grid {
  grid-template-columns: 1.25fr 1fr;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(219, 229, 235, 0.92);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 10px 34px rgba(30, 64, 82, 0.045);
}

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

.panel-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 17px;
}

.panel-kicker {
  font-size: 9px;
}

.legend,
.muted-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal-500);
}

.chart-wrap {
  position: relative;
  height: 280px;
  padding: 18px 16px 16px;
}

#salesChart {
  width: 100%;
  height: 100%;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.empty-state[hidden] {
  display: none;
}

.table-panel {
  overflow: hidden;
  scroll-margin-top: 24px;
}

.table-scroll {
  max-height: 520px;
  overflow-x: auto;
  overflow-y: auto;
  padding: 14px 14px 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f4;
  text-align: right;
  font-size: 11px;
}

th {
  color: #82939d;
  font-size: 9px;
  font-weight: 800;
}

td {
  color: #345164;
}

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

tfoot th {
  padding: 14px 10px;
  border-top: 2px solid #c9e7e2;
  border-bottom: 0;
  background: #edf9f7;
  color: var(--navy-900);
  font-size: 11px;
  font-weight: 900;
}

tfoot th:last-child {
  color: #087d71;
}

tbody tr:hover td {
  background: #f7fbfb;
}

.branch-badge {
  display: inline-grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--teal-100);
  color: #087d71;
  font-weight: 800;
}

.positive {
  color: #0a8779;
  font-weight: 800;
}

.negative {
  color: var(--red-500);
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 20px 4px 6px;
  border-top: 1px solid #dce7eb;
  color: #657b88;
  font-size: 13px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 28px;
  bottom: 28px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--navy-900);
  box-shadow: var(--shadow);
  color: white;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.new-badge {
  background: rgba(18, 184, 166, 0.18) !important;
  color: #8ef0e5 !important;
}

.assistant-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: grid;
  width: 100vw;
  height: 100vh;
  place-items: center;
  padding: 28px;
  background: rgba(3, 19, 31, 0.58);
  backdrop-filter: blur(7px);
}

.assistant-backdrop[hidden] {
  display: none;
}

.assistant-panel {
  display: grid;
  width: min(940px, 100%);
  max-height: min(780px, calc(100vh - 56px));
  grid-template-rows: auto auto minmax(220px, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 25px;
  background: #f7fafb;
  box-shadow: 0 32px 90px rgba(2, 21, 34, 0.32);
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(18, 184, 166, 0.36), transparent 35%),
    linear-gradient(135deg, var(--navy-900), #0d4054);
  color: white;
}

.assistant-title,
.assistant-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assistant-logo {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #8ef0e5;
  font-size: 24px;
}

.assistant-title span {
  color: #8ed6cf;
  font-size: 12px;
  font-weight: 800;
}

.assistant-title h2 {
  margin: 3px 0 0;
  font-size: 23px;
}

.assistant-status {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #c2d6df;
  font-size: 11px;
}

.assistant-status.ready {
  border-color: rgba(18, 184, 166, 0.32);
  color: #8ef0e5;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  color: white;
  font-size: 22px;
  line-height: 1;
}

.privacy-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-bottom: 1px solid #d8e9e7;
  background: #edfaf8;
  color: #34786f;
  font-size: 13px;
  font-weight: 700;
}

.assistant-messages {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
}

.message {
  display: flex;
  max-width: 82%;
  align-items: flex-start;
  gap: 10px;
}

.message > div {
  padding: 13px 15px;
  border-radius: 16px;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.9;
}

.message small {
  display: block;
  margin-top: 7px;
  color: #8b9ca6;
  font-size: 11px;
}

.assistant-message {
  justify-self: end;
}

.assistant-message > div {
  border: 1px solid #d9e7eb;
  border-top-right-radius: 5px;
  background: white;
  color: var(--ink);
}

.user-message {
  flex-direction: row-reverse;
  justify-self: start;
}

.user-message > div {
  border-top-left-radius: 5px;
  background: var(--navy-800);
  color: white;
}

.message-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--teal-100);
  color: #087d71;
  font-size: 11px;
  font-weight: 900;
}

.user-message .message-avatar {
  background: #dbe8ef;
  color: var(--navy-800);
}

.message.loading p {
  color: var(--muted);
}

.assistant-prompts {
  max-height: 190px;
  overflow-y: auto;
  border-top: 1px solid #edf2f4;
  background: #f7fafb;
}

.suggestion-list {
  display: flex;
  gap: 8px;
  padding: 12px 22px 10px;
  overflow-x: auto;
}

.suggestion-list button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #d3e3e8;
  border-radius: 999px;
  background: white;
  color: #426175;
  font-size: 12px;
}

.suggestion-list button:hover {
  border-color: var(--teal-500);
  color: #087d71;
}

.question-library {
  padding: 0 22px 12px;
}

.question-library summary {
  width: fit-content;
  color: #187f78;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.question-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.question-example-grid button {
  padding: 9px 11px;
  border: 1px solid #d6e5e9;
  border-radius: 10px;
  background: #fff;
  color: #34566b;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

.question-example-grid button:hover {
  border-color: var(--teal-500);
  color: #087d71;
}

.assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid #e0e9ed;
  background: white;
}

.assistant-form textarea {
  width: 100%;
  min-height: 56px;
  max-height: 130px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #d7e2e7;
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
}

.assistant-form textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(18, 184, 166, 0.1);
}

.assistant-form button {
  display: inline-flex;
  min-width: 90px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal-500), #159aae);
  color: white;
  font-size: 17px;
  font-weight: 800;
}

.assistant-form button:disabled {
  cursor: wait;
  opacity: 0.62;
}

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

.topbar-actions,
.user-menu,
.header-buttons,
.row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  flex-direction: column;
  align-items: flex-end;
}

.user-menu {
  justify-content: flex-end;
}

.user-menu div {
  display: grid;
  text-align: right;
}

.user-menu small {
  color: var(--muted);
}

.secondary-button,
.mini-button {
  border: 1px solid #cbdde4;
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.secondary-button {
  padding: 11px 16px;
  font-weight: 700;
}

.compact-button {
  padding: 8px 12px;
  font-size: 13px;
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 15%, rgba(23, 181, 171, 0.2), transparent 28%),
    linear-gradient(145deg, #06283b, #0e4b5d);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 480px);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 70px rgba(0, 20, 35, 0.3);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  color: var(--navy);
}

.auth-brand div {
  display: grid;
}

.auth-brand strong {
  font-size: 21px;
  letter-spacing: 1px;
}

.auth-brand small,
.auth-heading p,
.privacy-note {
  color: var(--muted);
}

.auth-heading h1 {
  margin: 6px 0 8px;
  color: var(--navy);
  font-size: 30px;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.auth-form label,
.user-form label {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-weight: 700;
}

.auth-form [hidden] {
  display: none !important;
}

.auth-form input,
.user-form input,
.user-form select,
.users-table select {
  width: 100%;
  border: 1px solid #cbdde4;
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font: inherit;
}

.auth-form input,
.user-form input,
.user-form select {
  min-height: 48px;
  padding: 10px 13px;
}

.auth-form input:focus,
.user-form input:focus,
.user-form select:focus {
  outline: 3px solid rgba(20, 184, 174, 0.16);
  border-color: var(--teal);
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  justify-content: center;
}

.form-message {
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fff0f0;
  color: #a62626;
}

.privacy-note {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e3ecef;
  font-size: 13px;
}

.auth-footer {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e3ecef;
  color: #657b88;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.users-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.users-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.users-title-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.users-header h1 {
  margin: 6px 0;
  color: var(--navy);
}

.user-create-panel {
  margin-bottom: 24px;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
}

.users-table select {
  min-width: 150px;
  padding: 8px 10px;
}

.account-status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.account-status.active {
  background: #dcf8f2;
  color: #087c70;
}

.account-status.inactive {
  background: #f3e5e5;
  color: #a13b3b;
}

.mini-button {
  padding: 7px 10px;
  font-size: 13px;
}

.mini-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.password-dialog {
  width: min(92vw, 460px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(2, 29, 43, 0.35);
}

.password-dialog::backdrop {
  background: rgba(2, 29, 43, 0.66);
  backdrop-filter: blur(4px);
}

.password-dialog form {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.password-dialog label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.password-dialog input {
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #cbdde4;
  border-radius: 12px;
  font: inherit;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr 220px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .user-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    padding: 16px;
  }

  .brand {
    padding-bottom: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 14px;
  }

  .nav-item {
    justify-content: center;
    padding: 10px;
  }

  .nav-item span:not(.nav-icon),
  .nav-item em {
    display: none;
  }

  .sidebar-status {
    display: none;
  }

  .main-content {
    padding: 22px 16px;
  }

  .topbar,
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .connection-pill {
    justify-self: start;
  }

  .topbar-actions {
    align-items: flex-start;
  }

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .last-update {
    justify-self: start;
    text-align: right;
  }
}

@media (max-width: 560px) {
  body {
    padding:
      env(safe-area-inset-top)
      env(safe-area-inset-right)
      env(safe-area-inset-bottom)
      env(safe-area-inset-left);
  }

  .topbar h1 {
    font-size: 25px;
  }

  .filter-panel,
  .hero-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .net-card {
    padding: 23px;
  }

  .net-card-icon {
    width: 50px;
    height: 50px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    font-size: 12px;
  }

  .auth-card {
    padding: 26px 20px;
  }

  .users-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .users-title-block {
    align-items: flex-start;
  }

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

  .assistant-backdrop {
    padding: 0;
  }

  .assistant-panel {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
  }

  .assistant-header {
    align-items: flex-start;
    padding: 16px;
  }

  .assistant-status {
    display: none;
  }

  .assistant-messages {
    padding: 16px;
  }

  .message {
    max-width: 94%;
  }

  .suggestion-list {
    padding-inline: 16px;
  }

  .assistant-prompts {
    max-height: 165px;
  }

  .question-library {
    padding-inline: 16px;
  }

  .question-example-grid {
    grid-template-columns: 1fr;
  }

  .assistant-form {
    grid-template-columns: 1fr;
    padding: 12px 16px 16px;
  }

  .assistant-form button {
    min-height: 44px;
  }

  .auth-shell {
    min-height: 100dvh;
    padding: 18px;
  }

  .auth-card {
    border-radius: 22px;
  }

  .auth-form input,
  .assistant-form textarea {
    font-size: 16px;
  }
}
