:root {
  --plum-900: #1E0728;
  --plum-800: #2A0B37;
  --plum-700: #3A0F4A;
  --plum-600: #49155C;
  --plum-500: #5E1D75;
  --violet-600: #7A2A96;
  --violet-400: #A855F7;
  --violet-300: #C084FC;
  --violet-200: #DDBEFB;

  --bg: #F7F4FB;
  --surface: #FFFFFF;
  --line: #ECE4F4;
  --track: #F3EBFA;
  --ink: #1B0A24;
  --muted: #6C5A77;

  --good: #15803D;
  --good-bg: rgba(74, 222, 128, 0.16);
  --warn: #B45309;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --danger: #B91C1C;
  --danger-bg: rgba(248, 113, 113, 0.16);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;

  --sidebar-w: 264px;
  --topbar-h: 68px;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

body.is-login {
  display: grid;
  place-items: center;
  background:
    radial-gradient(760px 420px at 20% 0%, var(--plum-600) 0%, transparent 62%),
    linear-gradient(170deg, var(--plum-800) 0%, var(--plum-900) 100%);
}

body.drawer-open { overflow: hidden; }

img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 3px solid var(--violet-400); outline-offset: 2px; border-radius: 8px; }

.svg-defs { position: absolute; width: 0; height: 0; }
.icon { width: 20px; height: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 180ms ease, transform 160ms ease, opacity 160ms ease;
}

.btn-block { width: 100%; }
.btn-primary { background: var(--violet-400); color: #22062E; }
.btn-primary:hover { background: var(--violet-300); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  margin-top: var(--space-2);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn.is-loading { position: relative; color: transparent; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(34, 6, 46, 0.3);
  border-top-color: #22062E;
  animation: spin 700ms linear infinite;
}

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

.login { width: 100%; padding: var(--space-4); display: grid; place-items: center; }

.login-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
  color: #FFFFFF;
}

.login-logo { height: 62px; width: auto; margin: 0 auto var(--space-3); object-fit: contain; }

.login-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(168, 85, 247, 0.22);
  color: var(--violet-200);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login h1 { margin-top: var(--space-3); font-size: 1.4rem; font-weight: 700; }
.login-text { margin-top: var(--space-2); font-size: 0.92rem; color: var(--violet-200); }

.form { display: grid; gap: var(--space-3); margin-top: var(--space-4); text-align: left; }
.field { display: grid; gap: var(--space-2); }

.field-label { font-family: var(--font-display); font-size: 0.86rem; font-weight: 600; }

.field-control {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  transition: border-color 180ms ease;
}

.field-control:focus-within { border-color: var(--violet-400); }
.field.has-error .field-control { border-color: #F87171; }

.field-prefix { padding-left: 14px; font-family: var(--font-display); font-weight: 600; color: var(--violet-200); }

.input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 0 14px;
  background: none;
  border: 0;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 1rem;
}

.input:focus { outline: none; }

.reveal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-right: 3px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--violet-200);
  cursor: pointer;
}

.reveal:hover { background: rgba(255, 255, 255, 0.08); }
.field-error { font-size: 0.84rem; color: #F87171; }
.field-error:empty { display: none; }

.admin { display: flex; min-height: 100dvh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100dvh;
  padding: var(--space-4) var(--space-3);
  background: var(--plum-900);
  color: rgba(214, 194, 228, 0.75);
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.sidebar-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2) var(--space-4);
}

.sidebar-logo { height: 34px; width: auto; object-fit: contain; }

.sidebar-badge {
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--violet-400);
  color: #22062E;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-close { margin-left: auto; }

.nav {
  flex: 1;
  display: grid;
  align-content: start;
  gap: var(--space-4);
  overflow: hidden;
}

.nav-group { display: grid; gap: 2px; }

.nav-title {
  padding: 0 var(--space-2) var(--space-1);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 194, 228, 0.45);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 180ms ease, color 180ms ease;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }

.nav-item.is-active {
  background: var(--violet-400);
  color: #22062E;
  font-weight: 600;
}

.nav-icon { flex: 0 0 auto; width: 19px; height: 19px; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--violet-400);
  color: #22062E;
  font-family: var(--font-display);
  font-weight: 700;
}

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

.sidebar-user-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #FFFFFF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role { font-size: 0.76rem; color: rgba(214, 194, 228, 0.6); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  color: inherit;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(27, 10, 36, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.scrim.is-visible { opacity: 1; pointer-events: auto; }

.main {
  flex: 1;
  min-width: 0;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--topbar-h);
  padding: 0 var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar .icon-btn { color: var(--ink); }
.topbar .icon-btn:hover { background: var(--track); }

.topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn.is-spinning .icon { animation: spin 700ms linear; }

.content {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-4);
  padding-bottom: var(--space-6);
}

.page-intro h2 { font-size: 1.5rem; font-weight: 700; }
.page-intro p { margin-top: var(--space-1); color: var(--muted); font-size: 0.94rem; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-3);
}

.kpi {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.kpi-label { font-size: 0.84rem; color: var(--muted); }

.kpi-value {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.kpi-good .kpi-value { color: var(--good); }
.kpi-warn .kpi-value { color: var(--warn); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.panel-head h3 { flex: 1; font-size: 1.05rem; font-weight: 700; }
.panel-body { padding: 0 var(--space-4) var(--space-4); }

.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.segment {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 0 var(--space-4) var(--space-3);
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--track);
  overflow-x: auto;
  scrollbar-width: none;
}

.segment::-webkit-scrollbar { display: none; }

.segment-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(43, 12, 56, 0.1);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.segment-pill.no-anim { transition: none; }

.segment-btn {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  min-height: 38px;
  padding: 0 16px;
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 220ms ease;
}

.segment-btn.is-active { color: var(--ink); }

.table { display: grid; }

.tr {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1.2fr 1.2fr;
  gap: var(--space-3);
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

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

.th {
  padding-top: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cell-strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

.mini-bar {
  display: block;
  height: 5px;
  margin-top: 5px;
  border-radius: var(--radius-pill);
  background: var(--track);
  overflow: hidden;
}

.mini-bar span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--plum-500), var(--violet-400));
}

.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--track);
  color: var(--violet-600);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-completed { background: var(--good-bg); color: var(--good); }
.tag-running { background: var(--warn-bg); color: var(--warn); }
.tag-cancelled { background: var(--danger-bg); color: var(--danger); }

.feed { margin: 0; padding: 0; list-style: none; }

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.feed-item:last-child { border-bottom: 0; }
.feed-main { display: grid; gap: 2px; min-width: 0; }

.feed-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
}

.feed-sub { font-size: 0.8rem; color: var(--muted); }

.feed-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-side { display: grid; gap: 4px; justify-items: end; flex: 0 0 auto; }

.feed-amount {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}

.feed-amount.is-in { color: var(--good); }
.feed-amount.is-out { color: var(--danger); }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--violet-400);
  color: #22062E;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
}

.empty {
  padding: var(--space-5) 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

.building {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.building-mark {
  width: 54px;
  height: 54px;
  margin-bottom: var(--space-2);
  border: 2px dashed var(--line);
  border-radius: 16px;
}

.building h2 { font-size: 1.3rem; font-weight: 700; }
.building p { color: var(--muted); }

.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--track) 25%, #EFE6F7 37%, var(--track) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-kpi { height: 104px; border-radius: var(--radius-lg); }
.skeleton-row { height: 54px; margin-bottom: var(--space-2); }

@keyframes shimmer {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  width: min(420px, calc(100% - 32px));
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--plum-900);
  color: #FFFFFF;
  font-size: 0.92rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, 18px);
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast-error { border-color: rgba(248, 113, 113, 0.55); }

@media (max-width: 720px) {
  .tr {
    grid-template-columns: 1fr auto;
    gap: var(--space-2);
  }
  .tr span:nth-child(3), .tr span:nth-child(4) { display: none; }
  .th { display: none; }
}

@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
  .sidebar-close, .topbar-menu { display: none; }
  .scrim { display: none; }
  .main { margin-left: var(--sidebar-w); }
  .content { padding: var(--space-5); }
  .columns { grid-template-columns: 1fr 1fr; }
  .topbar { padding-inline: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.page-intro-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.btn-quiet {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-quiet:hover { background: var(--track); }

.btn-danger-soft {
  background: transparent;
  border-color: rgba(185, 28, 28, 0.28);
  color: var(--danger);
}

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

.cell-link {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--violet-600);
}

.cell-link:hover { text-decoration: underline; }

.wizard-steps {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.wizard-steps::-webkit-scrollbar { display: none; }

.wizard-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.wizard-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--track);
  color: var(--muted);
  font-size: 0.76rem;
}

.wizard-step.is-active {
  background: var(--violet-400);
  border-color: var(--violet-400);
  color: #22062E;
}

.wizard-step.is-active .wizard-num { background: rgba(34, 6, 46, 0.16); color: #22062E; }
.wizard-step.is-done { color: var(--ink); border-color: var(--violet-200); }
.wizard-step.is-done .wizard-num { background: var(--good-bg); color: var(--good); }

.wizard-panel[hidden] { display: none; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--line);
}

.input-box {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.96rem;
}

.input-box:focus { outline: none; border-color: var(--violet-400); }

.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix span {
  position: absolute;
  right: 14px;
  font-size: 0.86rem;
  color: var(--muted);
  pointer-events: none;
}
.input-suffix .input-box { padding-right: 54px; }

.readonly {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--track);
  font-family: var(--font-display);
  font-weight: 600;
}

.field-note { font-size: 0.8rem; color: var(--muted); }

.timeline { display: grid; gap: var(--space-3); }

.timeline-block {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--violet-400);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.timeline-block h4 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
}

.timeline-block p { font-size: 0.88rem; color: var(--muted); }
.timeline-block.is-warning { border-left-color: var(--warn); }

.timeline-warning {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  color: var(--warn) !important;
}

.slots {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}

.slots li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.slots li:last-child { border-bottom: 0; }

.dropzone {
  display: grid;
  gap: var(--space-1);
  justify-items: center;
  margin-top: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--track);
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.dropzone:hover, .dropzone.is-over { border-color: var(--violet-400); background: #F6EEFC; }

.dropzone-title { font-family: var(--font-display); font-weight: 700; }
.dropzone-text { font-size: 0.84rem; color: var(--muted); }

.import-status {
  margin-top: var(--space-3);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--track);
  font-size: 0.9rem;
}

.import-status.is-ok { background: var(--good-bg); color: var(--good); }
.import-status.is-error { background: var(--danger-bg); color: var(--danger); }

.import-errors { margin-top: var(--space-2); font-size: 0.86rem; color: var(--muted); }
.import-errors summary { cursor: pointer; }
.import-errors ul { margin: var(--space-2) 0 0; padding-left: 18px; }

.pool-title {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
}

.pool { margin: var(--space-2) 0 0; padding: 0; list-style: none; }

.pool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

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

.recap { display: grid; gap: var(--space-2); margin: 0; }

.recap div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.recap div:last-child { border-bottom: 0; }
.recap dt { font-size: 0.88rem; color: var(--muted); }
.recap dd { margin: 0; font-family: var(--font-display); font-weight: 600; text-align: right; }

.blocking {
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  color: var(--danger);
}

.blocking h4 { font-family: var(--font-display); font-size: 0.96rem; font-weight: 700; }
.blocking ul { margin: var(--space-2) 0 0; padding-left: 18px; font-size: 0.88rem; }

@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .timeline-block:nth-child(2) { grid-row: span 3; }
}

.cell-button {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px dashed var(--violet-200);
}

.cell-button:hover { border-bottom-color: var(--violet-400); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(27, 10, 36, 0.55);
  opacity: 0;
  transition: opacity 240ms ease;
}

.modal-overlay.is-visible { opacity: 1; }

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(27, 10, 36, 0.35);
  transform: translateY(14px);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.is-visible .modal { transform: translateY(0); }

.modal-title { font-size: 1.15rem; font-weight: 700; }
.modal-text { margin-top: var(--space-1); font-size: 0.9rem; color: var(--muted); }
.modal-body { margin-top: var(--space-4); }

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

body.modal-open { overflow: hidden; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.comp-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.comp-card:hover {
  transform: translateY(-2px);
  border-color: var(--violet-200);
  box-shadow: 0 14px 32px rgba(43, 12, 56, 0.1);
}

.comp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.comp-head h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.comp-facts { display: grid; gap: 6px; margin: 0; }

.comp-facts div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 0.86rem;
}

.comp-facts dt { color: var(--muted); }
.comp-facts dd { margin: 0; font-family: var(--font-display); font-weight: 600; }

.comp-progress { display: grid; gap: 6px; }

.comp-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.tr-5 { grid-template-columns: 0.6fr 1.2fr 1.2fr 1fr 1fr; }

.skeleton-card { height: 168px; border-radius: var(--radius-lg); margin-bottom: var(--space-3); }

#detail-panel { display: grid; gap: var(--space-4); }

@media (max-width: 720px) {
  .tr-5 { grid-template-columns: 1fr auto; }
  .tr-5 span:nth-child(1), .tr-5 span:nth-child(3), .tr-5 span:nth-child(4) { display: none; }
}

.readonly.is-invalid {
  border-color: rgba(185, 28, 28, 0.4);
  border-style: solid;
  background: var(--danger-bg);
  color: var(--danger);
}

.subject-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.subject-head .pool-title { margin-top: var(--space-4); }

.pool-actions {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.subject-remove {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.subject-remove:hover {
  background: var(--danger-bg);
  border-color: rgba(185, 28, 28, 0.28);
  color: var(--danger);
}

.subject-add {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.subject-add .input-box { flex: 1; }
.subject-add .btn { flex: 0 0 auto; min-height: 46px; }

.panel-alert { border-color: rgba(185, 28, 28, 0.3); }
.panel-alert .panel-head h3 { color: var(--danger); }

.nt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.nt-textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
  font-family: var(--font-body);
  line-height: 1.5;
}

.channels { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.channel {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.channel:has(input:checked) {
  border-color: var(--violet-400);
  background: #F6EEFC;
  color: var(--violet-600);
  font-weight: 600;
}

.channel input { accent-color: var(--violet-400); width: 16px; height: 16px; }

.nt-preview { margin-top: var(--space-4); }

.nt-preview-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.nt-preview-empty {
  padding: var(--space-4);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.nt-preview-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--plum-900);
  color: #FFFFFF;
}

.nt-preview-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--violet-400);
}

.nt-preview-main { display: grid; gap: 3px; min-width: 0; }

.nt-preview-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
}

.nt-preview-body {
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(214, 194, 228, 0.85);
}

.nt-toolbar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.nt-toolbar .input-box { flex: 1; }
.nt-toolbar .btn { flex: 0 0 auto; min-height: 46px; }

.nt-users {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.nt-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 140ms ease;
}

.nt-user:last-child { border-bottom: 0; }
.nt-user:hover { background: var(--track); }
.nt-user.is-on { background: #F6EEFC; }
.nt-user input { accent-color: var(--violet-400); width: 17px; height: 17px; }

.nt-user-main { display: grid; gap: 2px; flex: 1; min-width: 0; }

.nt-user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
}

.nt-badge {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--good-bg);
  color: var(--good);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nt-badge-alt { background: var(--track); color: var(--violet-600); }

.nt-user-sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.nt-user-stat { flex: 0 0 auto; font-size: 0.78rem; color: var(--muted); }

.nt-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 -6px 24px rgba(43, 12, 56, 0.08);
}

.nt-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}

.nt-stat strong { color: var(--ink); font-family: var(--font-display); }

.nt-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
}

@media (min-width: 1100px) {
  .nt-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

.vault {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.vault-card {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.vault-locked {
  border-left: 4px solid var(--warn);
  background: linear-gradient(180deg, var(--warn-bg) 0%, var(--surface) 60%);
}

.vault-open {
  border-left: 4px solid var(--violet-400);
  background: linear-gradient(180deg, #F6EEFC 0%, var(--surface) 60%);
}

.vault-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.vault-value {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--ink);
}

.vault-note { margin-top: var(--space-2); font-size: 0.82rem; color: var(--muted); }

.vault-lines {
  display: grid;
  gap: 6px;
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.vault-lines div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.88rem;
}

.vault-lines dt { color: var(--muted); }

.vault-lines dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

.vault-lines dd.strong { color: var(--violet-600); font-size: 1rem; }
.vault-open .btn { margin-top: var(--space-4); }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 190px;
  padding-top: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.chart::-webkit-scrollbar { display: none; }

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1 0 34px;
  height: 100%;
}

.chart-bar {
  width: 100%;
  max-width: 30px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--violet-400), var(--plum-500));
  transition: opacity 160ms ease;
}

.chart-col:hover .chart-bar { opacity: 0.75; }

.chart-label {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.recap dd.is-negative { color: var(--danger); }

@media (min-width: 900px) {
  .vault { grid-template-columns: repeat(3, 1fr); }
}

.input-box.is-invalid {
  border-color: rgba(185, 28, 28, 0.5);
  background: var(--danger-bg);
}

.field-alert {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--danger);
}

.field-alert:empty { display: none; }

.tree-scroll {
  overflow-x: auto;
  padding: 8px 4px 16px;
}

.tree ul {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0;
  padding: 30px 0 0;
  list-style: none;
  position: relative;
}

.tree > ul { padding-top: 0; }

.tree li {
  position: relative;
  padding: 30px 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tree > ul > li { padding-top: 0; }

.tree li::before,
.tree li::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 30px;
  border-top: 2px solid var(--line);
}

.tree li::before { right: 50%; border-right: 2px solid var(--line); }
.tree li::after { left: 50%; }

.tree li:only-child::before,
.tree li:only-child::after { display: none; }

.tree li:only-child { padding-top: 30px; }

.tree li:first-child::before,
.tree li:last-child::after { border: 0; }

.tree li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 8px 0 0; }
.tree li:first-child::after { border-radius: 8px 0 0 0; }

.tree > ul > li::before,
.tree > ul > li::after { display: none; }

.tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 30px;
  border-left: 2px solid var(--line);
}

.tree-node {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 158px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}

.tree-node-0 {
  border-color: transparent;
  background: linear-gradient(140deg, var(--violet-600), var(--plum-700));
  color: #FFFFFF;
  box-shadow: 0 12px 26px rgba(122, 42, 150, 0.28);
}

.tree-node-2 { background: var(--track); }

.tree-level {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tree-node-0 .tree-level { color: var(--violet-200); }

.tree-name {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: inherit;
}

.tree-node-0 .tree-name { color: #FFFFFF; }

.tree-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--track);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--violet-600);
}

.tree-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.tree-node-0 .tree-meta { color: rgba(255, 255, 255, 0.78); }

@media (max-width: 720px) {
  .tree-node { min-width: 132px; padding: 10px 12px; }
  .tree ul { gap: 10px; }
  .tree li { padding-left: 6px; padding-right: 6px; }
}

.tr-users { grid-template-columns: 1.5fr 1.1fr 1.2fr 0.7fr 2fr; }

.activate {
  display: flex;
  align-items: center;
  gap: 8px;
}

.activate-type {
  min-width: 0;
  flex: 1 1 120px;
  max-width: 160px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.activate-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.panel-foot .activate { margin-right: auto; }

@media (max-width: 720px) {
  .tr-users { grid-template-columns: 1fr; gap: 10px; }
  .tr-users span:nth-child(2), .tr-users span:nth-child(3) { display: block; }
  .tr-users.th { display: none; }
  .activate-type { flex: 1 1 auto; min-width: 0; }
}

.modal .nt-preview-card {
  display: grid;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.campaign-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  margin-top: var(--space-3);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--track);
}

.campaign-target {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.campaign-target.is-read {
  border-color: transparent;
  background: var(--good-bg);
  color: var(--good);
}

.modal .nt-preview-tag {
  justify-self: start;
  color: var(--violet-200);
}

.modal .nt-preview-body { color: rgba(214, 194, 228, 0.85); }

.pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.page-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.page-btn:hover:not(:disabled) { background: var(--track); border-color: var(--violet-300); }

.page-btn.is-active {
  border-color: transparent;
  background: var(--violet-600);
  color: #FFFFFF;
}

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

.page-arrow { font-weight: 600; }

.page-gap {
  padding: 0 2px;
  color: var(--muted);
  font-weight: 700;
}

.page-info {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .page-arrow { display: none; }
  .page-info { margin-left: 0; width: 100%; }
}
