:root {
  --bg: #edf1f5;
  --panel: #ffffff;
  --ink: #14212b;
  --muted: #5f6f7c;
  --line: #d7dee6;
  --accent: #0f766e;
  --accent-dark: #0a5d57;
  --blue: #315f94;
  --gold: #b7791f;
  --soft: #e7f4f2;
  --danger: #96364c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}

.sidebar {
  background: #f8fafc;
  border-right: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.brand h1 {
  margin-bottom: 4px;
  font-size: 21px;
}

.brand p,
.catalog-header p,
.legal-box p,
.service-card p,
.stripe-box p,
.side-panel li,
.selected-card span {
  color: var(--muted);
}

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

.nav-item {
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--soft);
  border-color: #b9dcd7;
}

.nav-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e1e7ee;
  color: var(--muted);
  font-weight: 800;
}

.nav-item.is-active .nav-number {
  background: var(--accent);
  color: #fff;
}

.legal-box {
  margin-top: auto;
  border: 1px solid #e5c37d;
  background: #fff8e8;
  border-radius: 8px;
  padding: 14px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.topbar h2 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-button {
  min-height: 38px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
}

.top-actions select {
  width: 145px;
}

.payment-status {
  border: 1px solid #e5c37d;
  background: #fff8e8;
  color: #855d18;
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
}

.mode-badge {
  border: 1px solid #cfd8e3;
  background: #f6f8fb;
  color: #344054;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-badge.is-production {
  border-color: #b9dcd7;
  background: var(--soft);
  color: var(--accent-dark);
}

.mode-badge.is-demo {
  border-color: #e5c37d;
  background: #fff8e8;
  color: #855d18;
}

.payment-status.is-paid {
  border-color: #b9dcd7;
  background: var(--soft);
  color: var(--accent-dark);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.product-strip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.product-strip h3 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.document-visual {
  height: 130px;
  position: relative;
}

.paper {
  position: absolute;
  width: 96px;
  height: 124px;
  right: 28px;
  top: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 33, 43, 0.12);
}

.paper-back {
  transform: rotate(-8deg);
  right: 48px;
  background: #f7fbff;
}

.paper-front {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.paper-front span {
  height: 8px;
  border-radius: 20px;
  background: #d7dee6;
}

.paper-front b {
  margin-top: 8px;
  color: var(--accent);
}

.catalog-header,
.checkout-layout,
.package-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.selected-card,
.side-panel,
.panel,
.service-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.selected-card {
  padding: 14px;
}

.pricing-block {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.price-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.price-card.is-featured {
  border-color: var(--accent);
  background: var(--soft);
}

.price-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 7px;
}

.price-card strong {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}

.price-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.selected-card strong {
  display: block;
  margin-top: 4px;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.lead-capture {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.lead-capture h3 {
  margin-bottom: 6px;
}

.lead-capture p {
  color: var(--muted);
  margin-bottom: 0;
}

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

.lead-form textarea,
.lead-form button {
  grid-column: 1 / -1;
}

.seo-strip {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: center;
}

.seo-strip h3 {
  margin-bottom: 6px;
}

.seo-strip p {
  color: var(--muted);
  margin-bottom: 0;
}

.seo-links {
  display: grid;
  gap: 8px;
}

.seo-links a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.seo-links a:hover {
  text-decoration: underline;
}

.faq-block {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.faq-block h3 {
  margin-bottom: 0;
}

.faq-block details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.faq-block summary {
  cursor: pointer;
  font-weight: 800;
}

.faq-block p {
  color: var(--muted);
  margin: 8px 0 0;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
}

.service-card {
  padding: 18px;
  min-height: 265px;
  display: grid;
  gap: 14px;
  align-content: space-between;
}

.service-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.service-card h3 {
  margin-bottom: 8px;
  font-size: 19px;
}

.service-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
}

.service-meta small {
  width: 100%;
  color: #855d18;
  font-weight: 800;
}

.beta-total-note {
  padding-top: 10px;
  border-top: 1px dashed #d8b66d;
}

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

.badge {
  border-radius: 999px;
  background: #eef3f8;
  color: #405363;
  padding: 5px 8px;
  font-size: 12px;
}

.panel {
  max-width: 850px;
  padding: 22px;
}

.panel.wide {
  max-width: 980px;
}

.panel-title {
  margin-bottom: 20px;
}

.panel-title h3 {
  margin-bottom: 0;
}

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

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  color: #324452;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  line-height: 1.4;
}

.checkbox-line input {
  width: auto;
  margin-top: 3px;
}

.addon-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 8px;
  padding: 12px;
}

.addon-line small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}

.addon-line input {
  width: 20px;
  height: 20px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.primary,
.secondary {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.link-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.server-message {
  margin: 12px 0 0;
  color: var(--muted);
}

.server-message.is-error {
  color: var(--danger);
  font-weight: 700;
}

.invoice {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 18px;
}

.invoice div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.invoice .requirements-box {
  display: block;
}

.requirements-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

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

.invoice strong:last-child {
  font-size: 22px;
}

.stripe-box {
  border: 1px dashed #9fc7c1;
  background: #f4fbfa;
  border-radius: 8px;
  padding: 16px;
}

.stripe-box.is-demo {
  border-color: #e5c37d;
  background: #fffaf0;
}

.checkout-mode-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.side-panel {
  padding: 18px;
}

.side-panel h3 {
  margin-bottom: 10px;
}

.side-panel ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.resource-links {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.resource-links a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.resource-links a:hover {
  text-decoration: underline;
}

.question-list {
  display: grid;
  gap: 14px;
}

.progress-box {
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
  display: grid;
  gap: 10px;
}

.progress-box div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-box span {
  font-weight: 800;
}

.progress-box small {
  color: var(--muted);
}

.progress-track {
  height: 10px;
  background: #e3e9ee;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.field-missing input,
.field-missing textarea {
  border-color: #d98b8b;
  background: #fff8f8;
}

.summary {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.case-meta span {
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  padding: 7px 10px;
  font-weight: 800;
  font-size: 13px;
}

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

.timeline-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.timeline-step.is-done {
  border-color: #b9dcd7;
  background: var(--soft);
}

.timeline-step strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-step span {
  color: var(--muted);
  font-size: 13px;
}

.quality-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  border: 1px solid #d8c58e;
  border-radius: 8px;
  background: #fffaf0;
  padding: 16px;
  margin-bottom: 18px;
}

.quality-panel h3 {
  margin: 2px 0 6px;
}

.quality-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

.quality-panel ul {
  margin: 0;
  padding-left: 20px;
  color: #5d4a22;
  line-height: 1.5;
}

.summary-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.summary-row strong {
  color: #324452;
}

.summary-row span {
  white-space: pre-wrap;
}

.next-steps {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.next-steps h3 {
  margin-bottom: 10px;
}

.next-steps ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.document-preview {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
}

.panel-title.compact {
  margin-bottom: 12px;
}

.document-preview pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
  color: #263642;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stats div {
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 8px;
  padding: 14px;
}

.admin-stats span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.admin-stats strong {
  font-size: 22px;
}

.payment-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.review-queue {
  margin-top: 18px;
}

.lead-table-block {
  margin-top: 18px;
}

.service-performance {
  margin-top: 18px;
}

.service-performance h3 {
  margin-bottom: 10px;
}

#servicePerformance {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.performance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

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

.performance-row strong,
.performance-row span {
  display: block;
}

.performance-row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.performance-value {
  text-align: right;
}

.performance-value span {
  height: 7px;
  border-radius: 999px;
  background: #e5eceb;
  overflow: hidden;
}

.performance-value i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.lead-table-block h3 {
  margin-bottom: 10px;
}

.review-queue h3 {
  margin-bottom: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 90px;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

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

.payment-row.header {
  background: #f2f5f8;
  color: #324452;
  font-weight: 800;
}

.payment-row span {
  color: var(--muted);
}

.payment-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.queue-actions {
  display: flex;
  justify-content: flex-end;
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 0 10px;
}

.mini-button:disabled {
  color: var(--muted);
  background: #f5f7f8;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff8e8;
  color: #855d18;
  font-weight: 800;
}

.status-badge.is-done {
  background: var(--soft);
  color: var(--accent-dark);
}

.status-badge.is-contacted {
  background: #eef4ff;
  color: #315d93;
}

.followup-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.followup-box h3 {
  margin-bottom: 10px;
}

.followup-box pre {
  margin: 0;
  white-space: pre-wrap;
  color: #263642;
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

.internal-notes {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.internal-notes h3 {
  margin-bottom: 10px;
}

.internal-notes p {
  color: var(--muted);
  margin: 8px 0 0;
}

.site-footer {
  margin-top: 24px;
  padding: 18px 0 4px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
}

.site-footer a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

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

@media (max-width: 1000px) {
  .app,
  .catalog-header,
  .checkout-layout,
  .package-layout,
  .admin-layout,
  .seo-strip,
  .lead-capture,
  .pricing-block,
  .product-strip {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 680px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .top-actions,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions select,
  .service-grid,
  .form-grid,
  .lead-form,
  .catalog-tools,
  .admin-stats,
  .payment-row,
  .performance-row,
  .timeline,
  .quality-panel,
  .summary-row {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .actions,
  .side-panel {
    display: none;
  }

  .app,
  .package-layout {
    display: block;
  }

  .main {
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #packageView {
    display: block !important;
  }

  .panel {
    border: 0;
    padding: 0;
    max-width: none;
  }
}
