:root {
  --bg: #edf2ea;
  --surface: rgba(253, 251, 246, 0.86);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.64);
  --sidebar: #17202b;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --ink: #14202c;
  --muted: #667182;
  --line: rgba(20, 32, 44, 0.1);
  --line-strong: rgba(20, 32, 44, 0.18);
  --accent: #ff7a45;
  --accent-2: #1f73ff;
  --accent-3: #17a673;
  --warn: #f2a100;
  --danger: #ef4b4c;
  --shadow: 0 24px 60px rgba(20, 32, 44, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 122, 69, 0.22), transparent 26%),
    radial-gradient(circle at 82% 14%, rgba(31, 115, 255, 0.18), transparent 20%),
    linear-gradient(180deg, #fbf8f1 0%, #edf2ea 46%, #e7ece6 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 32, 44, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 44, 0.04) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 92%);
  opacity: 0.55;
}

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

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

button {
  cursor: pointer;
}

img {
  display: block;
}

.app-root {
  position: relative;
  z-index: 1;
}

.auth-shell {
  width: min(1240px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 20px;
}

.auth-stage,
.auth-panel,
.app-shell,
.metric-card,
.surface-card,
.timeline-card,
.list-card,
.detail-card,
.modal-card,
.toast,
.empty-card {
  border: 1px solid rgba(20, 32, 44, 0.08);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.auth-stage,
.auth-panel,
.app-shell {
  border-radius: 34px;
}

.auth-stage {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.auth-stage::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 122, 69, 0.95), transparent 42%),
    radial-gradient(circle at 72% 74%, rgba(31, 115, 255, 0.85), transparent 34%);
  opacity: 0.34;
  filter: blur(12px);
}

.auth-brand,
.sidebar-brand,
.topbar-section,
.metric-label,
.section-label,
.badge,
.table-kicker,
.chip,
.nav-item span:last-child,
.mini-note,
.footer-note {
  font-family: "SF Mono", "SFMono-Regular", "Menlo", "Monaco", monospace;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

.auth-brand strong {
  font-size: 0.98rem;
  letter-spacing: 0.06em;
}

.auth-brand small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.auth-headline {
  margin: 44px 0 0;
  max-width: 14ch;
}

.auth-headline p,
.auth-copy,
.metric-card p,
.surface-card p,
.detail-card p,
.modal-card p,
.empty-card p,
.table td,
.timeline-card p,
.helper-copy,
.auth-panel p,
.list-card li {
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow,
.section-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-2);
}

.auth-headline h1,
.auth-panel h2,
.dashboard-hero h1,
.page-header h2,
.modal-card h3,
.detail-card h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.auth-headline h1 {
  margin-top: 18px;
  font-size: clamp(4rem, 9vw, 7.2rem);
  line-height: 0.92;
}

.auth-copy {
  margin: 22px 0 0;
  max-width: 58ch;
  font-size: 1.02rem;
}

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

.metric-card {
  padding: 18px;
  border-radius: 22px;
}

.metric-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
}

.metric-card p {
  margin: 10px 0 0;
}

.auth-features {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.surface-card {
  padding: 22px;
  border-radius: 22px;
}

.surface-card h3,
.timeline-card h3,
.list-card h3 {
  margin: 14px 0 10px;
  letter-spacing: -0.03em;
}

.feature-list,
.detail-list,
.modal-checklist,
.summary-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.feature-list li,
.detail-list li,
.summary-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feature-list li::before,
.detail-list li::before,
.summary-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex: 0 0 auto;
}

.auth-panel {
  display: flex;
  align-items: stretch;
  padding: 18px;
}

.auth-panel-card {
  width: 100%;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 247, 242, 0.92));
  border: 1px solid rgba(20, 32, 44, 0.08);
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.auth-panel h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
}

.helper-copy {
  margin: 0;
}

body[data-view="auth"] {
  background: linear-gradient(135deg, #eef4ff 0%, #dce8ff 100%);
}

body[data-view="auth"]::before {
  background: none;
  opacity: 1;
}

body[data-view="auth"] .auth-shell {
  width: min(1400px, calc(100vw - 40px));
  min-height: calc(100vh - 40px);
  margin: 20px auto;
  padding: 0;
  position: relative;
  align-items: center;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: 0;
}

body[data-view="auth"] .auth-shell::before,
body[data-view="auth"] .auth-shell::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

body[data-view="auth"] .auth-shell::before {
  left: -180px;
  top: -110px;
  width: 620px;
  height: 320px;
  border-radius: 0 0 120px 0;
  background: linear-gradient(135deg, rgba(17, 71, 212, 1), rgba(54, 111, 235, 0.88));
  transform: rotate(-8deg);
  box-shadow: inset -40px -40px 0 rgba(255, 255, 255, 0.06);
}

body[data-view="auth"] .auth-shell::after {
  right: -90px;
  bottom: -110px;
  width: 420px;
  height: 220px;
  border-radius: 120px 120px 0 0;
  background: linear-gradient(180deg, rgba(24, 84, 229, 0.95), rgba(31, 115, 255, 0.88));
}

body[data-view="auth"] .auth-stage,
body[data-view="auth"] .auth-panel {
  position: relative;
  z-index: 1;
  min-height: 760px;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

body[data-view="auth"] .auth-stage {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 36px 34px 34px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(46, 105, 230, 0.98), rgba(39, 90, 215, 0.96));
  border-radius: 40px 0 0 40px;
}

body[data-view="auth"] .auth-stage::before {
  content: "";
  position: absolute;
  right: -40px;
  top: 72px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(20, 66, 184, 0.32), transparent 62%);
}

body[data-view="auth"] .auth-stage::after {
  content: "";
  position: absolute;
  left: -80px;
  bottom: -70px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(18, 54, 156, 0.28), transparent 66%);
}

body[data-view="auth"] .auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 32px;
  background: #ffffff;
  border-radius: 0 40px 40px 0;
}

body[data-view="auth"] .auth-login-card {
  width: min(460px, 100%);
  padding: 26px 20px;
  background: transparent;
  border: 0;
  box-shadow: none;
  align-content: center;
  justify-items: stretch;
  gap: 18px;
}

body[data-view="auth"] .auth-stage-copy {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

body[data-view="auth"] .auth-brand-light {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

body[data-view="auth"] .auth-brand-light small,
body[data-view="auth"] .auth-stage-list,
body[data-view="auth"] .auth-copy {
  color: rgba(255, 255, 255, 0.82);
}

body[data-view="auth"] .auth-headline {
  margin: 32px 0 0;
  max-width: 18ch;
}

body[data-view="auth"] .auth-eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

body[data-view="auth"] .auth-headline h1 {
  margin-top: 14px;
  color: #ffffff;
  font-size: clamp(3rem, 5vw, 4.9rem);
  line-height: 1.06;
}

body[data-view="auth"] .auth-copy {
  margin-top: 18px;
  max-width: 40ch;
  font-size: 1rem;
}

body[data-view="auth"] .auth-stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

body[data-view="auth"] .auth-stage-pill {
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
}

body[data-view="auth"] .auth-stage-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

body[data-view="auth"] .auth-stage-list li {
  position: relative;
  padding-left: 20px;
  line-height: 1.7;
}

body[data-view="auth"] .auth-stage-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #7be7ff;
}

body[data-view="auth"] .auth-scene {
  position: relative;
  min-height: 420px;
  margin-top: 26px;
}

body[data-view="auth"] .auth-scene-orbit,
body[data-view="auth"] .auth-scene-ring {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
}

body[data-view="auth"] .auth-scene-orbit-back {
  bottom: 24px;
  width: 510px;
  height: 250px;
  background:
    radial-gradient(circle at 50% 25%, rgba(82, 182, 255, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(83, 122, 255, 0.08), rgba(111, 235, 255, 0.22));
  border: 1px solid rgba(181, 239, 255, 0.16);
}

body[data-view="auth"] .auth-scene-orbit-front {
  bottom: 10px;
  width: 420px;
  height: 112px;
  background: linear-gradient(180deg, rgba(178, 244, 255, 0.96), rgba(129, 228, 255, 0.72));
}

body[data-view="auth"] .auth-scene-ring {
  bottom: 68px;
  width: 376px;
  height: 168px;
  border: 18px solid rgba(178, 255, 255, 0.9);
  border-right-color: rgba(110, 246, 255, 0.45);
  border-bottom-color: rgba(169, 238, 255, 0.52);
  box-shadow: inset 0 0 0 20px rgba(71, 136, 255, 0.12);
}

body[data-view="auth"] .auth-scene-screen {
  position: absolute;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(37, 88, 237, 0.95), rgba(75, 135, 250, 0.72));
  border: 1px solid rgba(149, 221, 255, 0.18);
  box-shadow: 0 24px 48px rgba(25, 53, 135, 0.2);
}

body[data-view="auth"] .auth-scene-screen-left {
  left: 112px;
  bottom: 82px;
  width: 150px;
  height: 180px;
  transform: skewY(-12deg);
}

body[data-view="auth"] .auth-scene-screen-top {
  left: 214px;
  bottom: 182px;
  width: 116px;
  height: 86px;
  border-radius: 22px;
}

body[data-view="auth"] .auth-scene-screen-right {
  right: 126px;
  bottom: 102px;
  width: 102px;
  height: 150px;
  transform: skewY(12deg);
}

body[data-view="auth"] .auth-scene-person {
  position: absolute;
  background: #ffffff;
  border-radius: 999px 999px 18px 18px;
}

body[data-view="auth"] .auth-scene-person::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  border-radius: 999px;
  background: #ffd0c0;
}

body[data-view="auth"] .auth-scene-person::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -34px;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
  transform: skewX(-14deg);
  opacity: 0.8;
}

body[data-view="auth"] .auth-scene-person-top {
  left: 308px;
  bottom: 150px;
  width: 28px;
  height: 88px;
  color: #203675;
}

body[data-view="auth"] .auth-scene-person-bottom {
  left: 206px;
  bottom: 18px;
  width: 24px;
  height: 82px;
  color: #1cb5d8;
}

body[data-view="auth"] .auth-scene-node {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  border: 4px solid rgba(28, 44, 109, 0.72);
  background: rgba(255, 255, 255, 0.16);
}

body[data-view="auth"] .auth-scene-node::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(104, 229, 255, 1), rgba(55, 124, 255, 0.85));
}

body[data-view="auth"] .auth-scene-node-left {
  left: 116px;
  bottom: 224px;
}

body[data-view="auth"] .auth-scene-node-right {
  right: 144px;
  bottom: 72px;
}

body[data-view="auth"] .auth-scene-node-center {
  left: 184px;
  bottom: 28px;
}

body[data-view="auth"] .auth-scene-tag {
  position: absolute;
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  font-size: 0.84rem;
}

body[data-view="auth"] .auth-scene-tag-left {
  left: 88px;
  bottom: 304px;
}

body[data-view="auth"] .auth-scene-tag-top {
  right: 158px;
  bottom: 288px;
}

body[data-view="auth"] .auth-scene-tag-right {
  right: 92px;
  bottom: 38px;
}

body[data-view="auth"] .auth-panel-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: left;
  margin-top: 8px;
}

body[data-view="auth"] .auth-panel-brand strong {
  display: block;
  font-size: clamp(2.3rem, 4vw, 3.2rem);
  color: #2a84f5;
  letter-spacing: -0.05em;
}

body[data-view="auth"] .auth-panel-brand span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

body[data-view="auth"] .auth-tabline {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

body[data-view="auth"] .auth-tab {
  position: relative;
  color: #2a84f5;
  font-size: 1.24rem;
}

body[data-view="auth"] .auth-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 3px;
  border-radius: 999px;
  background: #2a84f5;
}

body[data-view="auth"] .auth-helper-copy {
  margin-top: 18px;
  text-align: center;
  color: #7d8ba2;
}

body[data-view="auth"] .auth-sso-button {
  min-height: 56px;
  margin-top: 10px;
  font-size: 1.06rem;
  background: linear-gradient(180deg, #2f8ef6, #2584f1);
  box-shadow: 0 12px 24px rgba(42, 132, 245, 0.2);
}

body[data-view="auth"] .auth-demo-grid {
  gap: 10px;
}

body[data-view="auth"] .demo-button {
  padding: 14px 16px;
  background: #f5f8ff;
  border-color: #dbe6fb;
  text-align: left;
}

body[data-view="auth"] .demo-button strong {
  color: #2f3b52;
}

body[data-view="auth"] .demo-button span {
  color: #7d8ba2;
}

body[data-view="auth"] .auth-manual-card,
body[data-view="auth"] .auth-seed-card {
  padding: 18px;
  border-radius: 20px;
  background: #f8fbff;
  border: 1px solid #e4ecfa;
}

body[data-view="auth"] .auth-form-grid {
  margin-top: 12px;
}

body[data-view="auth"] .auth-manual-button {
  width: 100%;
  min-height: 46px;
  background: #ffffff;
  border-color: #cdd9ef;
}

body[data-view="auth"] .auth-divider {
  margin-top: 4px;
  color: #8ea0bb;
}

.demo-grid {
  display: grid;
  gap: 12px;
}

.demo-button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.nav-item,
.stat-pill,
.switcher,
.chip {
  border-radius: 16px;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.demo-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.nav-item:hover,
.switcher:hover,
.chip:hover {
  transform: translateY(-1px);
}

.demo-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(20, 32, 44, 0.08);
}

.demo-button strong {
  display: block;
  text-align: left;
}

.demo-button span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

.field label,
.filter-field label {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.filter-field input,
.filter-field select {
  width: 100%;
  border: 1px solid rgba(20, 32, 44, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  border-radius: 14px;
  min-height: 46px;
  padding: 0 14px;
  outline: none;
}

.field textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-field input:focus,
.filter-field select:focus {
  border-color: rgba(31, 115, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(31, 115, 255, 0.08);
}

.button-row,
.filter-actions,
.topbar-actions,
.table-actions,
.modal-actions,
.detail-actions,
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.switcher,
.stat-pill {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button {
  background: linear-gradient(135deg, var(--ink), #2a3746);
  color: #fff;
  box-shadow: 0 16px 30px rgba(20, 32, 44, 0.2);
}

.secondary-button {
  background: linear-gradient(135deg, var(--accent-2), #5c96ff);
  color: #fff;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(20, 32, 44, 0.08);
  color: var(--ink);
}

.danger-button {
  background: rgba(239, 75, 76, 0.08);
  color: var(--danger);
  border-color: rgba(239, 75, 76, 0.14);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(20, 32, 44, 0.08);
}

.app-shell {
  width: min(1440px, calc(100vw - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 12px;
}

.sidebar {
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(23, 32, 43, 0.98), rgba(19, 29, 40, 0.92));
  color: rgba(255, 255, 255, 0.92);
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sidebar-line);
}

.sidebar-brand strong {
  display: block;
  font-size: 0.96rem;
  letter-spacing: 0.08em;
}

.sidebar-brand small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
}

.nav-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  border: 1px solid transparent;
}

.nav-item.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--sidebar-line);
  color: #fff;
}

.nav-badge {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sidebar-line);
}

.sidebar-footer p {
  color: rgba(255, 255, 255, 0.62);
  margin: 10px 0 0;
  line-height: 1.7;
}

.main-area {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(20, 32, 44, 0.08);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.36rem;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-actions {
  align-items: center;
  justify-content: flex-end;
}

.switcher {
  min-width: 210px;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 32, 44, 0.08);
}

.topbar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 122, 69, 0.18), rgba(31, 115, 255, 0.18));
  border: 1px solid rgba(20, 32, 44, 0.08);
  font-weight: 700;
}

.workspace {
  padding: 8px 2px 24px;
}

.page {
  display: grid;
  gap: 18px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.page-header h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.96;
}

.page-header p {
  margin: 10px 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-hero {
  padding: 26px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(248, 244, 237, 0.92)),
    radial-gradient(circle at right top, rgba(255, 122, 69, 0.18), transparent 28%);
  border: 1px solid rgba(20, 32, 44, 0.08);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.dashboard-hero h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.94;
}

.dashboard-hero p {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions,
.hero-badges,
.segment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-badges {
  margin-top: 22px;
}

.badge,
.chip,
.stat-pill {
  padding: 8px 12px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 32, 44, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-side {
  display: grid;
  gap: 16px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(340px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
}

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

.list-card,
.detail-card,
.timeline-card,
.empty-card {
  padding: 22px;
  border-radius: 24px;
}

.list-card header,
.detail-card header,
.timeline-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.card-headline {
  margin: 0;
}

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

.filter-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(20, 32, 44, 0.08);
}

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

.filter-field {
  display: grid;
  gap: 8px;
}

.filter-actions {
  justify-content: flex-end;
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(20, 32, 44, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(20, 32, 44, 0.08);
}

tbody td {
  padding: 16px;
  vertical-align: top;
  border-bottom: 1px solid rgba(20, 32, 44, 0.06);
}

tbody tr:hover {
  background: rgba(31, 115, 255, 0.03);
}

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

.table-kicker {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.status.enabled {
  background: rgba(23, 166, 115, 0.1);
  color: var(--accent-3);
}

.status.disabled {
  background: rgba(239, 75, 76, 0.08);
  color: var(--danger);
}

.status.locked {
  background: rgba(242, 161, 0, 0.1);
  color: var(--warn);
}

.tree-list,
.package-list,
.activity-list,
.matrix-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

.tree-item,
.package-item,
.activity-item,
.matrix-item {
  border-radius: 18px;
  border: 1px solid rgba(20, 32, 44, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.tree-button,
.package-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 14px 16px;
  text-align: left;
  display: grid;
  gap: 8px;
}

.tree-item.is-active,
.package-item.is-active {
  border-color: rgba(31, 115, 255, 0.26);
  box-shadow: 0 12px 28px rgba(31, 115, 255, 0.08);
}

.tree-meta,
.package-meta,
.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.tree-path {
  color: var(--muted);
  font-size: 0.9rem;
}

.indent-0 {
  margin-left: 0;
}

.indent-1 {
  margin-left: 12px;
}

.indent-2 {
  margin-left: 24px;
}

.indent-3 {
  margin-left: 36px;
}

.indent-4 {
  margin-left: 48px;
}

.indent-5 {
  margin-left: 60px;
}

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

.stat-block {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(20, 32, 44, 0.08);
}

.stat-block strong {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

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

.package-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 32, 44, 0.08);
  display: grid;
  gap: 18px;
}

.package-card h3 {
  margin: 0;
}

.package-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chip-row,
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip.is-strong {
  color: var(--ink);
  background: rgba(255, 122, 69, 0.08);
}

.chip.is-blue {
  color: var(--accent-2);
  background: rgba(31, 115, 255, 0.08);
}

.feature-row .chip {
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
  font-size: 0.9rem;
}

.timeline-card + .timeline-card {
  margin-top: 12px;
}

.activity-item {
  padding: 16px;
}

.activity-item strong {
  display: block;
}

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

.matrix-item {
  padding: 18px;
}

.matrix-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.matrix-table {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.matrix-row {
  display: grid;
  grid-template-columns: 200px repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.matrix-cell {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 32, 44, 0.08);
  min-height: 70px;
}

.matrix-cell strong {
  display: block;
  margin-bottom: 6px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 35, 0.42);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(880px, 100%);
  max-height: min(92vh, 960px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
}

.modal-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

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

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

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

.check-item {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(20, 32, 44, 0.08);
}

.check-item input {
  margin-top: 4px;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 280px;
  padding: 14px 16px;
  border-radius: 18px;
}

.toast strong {
  display: block;
}

.toast.info {
  border-color: rgba(31, 115, 255, 0.18);
}

.toast.success {
  border-color: rgba(23, 166, 115, 0.2);
}

.toast.warn {
  border-color: rgba(242, 161, 0, 0.2);
}

.toast.error {
  border-color: rgba(239, 75, 76, 0.2);
}

.empty-card {
  text-align: center;
}

.empty-card strong {
  display: block;
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.footer-note {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1240px) {
  .auth-shell,
  .app-shell,
  .dashboard-grid,
  .two-column,
  .dashboard-hero,
  .three-column {
    grid-template-columns: 1fr;
  }

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

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

  .matrix-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body::before {
    display: none;
  }

  .auth-shell,
  .app-shell {
    width: min(100vw - 16px, 100%);
    min-height: auto;
    margin: 8px auto;
    padding: 8px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto auto auto;
  }

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

  .kpi-grid,
  .auth-grid,
  .package-grid,
  .stats-row,
  .filter-form,
  .modal-grid,
  .modal-checklist {
    grid-template-columns: 1fr;
  }

  .topbar,
  .page-header {
    flex-direction: column;
  }

  .topbar-actions,
  .filter-actions,
  .header-actions {
    justify-content: flex-start;
  }

  .switcher {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 1240px) {
  body[data-view="auth"] .auth-shell {
    width: min(100vw - 28px, 100%);
    min-height: auto;
    margin: 14px auto;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body[data-view="auth"] .auth-shell::before,
  body[data-view="auth"] .auth-shell::after {
    display: none;
  }

  body[data-view="auth"] .auth-stage,
  body[data-view="auth"] .auth-panel {
    min-height: auto;
    border-radius: 34px;
  }

  body[data-view="auth"] .auth-stage {
    padding-bottom: 18px;
  }
}

@media (max-width: 860px) {
  body[data-view="auth"] .auth-shell {
    width: min(100vw - 16px, 100%);
    margin: 8px auto;
  }

  body[data-view="auth"] .auth-stage,
  body[data-view="auth"] .auth-panel {
    border-radius: 26px;
  }

  body[data-view="auth"] .auth-stage {
    padding: 22px 18px 14px;
  }

  body[data-view="auth"] .auth-panel {
    padding: 18px 14px;
  }

  body[data-view="auth"] .auth-login-card {
    width: 100%;
    padding: 8px 4px;
  }

  body[data-view="auth"] .auth-panel-brand {
    align-items: center;
  }

  body[data-view="auth"] .auth-panel-brand strong {
    font-size: 2rem;
  }

  body[data-view="auth"] .auth-headline {
    max-width: none;
  }

  body[data-view="auth"] .auth-headline h1 {
    font-size: clamp(2.4rem, 10vw, 3.6rem);
  }

  body[data-view="auth"] .auth-scene {
    min-height: 300px;
    margin-top: 8px;
    transform: scale(0.82);
    transform-origin: center top;
  }
}
