:root {
  --rose: #e85868;
  --rose-dark: #bb3f50;
  --teal: #39b8aa;
  --teal-dark: #168779;
  --ink: #263238;
  --muted: #66757f;
  --line: #e8eeee;
  --paper: #fffdfa;
  --surface: #ffffff;
  --soft: #f6fbfa;
  --shadow: 0 18px 50px rgba(38, 50, 56, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #fff7f7 0%, #f3fcfb 45%, #ffffff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

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

.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--paper);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.1rem;
}

.brand span,
.eyebrow,
.section-heading p,
.muted,
.metric small {
  color: var(--muted);
}

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

.nav-tab {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.nav-tab.active {
  color: #ffffff;
  background: var(--teal-dark);
}

.content {
  padding: 28px;
  overflow: hidden;
}

.topbar,
.section-heading,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
}

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

.secondary-link {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  padding: 0 16px;
  color: var(--teal-dark);
  background: #dff6f3;
  font-weight: 700;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--rose);
}

h2 {
  margin-bottom: 6px;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
}

.primary-action {
  color: #ffffff;
  background: var(--rose);
}

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

.secondary-action {
  color: var(--teal-dark);
  background: #dff6f3;
}

.full {
  width: 100%;
}

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

.metric,
.workflow article,
.panel,
.order-column,
.empty-state,
.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 28px rgba(38, 50, 56, 0.06);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
}

.metric strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 2rem;
}

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

.workflow article {
  min-height: 150px;
  padding: 18px;
}

.step-number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--teal);
  font-weight: 800;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--ink);
  background: var(--surface);
}

.chip.active {
  border-color: var(--rose);
  color: #ffffff;
  background: var(--rose);
}

.empty-state {
  padding: 36px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.product-card {
  padding: 16px;
}

.product-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--teal-dark);
  background: #e4f8f5;
  font-size: 0.78rem;
  font-weight: 700;
}

.split-layout,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

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

.panel {
  padding: 20px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.kit-rule {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.kit-rule span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.order-column {
  min-height: 260px;
  padding: 16px;
}

.empty-mini {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
}

.modal {
  width: min(560px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(38, 50, 56, 0.4);
}

.modal-card {
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal-header {
  margin-bottom: 18px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--soft);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

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

  .nav-tab {
    padding: 10px 6px;
    text-align: center;
    font-size: 0.83rem;
  }

  .content {
    padding: 18px;
  }

  .metrics-grid,
  .workflow,
  .split-layout,
  .settings-grid,
  .order-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .secondary-action,
  .secondary-link {
    width: 100%;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .brand div {
    min-width: 0;
  }

  .brand span {
    font-size: 0.82rem;
  }

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