:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #eef2f6;
  --text: #17202a;
  --muted: #6a7480;
  --line: #d9e0e7;
  --accent: #147c72;
  --accent-2: #b64f3a;
  --accent-3: #2d6fb7;
  --shadow: 0 18px 55px rgba(25, 36, 47, 0.08);
  --shadow-strong: 0 28px 80px rgba(25, 36, 47, 0.14);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111418;
  --panel: #191e24;
  --panel-2: #242b33;
  --text: #eef3f7;
  --muted: #9aa7b4;
  --line: #303945;
  --accent: #41b8a7;
  --accent-2: #e1745c;
  --accent-3: #79aee6;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
  --shadow-strong: 0 32px 90px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body::selection {
  background: rgba(20, 124, 114, 0.22);
}

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

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

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(120deg, rgba(20, 124, 114, 0.1), transparent 38%),
    radial-gradient(circle at 16% 18%, rgba(20, 124, 114, 0.18), transparent 30%),
    radial-gradient(circle at 84% 20%, rgba(45, 111, 183, 0.16), transparent 28%),
    radial-gradient(circle at 76% 84%, rgba(182, 79, 58, 0.1), transparent 28%),
    var(--bg);
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 124, 114, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 111, 183, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(120deg, transparent, black 22%, black 76%, transparent);
}

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

.login-ambient span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.34;
  animation: drift 9s ease-in-out infinite;
}

.login-ambient span:nth-child(1) {
  top: 16%;
  left: 9%;
}

.login-ambient span:nth-child(2) {
  top: 24%;
  right: 16%;
  background: var(--accent-3);
  animation-delay: -2.2s;
}

.login-ambient span:nth-child(3) {
  right: 9%;
  bottom: 18%;
  background: var(--accent-2);
  animation-delay: -4.8s;
}

.login-ambient span:nth-child(4) {
  bottom: 12%;
  left: 19%;
  animation-delay: -6.1s;
}

.login-ambient span:nth-child(5) {
  top: 52%;
  left: 48%;
  width: 5px;
  height: 5px;
  background: var(--accent-3);
  animation-delay: -3.4s;
}

.login-shell {
  width: min(1180px, calc(100% - 36px));
  min-height: min(740px, calc(100vh - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(390px, 0.8fr);
  gap: 22px;
  place-self: center;
  position: relative;
  z-index: 1;
  perspective: 1400px;
}

.login-visual,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(22px);
  animation: riseIn 0.72s var(--ease-out) both;
}

[data-theme="dark"] .login-visual,
[data-theme="dark"] .login-panel {
  background: rgba(25, 30, 36, 0.86);
}

.login-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 520px;
  isolation: isolate;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(238, 242, 246, 0.7));
}

[data-theme="dark"] .login-visual {
  background:
    linear-gradient(145deg, rgba(25, 30, 36, 0.86), rgba(36, 43, 51, 0.76)),
    var(--panel);
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.login-visual::before {
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 124, 114, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 111, 183, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  animation: gridShift 16s linear infinite;
}

.login-visual::after {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, rgba(20, 124, 114, 0.2), rgba(45, 111, 183, 0.18), rgba(182, 79, 58, 0.12), rgba(20, 124, 114, 0.2));
  filter: blur(18px);
  opacity: 0.7;
  animation: pulseGlow 6s ease-in-out infinite;
}

.visual-copy {
  position: absolute;
  top: 28px;
  left: 28px;
  max-width: 330px;
  animation: fadeUp 0.55s var(--ease-out) 0.18s both;
}

.visual-copy h2 {
  max-width: 310px;
  line-height: 1.15;
}

.visual-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.visual-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(217, 224, 231, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

[data-theme="dark"] .visual-pills span {
  border-color: rgba(48, 57, 69, 0.78);
  background: rgba(25, 30, 36, 0.64);
}

.login-orbit {
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(20, 124, 114, 0.18);
  border-radius: 50%;
  animation: slowSpin 18s linear infinite;
}

.login-orbit::before,
.login-orbit::after {
  content: "";
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(45, 111, 183, 0.14);
  border-radius: inherit;
}

.login-orbit::after {
  inset: 30%;
  border-color: rgba(182, 79, 58, 0.12);
}

.login-orbit span {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 28px rgba(20, 124, 114, 0.38);
}

.login-orbit span:nth-child(1) {
  top: 12%;
  left: 18%;
}

.login-orbit span:nth-child(2) {
  top: 70%;
  right: 16%;
  background: var(--accent-3);
}

.login-orbit span:nth-child(3) {
  right: 44%;
  bottom: -5px;
  background: var(--accent-2);
}

.login-preview {
  width: min(470px, 78%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(25, 36, 47, 0.16);
  transform-style: preserve-3d;
  animation: floatCard 4.8s ease-in-out infinite;
}

.preview-top {
  display: flex;
  gap: 7px;
  margin-bottom: 24px;
}

.preview-top span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--line);
}

.preview-status {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.preview-status strong {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 0.95;
}

.preview-status span {
  max-width: 120px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.preview-tabs {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr 0.6fr;
  gap: 8px;
  margin-bottom: 18px;
}

.preview-tabs span {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
  position: relative;
}

.preview-tabs .active {
  background: rgba(20, 124, 114, 0.16);
}

.preview-tabs .active::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 58%;
  border-radius: inherit;
  background: var(--accent);
  animation: tabFlow 2.8s ease-in-out infinite;
}

.preview-chart {
  height: 170px;
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.preview-chart span {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent-3), var(--accent));
  animation: growBar 0.8s ease both;
}

.preview-chart span:nth-child(2) {
  animation-delay: 0.08s;
}

.preview-chart span:nth-child(3) {
  animation-delay: 0.16s;
}

.preview-chart span:nth-child(4) {
  animation-delay: 0.24s;
}

.preview-chart span:nth-child(5) {
  animation-delay: 0.32s;
}

.preview-row {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  background: var(--panel-2);
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}

.preview-row.short {
  width: 64%;
}

.preview-timeline {
  display: grid;
  grid-template-columns: 0.7fr 1fr 0.54fr;
  gap: 8px;
  margin-bottom: 14px;
}

.preview-timeline span {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 124, 114, 0.14), transparent),
    var(--bg);
  animation: softPop 0.45s var(--ease-out) both;
}

.preview-timeline span:nth-child(2) {
  animation-delay: 0.08s;
}

.preview-timeline span:nth-child(3) {
  animation-delay: 0.16s;
}

.preview-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.5s ease-in-out infinite;
}

.login-signal {
  position: absolute;
  display: grid;
  gap: 2px;
  min-width: 124px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 224, 231, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: floatSignal 5.4s ease-in-out infinite;
}

[data-theme="dark"] .login-signal {
  border-color: rgba(48, 57, 69, 0.86);
  background: rgba(25, 30, 36, 0.76);
}

.login-signal strong {
  font-size: 22px;
}

.login-signal span {
  color: var(--muted);
  font-size: 12px;
}

.signal-top {
  top: 28%;
  right: 8%;
}

.signal-bottom {
  left: 8%;
  bottom: 18%;
  animation-delay: -2.6s;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(26px, 5vw, 46px);
  animation-delay: 0.08s;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.76)),
    var(--panel);
}

[data-theme="dark"] .login-panel {
  background:
    linear-gradient(180deg, rgba(25, 30, 36, 0.94), rgba(25, 30, 36, 0.82)),
    var(--panel);
}

.login-panel > * {
  animation: fadeUp 0.48s var(--ease-out) both;
}

.login-panel > *:nth-child(1) {
  animation-delay: 0.18s;
}

.login-panel > *:nth-child(2) {
  animation-delay: 0.24s;
}

.login-panel > *:nth-child(3) {
  animation-delay: 0.3s;
}

.login-panel > *:nth-child(4) {
  animation-delay: 0.36s;
}

.login-panel > *:nth-child(5) {
  animation-delay: 0.42s;
}

.login-panel > *:nth-child(6),
.login-panel > *:nth-child(7),
.login-panel > *:nth-child(8) {
  animation-delay: 0.48s;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span,
.login-copy {
  color: var(--muted);
}

.login-copy {
  line-height: 1.55;
}

.login-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: color-mix(in srgb, var(--bg) 88%, var(--panel));
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 124, 114, 0.12);
  transform: translateY(-1px);
}

.login-error {
  display: none;
  margin: 0;
  color: var(--accent-2);
  font-size: 13px;
}

.login-error.visible {
  display: block;
  animation: shake 0.28s ease both;
}

.login-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(20, 124, 114, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.login-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(20, 124, 114, 0.3);
}

.login-button:hover::after {
  transform: translateX(100%);
}

.login-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.login-button:active,
.ghost-button:active,
.theme-toggle:active,
.nav-item:active,
.menu-row button:active,
.handle:active {
  transform: translateY(0) scale(0.985);
}

.sidebar {
  min-height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  animation: slideIn 0.5s var(--ease-out) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(20, 124, 114, 0.22);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.brand-mark:hover {
  transform: rotate(-3deg) scale(1.04);
  box-shadow: 0 14px 30px rgba(20, 124, 114, 0.28);
}

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

.brand span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

.nav-item,
.ghost-button,
.theme-toggle,
.menu-row button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-2);
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(0.3);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-item:hover,
.ghost-button:hover,
.menu-row button:hover {
  transform: translateY(-1px);
}

.nav-icon {
  color: var(--muted);
  text-align: center;
}

.badge {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20, 124, 114, 0.12);
  color: var(--accent);
  font-size: 12px;
  text-align: center;
  animation: softPop 0.42s var(--ease-out) both;
}

.section-title,
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.menu-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 8px;
  margin-bottom: 8px;
}

.menu-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.menu-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 124, 114, 0.1);
  transform: translateY(-1px);
}

.menu-row button {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.app-shell {
  min-width: 0;
  padding: 28px;
  animation: fadeUp 0.5s var(--ease-out) 0.08s both;
}

.topbar,
.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

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

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

.link-button {
  display: inline-grid;
  place-items: center;
}

.ghost-button,
.theme-toggle {
  min-height: 40px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ghost-button {
  padding: 0 14px;
}

.inline-actions select {
  min-height: 40px;
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.theme-toggle {
  width: 76px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 3px;
}

.theme-toggle span {
  display: grid;
  place-items: center;
  height: 32px;
  border-radius: 7px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

[data-theme="light"] .sun,
[data-theme="dark"] .moon {
  color: #fff;
  background: var(--accent);
  transform: scale(1.02);
}

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

.status-strip article,
.widget,
.integrations article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.status-strip article {
  padding: 18px;
  animation: fadeUp 0.42s ease both;
}

.status-strip article:nth-child(2) {
  animation-delay: 0.05s;
}

.status-strip article:nth-child(3) {
  animation-delay: 0.1s;
}

.status-strip article:nth-child(4) {
  animation-delay: 0.15s;
}

.status-strip article:hover,
.widget:hover,
.placeholder-grid article:hover,
.integrations article:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
}

.status-strip span,
.status-strip small {
  display: block;
  color: var(--muted);
}

.status-strip small.error {
  color: var(--accent-2);
}

.firebase-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.firebase-status span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.firebase-status .error {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.data-table th {
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 800;
}

.data-table td {
  color: var(--text);
}

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

.status-strip strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.workspace,
.integrations,
.data-section,
.settings-panel {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: pageReveal 0.34s var(--ease-out) both;
}

.status-strip.page-section.active {
  display: grid;
}

.save-state {
  color: var(--muted);
  font-size: 13px;
}

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

.widget-grid.dragging-widgets {
  cursor: grabbing;
}

.widget {
  position: relative;
  min-height: 218px;
  grid-column: span 4;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.42s var(--ease-out) both;
}

.widget.no-enter {
  animation: none;
}

.widget.wide {
  grid-column: span 8;
}

.widget.dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.widget.over {
  border-color: var(--accent);
}

.widget-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.widget-header p {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
}

.handle {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.handle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.handle:active {
  cursor: grabbing;
}

.widget.drag-source {
  opacity: 0.28;
  transform: scale(0.985);
  box-shadow: none;
}

.widget.drop-target {
  border-color: var(--accent);
  box-shadow: 0 18px 55px rgba(20, 124, 114, 0.16);
  animation: targetPulse 0.8s ease infinite alternate;
}

.widget.drop-target::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(20, 124, 114, 0.45);
  border-radius: 8px;
  pointer-events: none;
}

.widget.settled {
  animation: settleCard 0.5s var(--ease-out) both;
}

.widget-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  margin: 0;
  pointer-events: none;
  opacity: 0.94;
  box-shadow: 0 28px 80px rgba(25, 36, 47, 0.24);
  animation: pickUp 0.18s ease both;
  will-change: transform;
}

[data-theme="dark"] .widget-ghost {
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
}

.chart-bars {
  height: 132px;
  display: flex;
  align-items: end;
  gap: 8px;
}

.chart-bars span {
  flex: 1;
  min-width: 10px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--accent-3), var(--accent));
  transform-origin: bottom;
  animation: growBar 0.7s ease both;
}

.metric-list,
.event-list,
.integrations ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.metric-list li,
.event-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.18s ease, transform 0.18s ease;
}

.metric-list li:hover,
.event-list li:hover {
  transform: translateX(3px);
}

.metric-list li:last-child,
.event-list li:last-child {
  border-bottom: 0;
}

.pill {
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(45, 111, 183, 0.12);
  color: var(--accent-3);
  font-size: 12px;
  white-space: nowrap;
  animation: softPop 0.45s var(--ease-out) both;
}

.risk {
  color: var(--accent-2);
}

.split-meter {
  display: grid;
  gap: 11px;
}

.meter-row {
  display: grid;
  grid-template-columns: 92px 1fr 54px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left;
  animation: fillMeter 0.75s ease both;
}

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

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

.placeholder-grid article,
.settings-card,
.credentials-card,
.credentials-card article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.placeholder-grid article {
  padding: 18px;
  animation: fadeUp 0.35s var(--ease-out) both;
}

.placeholder-grid article:nth-child(2),
.integration-table article:nth-child(2),
.credentials-grid article:nth-child(2) {
  animation-delay: 0.06s;
}

.placeholder-grid article:nth-child(3),
.integration-table article:nth-child(3),
.credentials-grid article:nth-child(3) {
  animation-delay: 0.12s;
}

.placeholder-grid strong,
.placeholder-grid span {
  display: block;
}

.placeholder-grid span {
  margin-top: 7px;
  color: var(--muted);
}

.settings-card {
  max-width: 760px;
  margin-top: 18px;
  padding: 18px;
}

.credentials-card {
  margin-top: 14px;
  padding: 18px;
}

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

.credentials-card article {
  padding: 14px;
  background: var(--bg);
  box-shadow: none;
  animation: fadeUp 0.36s var(--ease-out) both;
}

.credentials-card strong,
.credentials-card span {
  display: block;
}

.credentials-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.integrations article {
  padding: 18px;
  animation: fadeUp 0.42s var(--ease-out) both;
}

.integrations p,
.integrations li {
  color: var(--muted);
  line-height: 1.55;
}

.integrations li {
  margin-top: 10px;
  padding-left: 16px;
  position: relative;
}

.integrations li::before {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  top: 9px;
  left: 0;
  border-radius: 999px;
  background: var(--accent);
}

.source-label {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  animation: softPop 0.42s var(--ease-out) both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px) rotateX(3deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

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

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes growBar {
  from {
    transform: scaleY(0.2);
    opacity: 0.45;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes fillMeter {
  from {
    transform: scaleX(0.15);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes tabFlow {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(72%);
  }
}

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

@keyframes gridShift {
  to {
    background-position: 42px 42px;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.82;
  }
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes floatSignal {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(18px, -22px, 0);
  }
}

@keyframes shimmer {
  55%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes softPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes targetPulse {
  from {
    box-shadow: 0 18px 55px rgba(20, 124, 114, 0.14);
  }
  to {
    box-shadow: 0 22px 66px rgba(20, 124, 114, 0.24);
  }
}

@keyframes pickUp {
  from {
    opacity: 0.72;
    scale: 0.98;
  }
  to {
    opacity: 0.94;
    scale: 1.02;
  }
}

@keyframes settleCard {
  0% {
    box-shadow: 0 18px 55px rgba(20, 124, 114, 0.18);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  33% {
    transform: translateX(-5px);
  }
  66% {
    transform: translateX(5px);
  }
}

@media (max-width: 1080px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 390px;
  }

  .visual-copy {
    max-width: 280px;
  }

  .preview-chart {
    height: 130px;
  }

  .signal-top {
    right: 5%;
  }

  .signal-bottom {
    left: 5%;
    bottom: 12%;
  }

  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list,
  #menuEditor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .status-strip,
  .placeholder-grid,
  .credentials-grid,
  .integration-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .widget,
  .widget.wide {
    grid-column: span 6;
  }
}

@media (max-width: 680px) {
  .login-shell {
    width: min(100% - 24px, 440px);
    min-height: auto;
  }

  .login-visual {
    display: none;
  }

  .login-page {
    overflow: auto;
    padding: 18px 0;
  }

  .login-panel {
    min-height: calc(100vh - 36px);
  }

  .app-shell {
    padding: 18px;
  }

  .topbar,
  .workspace-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .status-strip,
  .placeholder-grid,
  .credentials-grid,
  .integration-table,
  .nav-list,
  #menuEditor {
    grid-template-columns: 1fr;
  }

  .widget,
  .widget.wide {
    grid-column: span 12;
  }

  .meter-row {
    grid-template-columns: 74px 1fr 44px;
  }
}

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