:root {
  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f4f5f7;

  /* 70% Orange, 20% Red, 10% Black accent balance on White */
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --ink-black: #0f0f10;
  --ink-dark: #1f2328;
  --ink-body: #374151;
  --ink-muted: #6b7280;
  --ink-subtle: #9ca3af;

  --border-light: #e5e7eb;
  --border-strong: #d1d5db;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 15, 16, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 15, 16, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 15, 16, 0.1);

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --transition-fast: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-stage: 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--ink-black);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

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

/* Top Accent Bar: 70% Orange, 20% Red, 10% Black */
.brand-ribbon {
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--orange-500) 0%,
    var(--orange-600) 70%,
    var(--red-600) 70%,
    var(--red-600) 90%,
    var(--ink-black) 90%,
    var(--ink-black) 100%
  );
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
}

/* Header */
.site-header {
  position: sticky;
  top: 4px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  background: #000000;
  display: block;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-black);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-counter-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-black);
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: 999px;
}

.btn-outline-subtle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dark);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.btn-outline-subtle:hover {
  border-color: var(--ink-black);
  color: var(--ink-black);
  background: var(--bg-subtle);
}

/* Main Onboarding Layout */
.onboarding-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 64px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  align-items: start;
}

/* Left Step Rail */
.step-rail {
  position: sticky;
  top: 86px;
  min-width: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
}

.rail-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 12px 6px;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.rail-item:hover:not(:disabled) {
  background: #ffffff;
  color: var(--ink-black);
}

.rail-item:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.rail-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  color: var(--ink-muted);
}

.rail-item.is-active {
  background: #ffffff;
  border-color: var(--orange-200);
  color: var(--ink-black);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.rail-item.is-active .rail-dot {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: #ffffff;
}

.rail-item.is-done {
  color: var(--ink-dark);
}

.rail-item.is-done .rail-dot {
  background: var(--ink-black);
  border-color: var(--ink-black);
  color: #ffffff;
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--orange-500) 0%, var(--orange-600) 78%, var(--red-600) 100%);
  border-radius: 999px;
  position: relative;
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stage Card & Directional In / Out Transitions */
.stage-viewport {
  min-width: 0;
  position: relative;
}

.stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px 38px 32px;
  box-shadow: var(--shadow-md);
  will-change: transform, opacity;
  transform-origin: center top;
}

.stage-card.is-entering-initial {
  animation: stageEnterInitial 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stage-card.is-entering-forward {
  animation: stageInForward 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stage-card.is-entering-backward {
  animation: stageInBackward 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stage-card.is-leaving-forward {
  animation: stageOutForward 180ms cubic-bezier(0.4, 0, 1, 1) both;
  pointer-events: none;
}

.stage-card.is-leaving-backward {
  animation: stageOutBackward 180ms cubic-bezier(0.4, 0, 1, 1) both;
  pointer-events: none;
}

@keyframes stageEnterInitial {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stageInForward {
  from {
    opacity: 0;
    transform: translateX(28px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes stageOutForward {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-28px) scale(0.985);
  }
}

@keyframes stageInBackward {
  from {
    opacity: 0;
    transform: translateX(-28px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes stageOutBackward {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(28px) scale(0.985);
  }
}

/* Staggered internal reveal inside entering stages */
.stage-card.is-animate-children .stage-kicker,
.stage-card.is-animate-children .stage-title,
.stage-card.is-animate-children .stage-desc,
.stage-card.is-animate-children .field-stack,
.stage-card.is-animate-children .option-grid-3,
.stage-card.is-animate-children .option-grid-2,
.stage-card.is-animate-children .review-grid,
.stage-card.is-animate-children .ref-box,
.stage-card.is-animate-children .stage-footer {
  animation: childFadeUp 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stage-card.is-animate-children .stage-kicker { animation-delay: 20ms; }
.stage-card.is-animate-children .stage-title { animation-delay: 50ms; }
.stage-card.is-animate-children .stage-desc { animation-delay: 80ms; }
.stage-card.is-animate-children .field-stack,
.stage-card.is-animate-children .option-grid-3,
.stage-card.is-animate-children .option-grid-2,
.stage-card.is-animate-children .review-grid,
.stage-card.is-animate-children .ref-box { animation-delay: 110ms; }
.stage-card.is-animate-children .stage-footer { animation-delay: 145ms; }

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

.stage-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--orange-600);
  background: var(--orange-50);
  border: 1px solid var(--orange-200);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.stage-kicker .req-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-600);
}

.stage-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-black);
  line-height: 1.2;
}

.stage-desc {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--ink-muted);
  max-width: 62ch;
}

/* Form Controls */
.field-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.required-mark {
  color: var(--red-600);
  font-weight: 700;
}

.field-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: -2px;
}

.text-input,
.text-area,
.select-input {
  width: 100%;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--ink-black);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.text-input-lg {
  font-size: 18px;
  padding: 15px 18px;
}

.text-area {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

.text-input:focus,
.text-area:focus,
.select-input:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.text-input.has-error,
.text-area.has-error {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.error-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  background: var(--red-50);
  border: 1px solid var(--red-100);
  color: var(--red-700);
  font-size: 13px;
  font-weight: 600;
}

.error-banner.is-visible {
  display: flex;
  animation: errorBannerIn 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes errorBannerIn {
  0% {
    opacity: 0;
    transform: translateY(-6px);
  }
  40% {
    opacity: 1;
    transform: translateX(-4px);
  }
  70% {
    transform: translateX(4px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

/* Interactive Option Grids */
.option-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.choice-card:hover {
  border-color: var(--orange-500);
  background: var(--orange-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.choice-card:active {
  transform: scale(0.985);
}

.choice-card.is-selected {
  border-color: var(--orange-600);
  background: var(--orange-50);
  box-shadow: 0 0 0 1px var(--orange-600);
}

.choice-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.choice-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-black);
}

.choice-sub {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}

.choice-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.choice-card.is-selected .choice-check {
  background: var(--orange-600);
  border-color: var(--orange-600);
  transform: scale(1.08);
}

.choice-card.is-radio .choice-check {
  border-radius: 999px;
}

/* Chip / Pill Selectors */
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  color: var(--ink-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chip-btn:hover {
  border-color: var(--orange-500);
  color: var(--ink-black);
  transform: translateY(-1px);
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-btn.is-selected {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: #ffffff;
}

.chip-btn.is-red-accent.is-selected {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #ffffff;
}

/* Custom Tag Input Row */
.inline-add-row {
  display: flex;
  gap: 10px;
}

.inline-add-row .text-input {
  flex: 1;
}

.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--ink-black);
  color: #ffffff;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-dark:hover {
  background: #232326;
  transform: translateY(-1px);
}

.btn-dark:active {
  transform: scale(0.98);
}

.custom-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.custom-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--ink-black);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  animation: tagIn 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.custom-tag.is-removing {
  animation: tagOut 150ms ease-in both;
}

@keyframes tagIn {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tagOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

.custom-tag button {
  background: none;
  border: none;
  color: #fca5a5;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

/* Stage Footer Actions */
.stage-footer {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stage-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: transparent;
  color: var(--ink-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--ink-black);
  color: var(--ink-black);
  transform: translateY(-1px);
}

.btn-ghost:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 24px;
  background: var(--orange-500);
  color: #ffffff;
  border: 1px solid var(--orange-600);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover:not(:disabled) {
  background: var(--orange-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.22);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-submit-red {
  background: var(--red-600);
  border-color: var(--red-700);
}

.btn-submit-red:hover:not(:disabled) {
  background: var(--red-700);
}

.kbd-hint {
  font-size: 12px;
  color: var(--ink-muted);
}

.kbd-key {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--ink-black);
}

/* Review Summary Stage */
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.review-box {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-subtle);
}

.review-box.is-full {
  grid-column: 1 / -1;
}

.review-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.review-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.review-edit-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange-600);
  cursor: pointer;
}

.review-edit-btn:hover {
  text-decoration: underline;
}

.review-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-black);
  white-space: pre-wrap;
  word-break: break-word;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-orange {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--orange-100);
  color: var(--orange-700);
}

.badge-red {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--red-100);
  color: var(--red-700);
}

.badge-dark {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ink-black);
  color: #ffffff;
}

/* Confirmation Screen */
.success-panel {
  text-align: left;
  padding: 12px 4px;
}

.success-badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--orange-500);
  color: #ffffff;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.ref-box {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--orange-500);
  background: var(--orange-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-code {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-black);
}

/* ---------------- ADMIN PANEL ---------------- */
.admin-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

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

.admin-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-black);
}

.admin-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
}

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

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

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--orange-500);
}

.kpi-card.is-red {
  border-top-color: var(--red-600);
}

.kpi-card.is-black {
  border-top-color: var(--ink-black);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-black);
  line-height: 1.15;
}

.kpi-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

.filter-search {
  flex: 1;
  min-width: 240px;
}

.filter-select {
  width: auto;
  min-width: 170px;
}

.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table thead th {
  padding: 13px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--ink-dark);
}

.data-table tbody tr {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--orange-50);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-new {
  background: var(--orange-100);
  color: var(--orange-700);
}

.status-reviewed {
  background: #f3f4f6;
  color: var(--ink-black);
}

.status-in_progress {
  background: var(--red-100);
  color: var(--red-700);
}

.status-completed {
  background: var(--ink-black);
  color: #ffffff;
}

/* Detail Drawer with In & Out Animations */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 16, 0.36);
  backdrop-filter: blur(2px);
  z-index: 90;
  display: none;
  justify-content: flex-end;
}

.drawer-backdrop.is-open {
  display: flex;
  animation: backdropIn 220ms ease-out both;
}

.drawer-backdrop.is-closing {
  display: flex;
  animation: backdropOut 200ms ease-in both;
  pointer-events: none;
}

.drawer-panel {
  width: min(640px, 100vw);
  height: 100%;
  background: #ffffff;
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
}

.drawer-backdrop.is-open .drawer-panel {
  animation: drawerSlideIn 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.drawer-backdrop.is-closing .drawer-panel {
  animation: drawerSlideOut 200ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes drawerSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0.7;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes drawerSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0.5;
  }
}

/* Admin KPIs & Table Row Entrances */
.kpi-card {
  animation: childFadeUp 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kpi-card:nth-child(1) { animation-delay: 20ms; }
.kpi-card:nth-child(2) { animation-delay: 60ms; }
.kpi-card:nth-child(3) { animation-delay: 100ms; }
.kpi-card:nth-child(4) { animation-delay: 140ms; }

.data-table tbody tr.is-row-enter {
  animation: rowFadeIn 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.drawer-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-subtle);
}

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

.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange-500);
}

.sync-dot.is-error {
  background: var(--red-600);
}

/* ---------------- ADMIN LOGIN ---------------- */
.login-shell {
  min-height: calc(100dvh - 68px);
  display: grid;
  place-items: center;
  padding: 32px 18px 48px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--orange-500);
  border-radius: var(--radius-xl);
  padding: 34px 32px 30px;
  box-shadow: var(--shadow-md);
  animation: stageEnterInitial 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-card.is-leaving {
  animation: stageOutForward 200ms cubic-bezier(0.4, 0, 1, 1) both;
}

.login-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-black);
}

.login-sub {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--ink-muted);
}

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

.password-field-wrap .text-input {
  padding-right: 68px;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-dark);
  cursor: pointer;
}

.password-toggle-btn:hover {
  border-color: var(--ink-black);
  color: var(--ink-black);
}

.login-footer-link {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-muted);
}

.login-footer-link a {
  font-weight: 600;
  color: var(--orange-600);
}

.login-footer-link a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .login-card {
    padding: 26px 20px 24px;
    border-radius: var(--radius-lg);
  }

  .login-title {
    font-size: 21px;
  }
}

@media (max-width: 920px) {
  .onboarding-shell {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px 18px 48px;
  }

  .step-rail {
    position: static;
    padding: 12px;
  }

  .rail-heading {
    margin-bottom: 8px;
  }

  .rail-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .rail-list::-webkit-scrollbar {
    display: none;
  }

  .rail-item {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 7px 11px;
  }

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

@media (max-width: 768px) {
  .admin-shell {
    padding: 20px 16px 48px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-search,
  .filter-select {
    width: 100%;
    min-width: 0;
  }

  /* Responsive mobile cards for Admin table */
  .table-card {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .table-scroll {
    overflow: visible;
  }

  .data-table,
  .data-table tbody {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .data-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
  }

  .data-table tbody tr.is-empty-row {
    padding: 0;
  }

  .data-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    border-bottom: none;
    width: 100%;
  }

  .data-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
  }

  .data-table tbody td.empty-state {
    align-items: center;
    padding: 40px 16px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-subtitle {
    display: none;
  }

  .header-actions {
    gap: 8px;
    margin-left: auto;
  }

  .stage-counter-pill {
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
  }

  .btn-outline-subtle {
    padding: 8px 11px;
    font-size: 12px;
    min-height: 38px;
    white-space: nowrap;
  }

  .onboarding-shell {
    padding: 14px 14px 40px;
    gap: 12px;
  }

  .progress-track {
    margin-bottom: 14px;
  }

  .stage-card {
    padding: 22px 18px 20px;
    border-radius: var(--radius-lg);
  }

  .stage-kicker {
    font-size: 11px;
    margin-bottom: 12px;
  }

  .stage-title {
    font-size: 21px;
  }

  .stage-desc {
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* 16px prevents iOS Safari auto-zoom on input focus */
  .text-input,
  .text-area,
  .select-input {
    font-size: 16px;
    padding: 12px 14px;
  }

  .text-input-lg {
    font-size: 17px;
    padding: 13px 15px;
  }

  .field-row-2,
  .option-grid-3,
  .option-grid-2,
  .review-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    padding: 14px;
  }

  .chip-btn {
    min-height: 40px;
    padding: 8px 13px;
  }

  .inline-add-row {
    flex-direction: column;
  }

  .inline-add-row .btn-dark {
    width: 100%;
    min-height: 44px;
  }

  .stage-footer {
    margin-top: 24px;
    padding-top: 18px;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }

  .stage-footer-left {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .stage-footer-left .btn-ghost,
  .stage-footer-left .btn-outline-subtle,
  .stage-footer-left .btn-dark,
  .stage-footer .btn-primary {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  .kbd-hint {
    display: none;
  }

  .admin-top {
    flex-direction: column;
    align-items: stretch;
  }

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

  .admin-toolbar-actions .btn-outline-subtle,
  .admin-toolbar-actions .btn-dark {
    width: 100%;
    padding: 9px 8px;
    font-size: 12px;
    justify-content: center;
  }

  .sync-indicator {
    font-size: 11px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .drawer-panel {
    width: 100vw;
    height: 100dvh;
    border-left: none;
  }

  .drawer-header {
    padding: 16px;
  }

  .drawer-body {
    padding: 16px;
  }

  .drawer-footer {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .drawer-footer .btn-primary,
  .drawer-footer .btn-ghost {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .admin-toolbar-actions {
    grid-template-columns: 1fr;
  }

  .stage-title {
    font-size: 19px;
  }
}

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