:root {
  --bg: #0b0d13;
  --surface: rgba(25, 27, 39, 0.92);
  --surface-2: rgba(33, 35, 50, 0.86);
  --surface-3: rgba(18, 20, 31, 0.72);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #f7f8fb;
  --muted: #9aa4b8;
  --primary: #7c5cff;
  --primary-dark: #6548df;
  --cyan: #21d4fd;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #fb7185;
  --ink: #f7f8fb;
  --sidebar: #11131d;
  --sidebar-2: rgba(35, 38, 56, 0.88);
  --radius: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --glow: 0 0 0 1px rgba(124, 92, 255, 0.16), 0 18px 56px rgba(124, 92, 255, 0.16);
  --bg-parallax: 0px;
  --bg-scale: 1.04;
  --bg-drift: 0px;
}

@font-face {
  font-family: "IRANYekan";
  src: url("https://cdn.sqp.ir/Plugins/fonts/IRANYekan/iran-yekan-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IRANYekan";
  src: url("https://cdn.sqp.ir/Plugins/fonts/IRANYekan/iran-yekan-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IRANYekan";
  src: url("https://cdn.sqp.ir/Plugins/fonts/IRANYekan/iran-yekan-700.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "IRANYekan", "IranYekan", Tahoma, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: -6vh -4vw;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 11, 18, 0.2), rgba(8, 11, 18, 0.54) 48%, rgba(8, 11, 18, 0.18)),
    url("./assets/seller-crm-background.png") center / cover no-repeat;
  filter: saturate(1.08) contrast(1.05);
  transform: translate3d(var(--bg-drift), var(--bg-parallax), 0) scale(var(--bg-scale));
  transform-origin: center;
  transition: transform 220ms ease-out;
  animation: backgroundBreath 12s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(8, 11, 18, 0.18), rgba(8, 11, 18, 0.74) 68%),
    linear-gradient(120deg, transparent 0%, rgba(124, 92, 255, 0.08) 36%, transparent 62%),
    linear-gradient(250deg, transparent 4%, rgba(34, 197, 94, 0.07) 44%, transparent 68%);
  opacity: 0.76;
  animation: lightSweep 16s ease-in-out infinite alternate;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-page,
.share-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.11), transparent 42%),
    linear-gradient(315deg, rgba(5, 150, 105, 0.12), transparent 38%),
    var(--bg);
}

.auth-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 42px;
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.22), transparent 42%),
    linear-gradient(315deg, rgba(34, 197, 94, 0.14), transparent 42%),
    var(--sidebar);
  color: #fff;
}

.auth-panel h1 {
  margin: 20px 0 12px;
  font-size: 34px;
  line-height: 1.35;
}

.auth-panel p,
.mini-help,
.muted {
  color: var(--muted);
}

.auth-panel p {
  color: #cbd5e1;
  line-height: 1.9;
}

.auth-card {
  padding: 42px;
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--sidebar);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.24), 0 10px 28px rgba(33, 212, 253, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

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

.field span,
.field label {
  font-size: 12px;
  color: #b5bfd3;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--text);
  background: rgba(12, 14, 22, 0.72);
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.8;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18), 0 0 24px rgba(124, 92, 255, 0.12);
}

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #18bdf4);
  color: #fff;
  box-shadow: 0 12px 28px rgba(124, 92, 255, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #0ea5e9);
}

.btn-soft {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.07);
}

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

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.35);
  box-shadow: none;
}

.btn-success {
  color: #fff;
  background: var(--success);
}

.btn-restore {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.12);
}

.btn-restore:hover {
  color: #fff;
  background: rgba(34, 197, 94, 0.24);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.18);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: var(--line);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(124, 92, 255, 0.18), transparent 26%),
    linear-gradient(0deg, rgba(34, 197, 94, 0.08), transparent 40%),
    rgba(13, 15, 23, 0.96);
  color: #fff;
  padding: 20px;
  border-left: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.sidebar .brand {
  margin-bottom: 28px;
}

.user-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: var(--sidebar-2);
  box-shadow: var(--glow);
}

.user-chip small {
  display: block;
  color: #94a3b8;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: #cbd5e1;
}

.nav button.active,
.nav button:hover {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.24), rgba(33, 212, 253, 0.08));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--success);
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 72px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 23, 0.78);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  animation: contentEnter 420ms ease both;
}

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

.ops-visual {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.16), transparent 45%),
    linear-gradient(315deg, rgba(34, 197, 94, 0.1), transparent 42%),
    rgba(18, 20, 31, 0.82);
  box-shadow: var(--shadow);
}

.ops-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 38%, rgba(124, 92, 255, 0.16), transparent 28%),
    radial-gradient(circle at 82% 30%, rgba(33, 212, 253, 0.12), transparent 30%),
    linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  opacity: 0.46;
  pointer-events: none;
  animation: lightSweep 11s ease-in-out infinite alternate;
}

.ops-copy,
.ops-board {
  position: relative;
  z-index: 1;
}

.ops-copy {
  display: grid;
  align-content: center;
  gap: 12px;
}

.ops-copy h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.6;
}

.ops-copy p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.module-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.06);
}

.module-pill svg {
  width: 16px;
  height: 16px;
}

.ops-board {
  display: grid;
  gap: 10px;
  align-content: center;
}

.pipeline-node {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 9, 16, 0.56);
  transform: translateX(0);
  animation: nodeFloat 4.5s ease-in-out infinite alternate;
}

.pipeline-node:nth-child(2) {
  animation-delay: 420ms;
}

.pipeline-node:nth-child(3) {
  animation-delay: 780ms;
}

.node-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.55);
}

.node-bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
}

.node-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--cyan), var(--success));
  animation: barPulse 2.8s ease-in-out infinite;
}

.stat-card,
.panel,
.table-wrap,
.chat-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  isolation: isolate;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -18%;
  z-index: -1;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--stat-glow), transparent 66%);
  opacity: 0.45;
  animation: statGlow 4s ease-in-out infinite alternate;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(145deg, var(--stat-bg), transparent 58%);
  opacity: 0.72;
}

.stat-card:hover,
.panel:hover,
.chat-card:hover,
.profile-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-violet {
  --stat-a: #8b5cf6;
  --stat-b: #21d4fd;
  --stat-c: #22c55e;
  --stat-bg: rgba(124, 92, 255, 0.18);
  --stat-glow: rgba(124, 92, 255, 0.34);
}

.stat-emerald {
  --stat-a: #22c55e;
  --stat-b: #14b8a6;
  --stat-c: #a7f3d0;
  --stat-bg: rgba(34, 197, 94, 0.16);
  --stat-glow: rgba(34, 197, 94, 0.3);
}

.stat-cyan {
  --stat-a: #21d4fd;
  --stat-b: #38bdf8;
  --stat-c: #7c5cff;
  --stat-bg: rgba(33, 212, 253, 0.14);
  --stat-glow: rgba(33, 212, 253, 0.28);
}

.stat-amber {
  --stat-a: #f59e0b;
  --stat-b: #f97316;
  --stat-c: #fef3c7;
  --stat-bg: rgba(245, 158, 11, 0.13);
  --stat-glow: rgba(245, 158, 11, 0.26);
}

.stat-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #f8fafc;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 35% 20%, var(--stat-a), transparent 58%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-body {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(104px, 1fr);
  align-items: end;
  gap: 14px;
}

.stat-card strong {
  position: relative;
  z-index: 1;
  font-size: 27px;
  line-height: 1.15;
  white-space: nowrap;
  align-self: end;
}

.dashboard-chart-card {
  width: 100%;
  padding: 26px 28px 30px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    linear-gradient(135deg, rgba(124, 92, 255, 0.13), transparent 42%),
    rgba(15, 17, 28, 0.88);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  overflow: hidden;
  position: relative;
  animation: contentEnter 460ms ease both;
}

.dashboard-chart-card::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33, 212, 253, 0.16), transparent 62%);
  pointer-events: none;
  animation: statGlow 4.8s ease-in-out infinite alternate;
}

.chart-title {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.chart-title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
}

.chart-title span:not(.badge) {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}

.chart-summary {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bar-chart {
  position: relative;
  z-index: 1;
  display: flex;
  height: 360px;
}

.y-axis {
  width: 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #aab4c8;
}

.y-axis span {
  transform: translateY(-50%);
}

.chart-area {
  position: relative;
  flex: 1;
  border-left: 2px solid rgba(226, 232, 240, 0.74);
  border-bottom: 2px solid rgba(226, 232, 240, 0.74);
  overflow: hidden;
  border-radius: 0 10px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(5, 8, 16, 0.22);
}

.grid-lines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.grid-lines span {
  width: 100%;
  border-top: 1px dashed rgba(203, 213, 225, 0.3);
}

.bars {
  position: absolute;
  left: 5%;
  right: 4%;
  bottom: 0;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.bar {
  position: relative;
  width: 7.5%;
  min-width: 20px;
  max-width: 48px;
  height: var(--height);
  border-radius: 8px 8px 2px 2px;
  cursor: pointer;
  transform-origin: bottom;
  animation: dashboardBarRise 900ms cubic-bezier(0.2, 0.82, 0.2, 1) var(--delay) both, dashboardBarGlow 3.2s ease-in-out calc(var(--delay) + 900ms) infinite alternate;
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 42%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0.72;
}

.bar::after {
  content: attr(data-label) " • " attr(data-value);
  position: absolute;
  right: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(50%) translateY(6px);
  min-width: max-content;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(7, 9, 16, 0.92);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.bar:hover {
  transform: translateY(-7px) scaleY(1.015);
  filter: brightness(1.08) saturate(1.15);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 24px color-mix(in srgb, var(--bar-glow) 45%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.bar:hover::after {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

.green {
  --bar-glow: #8bd545;
  background: linear-gradient(180deg, #8bd545 0%, #73bd35 100%);
}

.gray {
  --bar-glow: #d8dce2;
  background: linear-gradient(180deg, #d8dce2 0%, #8f9aaa 100%);
}

.yellow {
  --bar-glow: #ffc947;
  background: linear-gradient(180deg, #ffc947 0%, #ffb92e 100%);
}

.cyan {
  --bar-glow: #30c4c3;
  background: linear-gradient(180deg, #30c4c3 0%, #17a7aa 100%);
}

.light-blue {
  --bar-glow: #b1c4d8;
  background: linear-gradient(180deg, #b1c4d8 0%, #8ea6bf 100%);
}

.orange {
  --bar-glow: #ff6843;
  background: linear-gradient(180deg, #ff6843 0%, #ff4424 100%);
}

.blue {
  --bar-glow: #1596b6;
  background: linear-gradient(180deg, #1596b6 0%, #087a9d 100%);
}

.dark-blue {
  --bar-glow: #40516a;
  background: linear-gradient(180deg, #40516a 0%, #29384d 100%);
}

.purple {
  --bar-glow: #b242aa;
  background: linear-gradient(180deg, #b242aa 0%, #922c91 100%);
}

.red {
  --bar-glow: #ad0a48;
  background: linear-gradient(180deg, #ad0a48 0%, #8d073a 100%);
}

.stat-chart {
  position: relative;
  min-width: 112px;
  height: 70px;
  overflow: hidden;
  border-radius: 8px;
}

.chart-wave svg {
  width: 100%;
  height: 100%;
}

.chart-wave .area {
  fill: color-mix(in srgb, var(--stat-a) 28%, transparent);
  opacity: 0.75;
  animation: waveArea 3.8s ease-in-out infinite alternate;
}

.chart-wave .line {
  fill: none;
  stroke: url("#waveViolet");
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  filter: drop-shadow(0 0 8px var(--stat-a));
  animation: drawLine 1.7s ease forwards, waveDrift 4s ease-in-out 1.7s infinite alternate;
}

.chart-donut {
  width: 72px;
  min-width: 72px;
  height: 72px;
  justify-self: end;
  border-radius: 50%;
  background:
    conic-gradient(from 220deg, var(--stat-a) 0 74%, rgba(255, 255, 255, 0.1) 74% 100%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--stat-a) 34%, transparent);
  animation: donutSpin 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) both, donutPulse 3s ease-in-out 1.5s infinite;
}

.donut-core {
  position: absolute;
  inset: 11px;
  border-radius: inherit;
  background: rgba(18, 20, 31, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-bars {
  display: flex;
  align-items: end;
  justify-content: end;
  gap: 7px;
  padding: 9px 4px 3px;
}

.chart-bars span {
  width: 10px;
  height: var(--h);
  min-height: 13px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, var(--stat-c), var(--stat-a));
  box-shadow: 0 0 14px color-mix(in srgb, var(--stat-a) 34%, transparent);
  transform-origin: bottom;
  animation: barRise 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both, barBreathe 2.8s ease-in-out infinite alternate;
}

.chart-bars span:nth-child(2) {
  animation-delay: 80ms;
}

.chart-bars span:nth-child(3) {
  animation-delay: 160ms;
}

.chart-bars span:nth-child(4) {
  animation-delay: 240ms;
}

.chart-bars span:nth-child(5) {
  animation-delay: 320ms;
}

.chart-bars span:nth-child(6) {
  animation-delay: 400ms;
}

.chart-bars span:nth-child(7) {
  animation-delay: 480ms;
}

.chart-bars span:nth-child(8) {
  animation-delay: 560ms;
}

.chart-orbit {
  width: 72px;
  min-width: 72px;
  height: 72px;
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.13) 0 8px, transparent 9px),
    conic-gradient(from 120deg, transparent, var(--stat-a), transparent, var(--stat-b), transparent);
  animation: orbitSpin 4.2s linear infinite;
}

.chart-orbit span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--stat-c);
  box-shadow: 0 0 15px var(--stat-a);
}

.chart-orbit span:nth-child(1) {
  top: 6px;
  left: 50%;
}

.chart-orbit span:nth-child(2) {
  right: 8px;
  bottom: 16px;
}

.chart-orbit span:nth-child(3) {
  left: 10px;
  bottom: 17px;
}

.panel {
  padding: 18px;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.table-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.table-tools input,
.table-tools select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text);
  background: rgba(12, 14, 22, 0.72);
}

.table-wrap {
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.data-table th {
  color: #b5bfd3;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.data-table tr {
  transition: background 160ms ease;
}

.data-table tbody tr:hover {
  background: rgba(124, 92, 255, 0.08);
}

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

.badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(124, 92, 255, 0.18);
  color: #d7d0ff;
  border: 1px solid rgba(124, 92, 255, 0.28);
}

.badge.success {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.28);
}

.badge.warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.28);
}

.badge.danger {
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.28);
}

.badge.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.22);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 620px);
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(7px);
}

.drawer-panel {
  min-height: 100vh;
  overflow-y: auto;
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.12), transparent 38%),
    #12141f;
  padding: 22px;
  box-shadow: var(--shadow);
  animation: drawerEnter 220ms ease both;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

.section-title {
  margin: 18px 0 10px;
  color: var(--ink);
  font-size: 14px;
}

.installments {
  display: grid;
  gap: 8px;
}

.installment-row {
  display: grid;
  grid-template-columns: 1fr 1fr 130px 38px;
  gap: 8px;
}

.notes-list,
.message-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-left: 4px;
}

.note,
.message {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.note small,
.message small {
  display: block;
  color: var(--muted);
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.btn-delete-action,
.btn-message-delete {
  min-height: 34px;
  padding: 0 10px;
  gap: 6px;
  white-space: nowrap;
}

.btn-delete-action i,
.btn-message-delete i {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.chat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.chat-card {
  min-height: 560px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.chat-card h2 {
  margin: 0;
  font-size: 16px;
}

.message.mine {
  border-color: rgba(124, 92, 255, 0.34);
  background: rgba(124, 92, 255, 0.14);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-card {
  padding: 16px;
}

.profile-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.copy-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.copy-line input {
  direction: ltr;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-line {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #151827;
  color: #fff;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.mobile-menu {
  display: none;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

select option {
  background: #151827;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #6f7a91;
}

@keyframes backgroundBreath {
  from {
    filter: saturate(1.02) contrast(1.02);
  }
  to {
    filter: saturate(1.18) contrast(1.08);
  }
}

@keyframes lightSweep {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 1%, 0) scale(1.02);
  }
}

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

@keyframes drawerEnter {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes sparkMove {
  from {
    transform: translateX(-4px);
    opacity: 0.5;
  }
  to {
    transform: translateX(4px);
    opacity: 0.95;
  }
}

@keyframes statGlow {
  from {
    transform: translate3d(-6px, 4px, 0) scale(0.92);
    opacity: 0.32;
  }
  to {
    transform: translate3d(8px, -5px, 0) scale(1.08);
    opacity: 0.58;
  }
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes waveArea {
  from {
    transform: translateY(4px);
    opacity: 0.44;
  }
  to {
    transform: translateY(-2px);
    opacity: 0.78;
  }
}

@keyframes waveDrift {
  from {
    transform: translateX(-2px);
  }
  to {
    transform: translateX(2px);
  }
}

@keyframes donutSpin {
  from {
    transform: rotate(-120deg) scale(0.82);
    opacity: 0.2;
  }
  to {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes donutPulse {
  0%,
  100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.35) brightness(1.12);
  }
}

@keyframes barRise {
  from {
    transform: scaleY(0);
    opacity: 0.22;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes barBreathe {
  from {
    filter: brightness(0.92);
  }
  to {
    filter: brightness(1.18);
  }
}

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

@keyframes dashboardBarRise {
  from {
    transform: scaleY(0);
    opacity: 0;
    filter: blur(2px);
  }
  to {
    transform: scaleY(1);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes dashboardBarGlow {
  from {
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.22),
      0 0 10px color-mix(in srgb, var(--bar-glow) 18%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
  to {
    box-shadow:
      0 13px 28px rgba(0, 0, 0, 0.26),
      0 0 22px color-mix(in srgb, var(--bar-glow) 34%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

@keyframes nodeFloat {
  from {
    transform: translateX(-3px);
  }
  to {
    transform: translateX(3px);
  }
}

@keyframes barPulse {
  0%,
  100% {
    filter: saturate(1);
    opacity: 0.72;
  }
  50% {
    filter: saturate(1.45);
    opacity: 1;
  }
}

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

@media (max-width: 1100px) {
  .stats-grid,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .ops-visual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .data-table {
    min-width: 0;
    display: block;
    border-collapse: separate;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 12px;
    padding: 10px;
  }

  .data-table tr {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(12, 14, 22, 0.7);
    overflow: hidden;
  }

  .data-table th,
  .data-table td {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.8;
  }

  .data-table tr:last-child td,
  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td .toolbar {
    width: auto;
    justify-content: flex-start;
  }

  .data-table td input[readonly] {
    width: 100% !important;
    min-width: 0;
  }

  .dashboard-chart-card {
    padding: 20px 16px 24px;
  }

  .chart-title {
    flex-direction: column;
    margin-bottom: 18px;
  }

  .bar-chart {
    height: 300px;
  }

  .bars {
    gap: 7px;
  }

  .bar {
    width: 8%;
    min-width: 12px;
    border-radius: 6px 6px 2px 2px;
  }

  .bar::after {
    display: none;
  }

  .y-axis {
    width: 38px;
    font-size: 10px;
  }

  .table-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .table-tools input,
  .table-tools select {
    width: 100%;
    min-width: 0;
  }

  .table-wrap {
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .auth-shell,
  .app-shell,
  .drawer {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 28px;
  }

  .auth-card,
  .content {
    padding: 18px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 8;
    width: min(82vw, 310px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .stats-grid,
  .grid-2,
  .grid-3,
  .perm-grid,
  .installment-row {
    grid-template-columns: 1fr;
  }

  .ops-visual {
    padding: 14px;
  }

  .ops-copy h2 {
    font-size: 20px;
  }

  .topbar {
    padding: 14px 16px;
  }

  .drawer-panel {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 13px;
  }

  .login-page,
  .share-page {
    padding: 10px;
    align-items: start;
  }

  .auth-shell {
    width: 100%;
    border-radius: 8px;
  }

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

  .auth-panel h1 {
    margin-top: 16px;
    font-size: 24px;
  }

  .auth-card {
    padding: 18px;
  }

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

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

  .toolbar {
    width: 100%;
  }

  .toolbar .btn {
    min-width: 0;
  }

  .content {
    padding: 12px;
    gap: 12px;
  }

  .panel,
  .stat-card,
  .chat-card,
  .profile-card,
  .ops-visual {
    padding: 12px;
  }

  .stat-card {
    min-height: 128px;
  }

  .stat-body {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .stat-chart {
    min-width: 92px;
    height: 62px;
  }

  .chart-donut,
  .chart-orbit {
    width: 60px;
    min-width: 60px;
    height: 60px;
  }

  .dashboard-chart-card {
    padding: 16px 12px 20px;
  }

  .bar-chart {
    height: 260px;
  }

  .bars {
    left: 6%;
    right: 4%;
    gap: 5px;
  }

  .bar {
    min-width: 9px;
  }

  .ops-copy h2 {
    font-size: 18px;
  }

  .module-pill {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .table-tools {
    padding: 10px;
  }

  .table-tools input,
  .table-tools select,
  .copy-line {
    width: 100%;
  }

  .copy-line {
    grid-template-columns: 1fr;
  }

  .drawer-panel {
    padding: 16px 12px;
  }

  .drawer-head {
    align-items: flex-start;
  }

  .btn {
    min-height: 38px;
    padding: 8px 10px;
  }
}
