:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --ink: #111a33;
  --ink-2: #26314d;
  --muted: #6f7a92;
  --muted-2: #97a1b5;
  --line: #e6eaf2;
  --line-strong: #d8deea;
  --brand: #4257e8;
  --brand-2: #6e5bf6;
  --brand-soft: #eef1ff;
  --cyan: #0aa5bd;
  --cyan-soft: #e7f8fb;
  --green: #0e9f6e;
  --green-soft: #e8f8f1;
  --amber: #c47a09;
  --amber-soft: #fff6e5;
  --red: #d64545;
  --red-soft: #fff0f0;
  --navy: #0a1128;
  --navy-2: #111b3e;
  --navy-line: rgba(255, 255, 255, 0.09);
  --navy-muted: #8f9bbd;
  --shadow-sm: 0 1px 2px rgba(17, 26, 51, 0.04), 0 8px 24px rgba(17, 26, 51, 0.035);
  --shadow-md: 0 16px 46px rgba(22, 35, 77, 0.11);
  --shadow-lg: 0 30px 90px rgba(10, 18, 45, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 252px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

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

img,
svg {
  display: block;
}

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

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

::selection {
  background: #c9d1ff;
  color: #101838;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  background: #cbd2e2;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #aeb8cf;
  background-clip: content-box;
}

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

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

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.boot-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  position: relative;
  box-shadow: 0 14px 30px rgba(66, 87, 232, 0.3);
  animation: boot-pulse 1.7s ease-in-out infinite;
}

.boot-mark span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: #fff;
  transform-origin: 50% 100%;
}

.boot-mark span:nth-child(1) {
  transform: translate(-50%, -100%) rotate(0deg);
}

.boot-mark span:nth-child(2) {
  transform: translate(-50%, -100%) rotate(120deg);
  opacity: 0.8;
}

.boot-mark span:nth-child(3) {
  transform: translate(-50%, -100%) rotate(240deg);
  opacity: 0.6;
}

@keyframes boot-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 14px 30px rgba(66, 87, 232, 0.3); }
  50% { transform: scale(1.06); box-shadow: 0 20px 38px rgba(66, 87, 232, 0.4); }
}

/* ---------- Authentication ---------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 1.04fr) minmax(440px, 0.96fr);
  background: #f8f9fd;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px 42px;
  color: #fff;
  background:
    radial-gradient(900px 560px at 12% 8%, rgba(90, 112, 255, 0.55), transparent 58%),
    radial-gradient(720px 540px at 94% 82%, rgba(23, 184, 203, 0.28), transparent 62%),
    linear-gradient(145deg, #0a1128 0%, #111c46 58%, #0c1734 100%);
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 88%);
  pointer-events: none;
}

.auth-visual::after {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  right: -280px;
  bottom: -310px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.032),
    0 0 0 150px rgba(255, 255, 255, 0.022),
    0 0 0 240px rgba(255, 255, 255, 0.014);
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #6076ff 0%, #4a5ee8 50%, #7a62ff 100%);
  box-shadow: 0 12px 26px rgba(61, 81, 225, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-tag {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.auth-copy {
  position: relative;
  z-index: 2;
  max-width: 540px;
  margin: 64px 0 auto;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.auth-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #55e6b8;
  box-shadow: 0 0 0 4px rgba(85, 230, 184, 0.13);
}

.auth-copy h1 {
  margin: 26px 0 18px;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.13;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.auth-copy h1 em {
  font-style: normal;
  color: #9facff;
}

.auth-copy p {
  max-width: 450px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  line-height: 1.85;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12.5px;
}

.auth-features span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.auth-features .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7b8cff;
}

.auth-window {
  position: relative;
  z-index: 2;
  width: min(470px, 100%);
  margin-top: 52px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.auth-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.auth-window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.auth-window-title .icon {
  width: 15px;
  height: 15px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6ee7c0;
  font-size: 10.5px;
  font-weight: 600;
}

.live-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #55e6b8;
  box-shadow: 0 0 0 4px rgba(85, 230, 184, 0.12);
}

.auth-release {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(7, 12, 31, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-release-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #b8c2ff;
  background: rgba(102, 122, 255, 0.2);
}

.auth-release-main {
  flex: 1;
  min-width: 0;
}

.auth-release-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.auth-release-sub {
  margin-top: 3px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.43);
}

.auth-release-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(85, 230, 184, 0.13);
  color: #6ee7c0;
  font-size: 9.5px;
  font-weight: 600;
}

.auth-progress {
  margin-top: 13px;
  padding: 12px 13px;
  border-radius: 13px;
  background: rgba(7, 12, 31, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
}

.auth-progress-track {
  height: 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.auth-progress-track span {
  display: block;
  height: 100%;
  width: 72%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6579ff, #55e6b8);
  box-shadow: 0 0 16px rgba(85, 230, 184, 0.4);
}

.auth-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.auth-metric {
  padding: 10px;
  border-radius: 11px;
  background: rgba(7, 12, 31, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.auth-metric b {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.auth-metric span {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.4);
}

.auth-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(600px 400px at 80% 0%, rgba(66, 87, 232, 0.055), transparent 70%),
    #fbfcff;
}

.auth-card {
  width: min(392px, 100%);
}

.auth-card-head {
  margin-bottom: 30px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  margin-bottom: 19px;
  border: 1px solid #dfe5f1;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}

.auth-pill .icon {
  width: 13px;
  height: 13px;
  color: var(--brand);
}

.auth-card h2 {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--ink);
}

.auth-card-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

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

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

.field > label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.field-hint {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 400;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > .icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  pointer-events: none;
}

.input-wrap .input {
  padding-left: 40px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  font-size: 13px;
}

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

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c3cce0;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(66, 87, 232, 0.1);
}

.textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.65;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f7a92' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 3px;
}

.form-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #f6d2d2;
  border-radius: 10px;
  background: var(--red-soft);
  color: #a52f2f;
  font-size: 11.5px;
  line-height: 1.55;
}

.form-error.is-visible {
  display: flex;
}

.form-error .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.auth-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--green);
}

.auth-footnote {
  margin-top: 26px;
  text-align: center;
  color: var(--muted-2);
  font-size: 10.5px;
}

.password-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 2px;
}

.password-meter span {
  height: 3px;
  border-radius: 4px;
  background: #e8ebf2;
  transition: background 0.2s;
}

.password-meter[data-strength="1"] span:nth-child(1) { background: var(--red); }
.password-meter[data-strength="2"] span:nth-child(-n+2) { background: var(--amber); }
.password-meter[data-strength="3"] span:nth-child(-n+3) { background: #4c8dd8; }
.password-meter[data-strength="4"] span { background: var(--green); }

/* ---------- Shell ---------- */

.shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 22px 16px 17px;
  color: #fff;
  background:
    radial-gradient(480px 260px at 10% 0%, rgba(74, 94, 232, 0.32), transparent 70%),
    linear-gradient(180deg, #0b1230 0%, #0a0f24 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 88px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 75%);
}

.sidebar-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
}

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

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

.sidebar-brand .brand-name {
  font-size: 16px;
  color: #fff;
}

.sidebar-brand .brand-tag {
  font-size: 8.5px;
  letter-spacing: 0.17em;
  color: var(--navy-muted);
}

.sidebar-section {
  position: relative;
  z-index: 1;
  padding: 8px 9px 7px;
  color: #596589;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 43px;
  padding: 0 12px;
  border-radius: 11px;
  color: #a9b3ce;
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav-link .icon {
  width: 18px;
  height: 18px;
  color: #7b88aa;
  transition: color 0.16s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
}

.nav-link:hover .icon {
  color: #c8d0e8;
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(86, 107, 255, 0.23), rgba(86, 107, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(122, 141, 255, 0.12);
}

.nav-link.active .icon {
  color: #97a7ff;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 0 4px 4px 0;
  background: #7c90ff;
  box-shadow: 0 0 12px rgba(124, 144, 255, 0.65);
  transform: translateY(-50%);
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(124, 144, 255, 0.14);
  color: #aeb9ff;
  font-size: 9px;
  font-weight: 700;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-card {
  position: relative;
  z-index: 1;
  margin: 15px 2px;
  padding: 14px;
  border: 1px solid var(--navy-line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  overflow: hidden;
}

.sidebar-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -34px;
  top: -40px;
  border-radius: 50%;
  background: rgba(96, 118, 255, 0.18);
  filter: blur(4px);
}

.sidebar-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c4cdef;
  font-size: 10.5px;
  font-weight: 600;
}

.sidebar-card-head .icon {
  width: 14px;
  height: 14px;
  color: #7d91ff;
}

.sidebar-card p {
  margin-top: 8px;
  color: #7784a5;
  font-size: 9.5px;
  line-height: 1.6;
}

.sidebar-card b {
  color: #fff;
  font-weight: 600;
}

.sidebar-user {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--navy-line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(145deg, #596fff, #7c63ff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-user-main {
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  overflow: hidden;
  color: #e8ecf8;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  color: #667393;
  font-size: 9px;
}

.sidebar-user .icon-btn {
  color: #6f7c9c;
}

.sidebar-user .icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-scrim {
  display: none;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 66px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(223, 229, 240, 0.86);
  background: rgba(248, 250, 254, 0.82);
  backdrop-filter: blur(16px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.topbar-title .crumb-current {
  overflow: hidden;
  color: var(--ink-2);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title .sep {
  color: #c5ccda;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.topbar-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-left: 3px;
  border-radius: 50%;
  background: linear-gradient(145deg, #edf0ff, #e4e8ff);
  color: var(--brand);
  border: 1px solid #dce2ff;
  font-size: 10.5px;
  font-weight: 700;
}

.menu-btn {
  display: none;
}

.page {
  max-width: 1460px;
  margin: 0 auto;
  padding: 30px 32px 52px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
}

.page-title {
  color: var(--ink);
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.page-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.page-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

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

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid rgba(66, 87, 232, 0.45);
  outline-offset: 2px;
}

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

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), #5d55ef);
  box-shadow: 0 7px 17px rgba(66, 87, 232, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #354bdd, #534be4);
  box-shadow: 0 9px 22px rgba(66, 87, 232, 0.28);
}

.btn-secondary {
  color: var(--ink-2);
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 26, 51, 0.03);
}

.btn-secondary:hover {
  border-color: #c2cbe0;
  background: #fbfcff;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(17, 26, 51, 0.045);
}

.btn-soft {
  color: var(--brand);
  border-color: #dfe4ff;
  background: var(--brand-soft);
}

.btn-soft:hover {
  background: #e5e9ff;
}

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

.btn-danger:hover {
  background: var(--red-soft);
}

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

.btn-danger-solid:hover {
  background: #c53838;
}

.btn-sm {
  min-height: 31px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10.5px;
}

.btn-sm .icon {
  width: 14px;
  height: 14px;
}

.btn-lg {
  min-height: 44px;
  padding: 11px 18px;
  font-size: 13px;
}

.btn:disabled,
.btn.is-loading {
  cursor: default;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.btn.is-loading::after {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: background 0.16s, color 0.16s;
}

.icon-btn:hover {
  color: var(--ink);
  background: rgba(17, 26, 51, 0.055);
}

.icon-btn.danger:hover {
  color: var(--red);
  background: var(--red-soft);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

/* ---------- Cards and stats ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.card-body {
  padding: 20px 22px 22px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.card-link:hover {
  color: var(--brand);
}

.card-link .icon {
  width: 13px;
  height: 13px;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #dce2ef;
  box-shadow: 0 14px 32px rgba(22, 35, 77, 0.075);
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  right: -42px;
  top: -48px;
  border-radius: 50%;
  background: var(--stat-tint, #eef1ff);
  opacity: 0.7;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--stat-color, var(--brand));
  background: var(--stat-tint, var(--brand-soft));
}

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

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

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.stat-value {
  color: var(--ink);
  font-size: 29px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  color: var(--muted-2);
  font-size: 10.5px;
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 9.8px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trend .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.trend.up {
  color: var(--green);
  background: var(--green-soft);
}

.trend.down {
  color: var(--red);
  background: var(--red-soft);
}

.trend.flat {
  color: var(--muted);
  background: #f2f4f8;
}

/* ---------- Overview ---------- */

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.chart-card {
  min-width: 0;
}

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

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.8px;
  font-weight: 500;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--legend-color, var(--brand));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--legend-color, var(--brand)) 13%, transparent);
}

.chart-wrap {
  position: relative;
  height: 286px;
  margin-top: 18px;
  padding: 0 4px;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 138px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(12, 20, 44, 0.94);
  box-shadow: 0 12px 30px rgba(6, 12, 30, 0.28);
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity 0.12s ease;
  backdrop-filter: blur(8px);
}

.chart-tooltip.is-visible {
  opacity: 1;
}

.chart-tooltip-date {
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #a9b4d0;
  font-size: 9.5px;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
  font-size: 10px;
  color: #c8d0e5;
}

.chart-tooltip-row b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  pointer-events: none;
}

.chart-empty .icon {
  width: 26px;
  height: 26px;
  color: #c1c9da;
}

.donut-card {
  display: flex;
  flex-direction: column;
}

.donut-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.donut {
  position: relative;
  width: 154px;
  height: 154px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#e8ecf6 0 100%);
  box-shadow: inset 0 0 0 1px rgba(17, 26, 51, 0.02);
}

.donut::before {
  content: "";
  position: absolute;
  inset: 19px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(17, 26, 51, 0.03);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center b {
  display: block;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.donut-center span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.donut-legend {
  width: 100%;
  display: grid;
  gap: 7px;
  margin-top: 22px;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.donut-legend-row .legend-dot {
  width: 6px;
  height: 6px;
}

.donut-legend-row b {
  margin-left: auto;
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.donut-legend-row span:last-child {
  width: 31px;
  text-align: right;
  color: var(--muted-2);
  font-size: 9px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.activity-list {
  display: grid;
  gap: 1px;
  padding: 5px 22px 14px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f2f7;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--activity-color, var(--brand));
  background: var(--activity-tint, var(--brand-soft));
}

.activity-icon .icon {
  width: 14px;
  height: 14px;
}

.activity-main {
  min-width: 0;
  flex: 1;
}

.activity-text {
  color: var(--ink-2);
  font-size: 10.8px;
  line-height: 1.55;
}

.activity-text b {
  font-weight: 650;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.activity-time {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 8.8px;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overview-grid,
  .bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .donut-body {
    flex-direction: row;
    gap: 36px;
  }
  .donut-legend {
    margin-top: 0;
    max-width: 300px;
  }
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-panel {
    min-height: 100vh;
    padding: 28px;
  }
}

@media (max-width: 600px) {
  .auth-panel {
    padding: 22px;
  }
  .auth-card h2 {
    font-size: 26px;
  }
  .auth-card-head {
    margin-bottom: 24px;
  }
}

/* ---------- Typography helpers ---------- */

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  font-size: 0.94em;
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-xs > * + * { margin-top: 6px; }
.stack-sm > * + * { margin-top: 10px; }
.stack-md > * + * { margin-top: 18px; }

/* ---------- Tables ---------- */

.table-card {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  white-space: nowrap;
}

.table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f3f8;
  color: var(--ink-2);
  font-size: 11px;
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.12s ease;
}

.table tbody tr:hover {
  background: #fafbfe;
}

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

.table .col-right {
  text-align: right;
}

.table .col-center {
  text-align: center;
}

.table .num {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.table .strong {
  color: var(--ink);
  font-weight: 600;
}

.table .muted-cell {
  color: var(--muted);
}

.table .cell-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.table .actions-cell {
  text-align: right;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}

.table th.col-actions,
.table td.col-actions {
  text-align: right;
}

.table th.col-actions {
  padding-right: 16px;
}

.empty-table {
  padding: 46px 20px !important;
  text-align: center !important;
  color: var(--muted) !important;
}

.version-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

button.version-cell {
  cursor: pointer;
}

button.version-cell:hover .version-name {
  color: var(--brand);
}

.version-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: #f2f4fb;
  color: #697896;
}

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

.version-name {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.version-code {
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
}

.app-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.app-cell-text {
  min-width: 0;
}

.app-cell-name {
  overflow: hidden;
  max-width: 190px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
}

.app-cell-sub {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.7px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.5;
}

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

.status-published {
  color: #087a56;
  background: var(--green-soft);
}

.status-draft {
  color: #6f7a92;
  background: #f1f3f8;
}

.status-paused {
  color: #a56408;
  background: var(--amber-soft);
}

.status-failed {
  color: var(--red);
  background: var(--red-soft);
}

.status-active {
  color: #087a56;
  background: var(--green-soft);
}

.status-idle {
  color: var(--muted);
  background: #f1f3f8;
}

.channel-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid #e1e6f1;
  border-radius: 6px;
  background: #fff;
  color: #5c6982;
  font-family: var(--mono);
  font-size: 8.7px;
  line-height: 1.6;
}

.rollout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.rollout-track {
  width: 44px;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #eef1f7;
}

.rollout-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #7184ff);
}

.rollout b {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9.5px;
}

.table-scroll-hint {
  display: none;
}

/* ---------- Apps ---------- */

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 230px;
  max-width: 340px;
  flex: 1;
}

.search-box .icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-box .input {
  min-height: 37px;
  padding-left: 36px;
  font-size: 11.5px;
}

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

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 244px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -90px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 87, 232, 0.08), transparent 68%);
  pointer-events: none;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: #d8dff0;
  box-shadow: 0 18px 40px rgba(22, 35, 77, 0.09);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(145deg, #eef1ff, #e6eaff);
  color: var(--brand);
  font-size: 17px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(66, 87, 232, 0.08);
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon-sm {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  font-size: 11px;
}

.app-icon-lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 23px;
}

.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid #e5e9f2;
  border-radius: 999px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-card h3 {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-package {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-desc {
  display: -webkit-box;
  min-height: 31px;
  margin-top: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: auto;
  padding-top: 18px;
}

.app-mini-stat {
  padding: 8px 9px;
  border-radius: 9px;
  background: #f8fafe;
  border: 1px solid #f0f2f8;
}

.app-mini-stat b {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.app-mini-stat span {
  color: var(--muted-2);
  font-size: 8px;
}

.app-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f7;
  color: var(--muted-2);
  font-size: 8.8px;
}

.app-card-foot b {
  color: var(--ink-2);
  font-weight: 600;
}

.app-card-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #f4f6fb;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.app-card:hover .app-card-arrow {
  background: var(--brand);
  color: #fff;
}

.app-card-arrow .icon {
  width: 12px;
  height: 12px;
}

/* ---------- App detail ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.back-link:hover {
  color: var(--brand);
}

.back-link .icon {
  width: 14px;
  height: 14px;
}

.app-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(400px 220px at 96% 10%, rgba(66, 87, 232, 0.08), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.app-hero-main {
  min-width: 0;
  flex: 1;
}

.app-hero-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.app-hero h1 {
  color: var(--ink);
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.app-hero-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 13px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.app-hero-sub .mono {
  color: var(--muted);
}

.app-hero-desc {
  max-width: 640px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.app-hero-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.app-key-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #e4e8f2;
  border-radius: 6px;
  background: #fbfcfe;
  color: #67748e;
  font-family: var(--mono);
  font-size: 8.5px;
}

.app-key-inline button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
}

.app-key-inline button:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.app-key-inline .icon {
  width: 11px;
  height: 11px;
}

.app-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 17px;
}

.app-stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.app-stat span {
  display: block;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.app-stat b {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.app-stat small {
  color: var(--muted-2);
  font-size: 8.5px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 17px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fd;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 7px rgba(17, 26, 51, 0.08);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 16px;
  padding: 0 4px;
  border-radius: 5px;
  background: #eef1f7;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.tab.active .tab-count {
  background: var(--brand-soft);
  color: var(--brand);
}

.tab-panel {
  animation: fade-up 0.24s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.filter-chip {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.filter-chip:hover {
  color: var(--ink);
  background: #f4f6fb;
}

.filter-chip.active {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 26, 51, 0.04);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ---------- Integration ---------- */

.integration-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.integration-card {
  padding: 22px;
}

.integration-card h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.integration-card > p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.endpoint-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #e8ebf3;
  border-radius: 9px;
  background: #f8fafe;
}

.endpoint-box code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #4f5e7c;
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-steps {
  display: grid;
  gap: 17px;
  margin-top: 22px;
}

.step {
  display: flex;
  gap: 12px;
}

.step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid #dde4f5;
  border-radius: 8px;
  background: #f7f9ff;
  color: var(--brand);
  font-size: 9px;
  font-weight: 700;
}

.step-body {
  min-width: 0;
  flex: 1;
}

.step-body h4 {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
}

.step-body p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.code-block {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #1f2a4a;
  border-radius: 11px;
  background: #0e1630;
}

.code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #7f8db0;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.code-head .window-dots {
  display: flex;
  gap: 4px;
}

.code-head .window-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3a4768;
}

.code-head .code-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #7f8db0;
  font-size: 8.5px;
}

.code-head .code-copy:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.code-head .code-copy .icon {
  width: 11px;
  height: 11px;
}

.code-block pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  color: #c3cee9;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.7;
}

.code-tabs {
  display: flex;
  gap: 2px;
  margin-top: 14px;
}

.code-tab {
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}

.code-tab.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.aside-note {
  padding: 18px;
  border: 1px solid #e3e8f4;
  border-radius: 14px;
  background:
    linear-gradient(150deg, rgba(66, 87, 232, 0.045), transparent 60%),
    #fbfcff;
}

.aside-note h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
}

.aside-note h4 .icon {
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.aside-note ul {
  display: grid;
  gap: 9px;
  margin-top: 11px;
}

.aside-note li {
  position: relative;
  padding-left: 13px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.aside-note li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #aab6d2;
}

/* ---------- Settings / forms ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.settings-card {
  padding: 22px;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 19px;
}

.settings-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.settings-icon .icon {
  width: 17px;
  height: 17px;
}

.settings-card-head h3 {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.settings-card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.8px;
}

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

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand), #7b64ff);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 9px 22px rgba(66, 87, 232, 0.2);
}

.profile-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.profile-meta {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.kv-list {
  display: grid;
  gap: 0;
}

.kv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f3f8;
  font-size: 10px;
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row .k {
  color: var(--muted);
}

.kv-row .v {
  max-width: 65%;
  color: var(--ink-2);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.kv-row .v.mono {
  font-size: 9px;
}

.storage-bar {
  height: 6px;
  margin: 8px 0 7px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf0f7;
}

.storage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #6a7dff);
}

.storage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted-2);
  font-size: 8.8px;
}

.storage-legend b {
  color: var(--ink-2);
  font-weight: 600;
}

.danger-zone {
  padding: 22px;
  border: 1px solid #f0dada;
  border-radius: var(--radius);
  background: #fffafa;
}

.danger-zone h3 {
  color: #9f3232;
  font-size: 13px;
  font-weight: 650;
}

.danger-zone p {
  margin-top: 5px;
  color: #9d6666;
  font-size: 10px;
  line-height: 1.65;
}

.danger-zone .btn {
  margin-top: 14px;
}

.help-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 600;
}

.help-link .icon {
  width: 12px;
  height: 12px;
}

/* ---------- Empty / skeleton / misc ---------- */

.empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 47px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafe;
  color: #a8b3c9;
}

.empty-icon .icon {
  width: 21px;
  height: 21px;
}

.empty h3 {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
}

.empty p {
  max-width: 330px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.empty .btn {
  margin-top: 11px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: #e9edf5;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.25s infinite;
}

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

.skeleton-title {
  width: 180px;
  height: 22px;
  margin-bottom: 9px;
}

.skeleton-sub {
  width: 290px;
  height: 11px;
}

.skeleton-card {
  height: 108px;
  border-radius: 16px;
}

.skeleton-chart {
  height: 360px;
  margin-top: 18px;
  border-radius: 18px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid #dfe4f0;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-panel {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 300px;
  color: var(--muted);
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-btn {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 27px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}

.page-btn:hover:not(:disabled) {
  border-color: #ced6e6;
  color: var(--ink);
}

.page-btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.page-btn:disabled {
  cursor: default;
  opacity: 0.4;
}

/* ---------- Modal ---------- */

.modal {
  width: min(590px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(6, 12, 29, 0.58);
  backdrop-filter: blur(4px);
}

.modal-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 900px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 19px;
  background: #fff;
}

#modal-content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.modal-shell > form,
#modal-content > form {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.modal-wide {
  width: min(760px, calc(100vw - 32px));
}

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #f0f2f7;
}

.modal-head-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
}

.modal-head-icon .icon {
  width: 18px;
  height: 18px;
}

.modal-head-main {
  min-width: 0;
  flex: 1;
}

.modal-title {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.modal-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -3px -7px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
}

.modal-close:hover {
  color: var(--ink);
  background: #f4f6fa;
}

.modal-close .icon {
  width: 16px;
  height: 16px;
}

.modal-body {
  min-height: 0;
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 20px;
  border-top: 1px solid #f0f2f7;
  background: #fff;
}

.modal-footer .left {
  margin-right: auto;
}

.modal .form-grid {
  gap: 13px;
}

.modal .form-error {
  margin-top: 14px;
}

.modal-note {
  padding: 10px 12px;
  border: 1px solid #e8ecf6;
  border-radius: 9px;
  background: #f9fafe;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.modal-note b {
  color: var(--ink-2);
}

.confirm-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.confirm-copy strong {
  color: var(--ink);
}

.danger-callout {
  display: flex;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #f4dada;
  border-radius: 10px;
  background: var(--red-soft);
  color: #9c3c3c;
  font-size: 9.5px;
  line-height: 1.6;
}

.danger-callout .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

/* ---------- Upload ---------- */

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 122px;
  padding: 18px;
  border: 1.5px dashed #cfd7e8;
  border-radius: 13px;
  background: #fafbff;
  text-align: center;
  transition: border-color 0.16s, background 0.16s;
}

.modal .dropzone {
  min-height: 100px;
  padding: 13px 16px;
}

.modal .textarea {
  min-height: 88px;
}

.dropzone > div {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #9eabf5;
  background: #f6f8ff;
}

.dropzone.is-selected {
  border-style: solid;
  border-color: #b9d9cc;
  background: #f7fcf9;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 10px;
  background: #eef1ff;
  color: var(--brand);
}

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

.dropzone strong {
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
}

.dropzone small {
  color: var(--muted-2);
  font-size: 9px;
}

.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-input {
  display: none;
}

.file-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.file-selected .file-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
}

.file-selected .file-icon .icon {
  width: 17px;
  height: 17px;
}

.file-selected-main {
  min-width: 0;
  flex: 1;
}

.file-selected-name {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-selected-meta {
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.8px;
}

.file-remove {
  flex: 0 0 auto;
}

.upload-progress {
  display: none;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e5e9f5;
  border-radius: 10px;
  background: #fafbff;
}

.upload-progress.is-visible {
  display: block;
}

.upload-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.upload-progress-head b {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 8px;
  background: #e9edf5;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #6d80ff);
  transition: width 0.18s ease;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 32px;
  height: 18px;
  margin-top: 1px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #dbe1ed;
  transition: background 0.18s;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 26, 51, 0.2);
  transition: transform 0.18s;
}

.switch input:checked + span {
  background: var(--brand);
}

.switch input:checked + span::after {
  transform: translateX(14px);
}

.switch-copy {
  min-width: 0;
  flex: 1;
}

.switch-copy b {
  display: block;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
}

.switch-copy small {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.5;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 230px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(13, 21, 45, 0.95);
  box-shadow: 0 14px 36px rgba(5, 11, 28, 0.26);
  color: #eef1fb;
  font-size: 10.5px;
  line-height: 1.55;
  pointer-events: auto;
  animation: toast-in 0.25s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  backdrop-filter: blur(10px);
}

.toast.is-out {
  animation: toast-out 0.2s ease both;
}

.toast .toast-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #8b9cff;
}

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

.toast.success .toast-icon {
  color: #76e4ba;
}

.toast.error .toast-icon {
  color: #ff9c9c;
}

.toast.warning .toast-icon {
  color: #ffd27c;
}

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

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

/* ---------- Code / detail lists ---------- */

.release-notes {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}

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

.detail-item {
  padding: 10px 12px;
  border: 1px solid #eef1f7;
  border-radius: 9px;
  background: #fbfcfe;
}

.detail-item span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-item b {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  word-break: break-all;
}

.detail-item b.mono {
  font-size: 8.8px;
  line-height: 1.5;
}

.modal-section + .modal-section {
  margin-top: 16px;
}

.modal-section-title {
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 650;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .integration-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1020px) {
  :root {
    --sidebar-w: 232px;
  }
  .topbar {
    padding: 0 22px;
  }
  .page {
    padding: 25px 22px 44px;
  }
  .app-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-104%);
    transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.3, 1);
    box-shadow: 24px 0 60px rgba(3, 8, 22, 0.25);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-scrim {
    display: block;
    position: fixed;
    z-index: 45;
    inset: 0;
    background: rgba(5, 10, 24, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(2px);
  }
  body.nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .main {
    margin-left: 0;
  }
  .menu-btn {
    display: inline-grid;
  }
  .topbar-title {
    display: none;
  }
  .topbar {
    height: 60px;
    padding: 0 16px;
  }
  .topbar-actions .btn-ghost {
    display: none;
  }
  .page {
    padding: 20px 16px 38px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
  }
  .page-title {
    font-size: 24px;
  }
  .page-head-actions {
    width: 100%;
  }
  .page-head-actions .btn {
    flex: 1;
  }
  .donut-body {
    flex-direction: column;
    gap: 18px;
  }
  .donut-legend {
    width: 100%;
    max-width: none;
  }
  .app-hero {
    flex-wrap: wrap;
    padding: 19px;
  }
  .app-hero-actions {
    width: 100%;
  }
  .app-hero-actions .btn {
    flex: 1;
  }
  .app-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .detail-list {
    grid-template-columns: 1fr;
  }
  .modal {
    width: calc(100vw - 20px);
    max-height: 92vh;
  }
  .modal-shell {
    max-height: 92vh;
  }
  .modal-head,
  .modal-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 15px;
  }
  .stat-value {
    font-size: 24px;
  }
  .stat-label {
    font-size: 9.5px;
  }
  .stat-foot {
    margin-top: 10px;
    font-size: 9px;
  }
  .app-stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .card-head {
    padding: 17px 17px 0;
  }
  .card-body {
    padding: 17px;
  }
  .activity-list {
    padding-left: 17px;
    padding-right: 17px;
  }
  .table th,
  .table td {
    padding-left: 13px;
    padding-right: 13px;
  }
  .toasts {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast {
    max-width: none;
  }
  .tabs {
    width: 100%;
  }
  .tab {
    flex: 1;
    justify-content: center;
  }
  .app-key-inline {
    max-width: 100%;
  }
  .topbar-actions .btn-primary span {
    display: none;
  }
}

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