:root {
  --bg: #f5efe4;
  --bg-2: #f7f0e3;
  --paper: rgba(255, 251, 244, 0.84);
  --paper-strong: #fffaf2;
  --paper-soft: rgba(255, 248, 238, 0.72);
  --paper-deep: rgba(252, 244, 233, 0.96);
  --line: rgba(93, 73, 43, 0.12);
  --line-strong: rgba(93, 73, 43, 0.22);
  --text: #211f1a;
  --muted: #6f6659;
  --primary: #cc5a16;
  --primary-2: #f0a64a;
  --accent: #8f4e2d;
  --accent-soft: #ffe5b3;
  --warning: #9a6712;
  --danger: #bf4056;
  --ok: #297e59;
  --sidebar-width: 288px;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-lg: 0 18px 44px rgba(60, 40, 12, 0.1);
  --shadow-md: 0 10px 28px rgba(60, 40, 12, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.shell-ui {
  min-height: 100vh;
  color: var(--text);
  font-family: "Outfit", "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(204, 90, 22, 0.18), transparent 26%),
    radial-gradient(circle at 100% 10%, rgba(240, 166, 74, 0.2), transparent 24%),
    linear-gradient(135deg, #f8f2e8 0%, #f4ead9 48%, #f9f4ea 100%);
}

body.shell-ui::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(117, 93, 57, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 93, 57, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at 50% 10%, black 0%, transparent 75%);
}

body.shell-ui a {
  color: inherit;
}

body.shell-ui button,
body.shell-ui input,
body.shell-ui select,
body.shell-ui textarea {
  font: inherit;
}

.app-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 16px auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 18px;
  position: relative;
  z-index: 0;
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98) 0%, rgba(250, 241, 228, 0.99) 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  contain: layout paint style;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: auto -90px -90px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 166, 74, 0.24) 0%, transparent 70%);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo,
.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fffaf2;
  border: 1px solid rgba(93, 73, 43, 0.1);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(204, 90, 22, 0.07);
  overflow: hidden;
}

.brand-logo img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  display: block;
}

.brand-copy small,
.sidebar-copy,
.nav-group-label,
.header-copy p,
.section-copy,
.stat-card small,
.meta-card p,
.selector-group label,
.field label,
.note,
.account-list small,
.empty-state,
.helper-text {
  color: var(--muted);
}

.launch-item-done {
  border-left: 4px solid rgba(41, 126, 89, 0.65);
}

.launch-item-pending {
  border-left: 4px solid rgba(204, 90, 22, 0.55);
}

body.admin-ui .shell-content {
  gap: 14px;
}

body.admin-ui .shell-header {
  padding: 20px 22px;
}

body.admin-ui .hero-panel,
body.admin-ui .shell-section {
  padding: 18px 20px;
}

body.admin-ui .header-copy {
  gap: 8px;
}

body.admin-ui .header-copy p,
body.admin-ui .admin-hero-copy .section-copy {
  max-width: 86ch;
}

body.admin-ui .header-meta {
  width: min(100%, 420px);
  grid-template-columns: 1fr;
}

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

.admin-stat-card {
  min-height: 116px;
  align-content: start;
}

.admin-stat-card strong {
  font-size: clamp(1.1rem, 2vw, 1.7rem);
}

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

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  font-size: 0.78rem;
}

.sidebar-copy {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.sidebar-block {
  display: grid;
  gap: 12px;
}

.nav-group-label {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.shell-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: grid;
  gap: 4px;
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.48);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.nav-link strong {
  font-size: 0.94rem;
}

.nav-link span {
  color: var(--muted);
  font-size: 0.8rem;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.96) 0%, rgba(255, 239, 214, 0.94) 100%);
  box-shadow: 0 8px 18px rgba(204, 90, 22, 0.06);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.mini-profile {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.mini-profile strong {
  font-size: 0.96rem;
}

.pill-row,
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.btn,
body.shell-ui button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease, color 130ms ease, box-shadow 130ms ease;
}

.btn:hover,
body.shell-ui button:hover {
  transform: translateY(-1px);
}

.btn-primary,
body.shell-ui button {
  color: #fff8f0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 12px 28px rgba(204, 90, 22, 0.2);
}

.btn-secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.btn-danger {
  color: #fff3f4;
  background: linear-gradient(135deg, #b13e53 0%, #d6667a 100%);
}

.quick-collect-btn {
  width: 100%;
}

.shell-content {
  display: grid;
  gap: 18px;
  min-width: 0;
  align-content: start;
}

.hero-panel[hidden],
.shell-section[hidden] {
  display: none !important;
}

.shell-header,
.hero-panel,
.shell-section,
.surface-card {
  border: 1px solid var(--line);
  background: rgba(255, 251, 244, 0.94);
  box-shadow: var(--shadow-md);
  contain: layout paint style;
}

.shell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.shell-header::after,
.hero-panel::after {
  content: "";
  position: absolute;
  right: -110px;
  top: -110px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 166, 74, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.header-copy {
  display: grid;
  gap: 10px;
}

.overline {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.shell-header h1,
.hero-panel h2,
.shell-section h2,
.surface-card h3,
.surface-card h4,
.account-block h3,
.account-block h4 {
  margin: 0;
}

.shell-header h1 {
  font-size: clamp(1.9rem, 3.2vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.header-copy p {
  margin: 0;
  max-width: 65ch;
  line-height: 1.6;
}

.header-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  width: min(100%, 540px);
}

.selector-group,
.meta-card,
.stat-card,
.list-card,
.account-block {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.selector-group {
  display: grid;
  gap: 8px;
}

.selector-group label,
.field label {
  font-size: 0.8rem;
  font-weight: 700;
}

body.shell-ui input,
body.shell-ui select,
body.shell-ui textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  outline: none;
}

body.shell-ui textarea {
  min-height: 104px;
  padding: 12px 13px;
  resize: vertical;
}

body.shell-ui input::placeholder,
body.shell-ui textarea::placeholder {
  color: rgba(111, 102, 89, 0.74);
}

body.shell-ui input:focus,
body.shell-ui select:focus,
body.shell-ui textarea:focus {
  border-color: rgba(204, 90, 22, 0.34);
  box-shadow: 0 0 0 4px rgba(204, 90, 22, 0.1);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 24px 26px;
  border-radius: var(--radius-xl);
  display: grid;
  gap: 18px;
}

.hero-grid,
.stats-grid,
.section-grid,
.account-grid,
.mini-grid,
.form-grid,
.split-grid {
  display: grid;
  gap: 14px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.95fr);
  align-items: start;
}

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

.stat-card {
  display: grid;
  gap: 6px;
}

.stat-card strong {
  font-size: clamp(1.24rem, 2.4vw, 2rem);
  line-height: 1;
  color: var(--primary);
}

.stat-card span {
  color: var(--text);
  font-size: 0.92rem;
}

.meta-stack,
.stack {
  display: grid;
  gap: 10px;
}

.shell-section {
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  display: grid;
  gap: 18px;
  scroll-margin-top: 18px;
}

@supports (content-visibility: auto) {
  .shell-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 780px;
  }
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.payments-search-field {
  width: min(360px, 100%);
}

.section-head-copy {
  display: grid;
  gap: 8px;
}

.section-copy {
  margin: 0;
  line-height: 1.58;
}

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

.surface-card {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .btn,
  body.shell-ui button {
    transition: none;
  }

  .btn:hover,
  body.shell-ui button:hover {
    transform: none;
  }
}

.span-12 {
  grid-column: span 12;
}

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

.span-7 {
  grid-column: span 7;
}

.span-6 {
  grid-column: span 6;
}

.span-5 {
  grid-column: span 5;
}

.span-4 {
  grid-column: span 4;
}

.span-3 {
  grid-column: span 3;
}

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

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

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

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

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

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

.item,
.list-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.92rem;
  line-height: 1.55;
}

.item strong,
.list-card strong {
  color: var(--text);
}

.item a,
.result a,
.account-list a {
  color: var(--primary);
  word-break: break-all;
}

.payment-item {
  gap: 10px;
}

.payment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-actions {
  gap: 8px;
}

.compact-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.payment-actions {
  margin-top: 6px;
}

.payment-actions .compact-btn {
  min-height: 32px;
}

.result img {
  max-width: 220px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.note {
  min-height: 18px;
  font-size: 0.88rem;
}

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

.error {
  color: var(--danger);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  background: rgba(255, 240, 214, 0.88);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag-status-created {
  color: #805115;
  background: rgba(255, 240, 214, 0.9);
}

.tag-status-pending {
  color: #8a6415;
  background: rgba(255, 245, 199, 0.92);
}

.tag-status-success {
  color: #1f6c4a;
  background: rgba(218, 248, 229, 0.96);
}

.tag-status-failure {
  color: #a53f53;
  background: rgba(255, 229, 234, 0.96);
}

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

.account-block {
  display: grid;
  gap: 12px;
}

.account-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.account-list div {
  display: grid;
  gap: 4px;
}

.launch-focus-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(204, 90, 22, 0.16);
  background: linear-gradient(135deg, rgba(255, 244, 225, 0.92) 0%, rgba(255, 250, 243, 0.94) 100%);
}

.launch-focus-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.launch-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 73, 43, 0.1);
}

.launch-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 8px 18px rgba(204, 90, 22, 0.18);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 248, 236, 0.88);
}

.helper-text {
  font-size: 0.82rem;
  line-height: 1.5;
}

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

  .sidebar {
    position: static;
    min-height: auto;
  }

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

  .hero-grid,
  .header-meta,
  .account-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .payments-search-field {
    width: 100%;
  }

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

@media (max-width: 920px) {
  .stats-grid,
  .form-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4,
  .span-3 {
    grid-column: span 12;
  }

  .shell-header,
  .section-head {
    flex-direction: column;
  }

  .admin-summary-grid,
  .admin-compact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 16px, 100%);
    margin: 8px auto;
    gap: 12px;
  }

  .sidebar,
  .shell-header,
  .hero-panel,
  .shell-section {
    padding: 18px 16px;
    border-radius: 22px;
  }

  .surface-card,
  .selector-group,
  .meta-card,
  .stat-card,
  .account-block {
    padding: 14px;
  }

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

.mc-chatbot-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(204, 90, 22, 0.16);
  background: radial-gradient(circle at 30% 30%, rgba(255, 248, 238, 0.94) 0%, rgba(255, 241, 219, 0.88) 44%, rgba(240, 166, 74, 0.92) 100%);
  color: #6a3213;
  font-weight: 800;
  box-shadow:
    0 0 0 10px rgba(240, 166, 74, 0.08),
    0 18px 40px rgba(96, 56, 17, 0.18);
}

.mc-chatbot {
  position: fixed;
  right: 18px;
  bottom: 86px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 120px));
  z-index: 1199;
  border: 1px solid rgba(93, 73, 43, 0.08);
  border-radius: 24px;
  background: rgba(255, 251, 244, 0.97);
  box-shadow:
    0 18px 44px rgba(96, 56, 17, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.mc-chatbot::before {
  content: "";
  position: absolute;
  inset: -40px -30px auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 166, 74, 0.2) 0%, transparent 72%);
  pointer-events: none;
}

.mc-chatbot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 32%, rgba(255, 255, 255, 0.06) 100%);
}

.mc-chatbot[hidden] {
  display: none;
}

.mc-chatbot-head {
  padding: 12px 12px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
}

.mc-chatbot-head strong {
  font-size: 0.9rem;
}

.mc-chatbot-head button {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(93, 73, 43, 0.1);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: none;
  color: var(--muted);
}

.mc-chatbot-body {
  overflow: auto;
  padding: 6px 12px 12px;
  display: grid;
  gap: 8px;
  background: transparent;
}

.mc-chat-msg {
  padding: 9px 10px;
  border-radius: 16px;
  border: 1px solid rgba(93, 73, 43, 0.08);
  font-size: 0.86rem;
  line-height: 1.42;
  white-space: pre-wrap;
}

.mc-chat-msg.user {
  background: rgba(255, 236, 210, 0.52);
  border-color: rgba(204, 90, 22, 0.26);
  box-shadow: 0 10px 24px rgba(204, 90, 22, 0.08);
}

.mc-chat-msg.bot {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 24px rgba(60, 40, 12, 0.06);
}

.mc-chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mc-chatbot-chips button {
  height: 32px;
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(93, 73, 43, 0.1);
  color: var(--muted);
  font-size: 0.77rem;
  box-shadow: none;
}

.mc-chatbot-form {
  padding: 8px 10px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 251, 244, 0.16) 100%);
}

.mc-chatbot-form input {
  min-height: 38px;
  border: 1px solid rgba(93, 73, 43, 0.1);
  background: rgba(255, 255, 255, 0.42);
}

.mc-chatbot-form button {
  height: 38px;
}
