:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3ff;
  --text: #152033;
  --muted: #64748b;
  --line: #d9e1ef;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --danger: #dc2626;
  --shadow: 0 18px 45px rgba(21, 32, 51, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  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 {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.hero-copy {
  margin-bottom: 0;
  color: var(--muted);
}

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

.stat-card,
.customer-form,
.customer-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(21, 32, 51, 0.05);
}

.stat-card {
  padding: 18px;
}

.stat-card span,
label,
.section-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.money-stat strong {
  font-size: 22px;
  line-height: 1.25;
}

.workspace,
.order-workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.order-workspace {
  margin-top: 18px;
}

.customer-form,
.customer-panel {
  padding: 18px;
}

.customer-form {
  display: grid;
  gap: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  padding: 12px 16px;
  background: var(--brand);
  color: #fff;
}

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

.secondary-button,
.ghost-button {
  padding: 10px 12px;
  background: var(--surface-strong);
  color: var(--brand-dark);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 12px;
  margin: 16px 0;
}

.customer-list,
.order-list {
  display: grid;
  gap: 12px;
}

.customer-card,
.order-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.customer-main,
.order-info {
  min-width: 0;
}

.customer-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.customer-name {
  font-size: 17px;
  font-weight: 800;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge-new {
  background: #dbeafe;
  color: #1e40af;
}

.badge-consulting {
  background: #fef3c7;
  color: #92400e;
}

.badge-purchased,
.badge-paid {
  background: #dcfce7;
  color: #166534;
}

.badge-pending {
  background: #fee2e2;
  color: #991b1b;
}

.customer-meta,
.customer-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.customer-actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 800;
}

.delete-button {
  color: var(--danger);
}

.empty-state {
  margin: 22px 0 4px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.order-preview {
  margin: 0;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
  color: var(--brand-dark);
  font-weight: 800;
}

.order-card {
  grid-template-columns: 1fr 180px;
}

.qr-box {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: start;
}

.qr-box img {
  width: 160px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-box a {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.order-buttons {
  margin-top: 10px;
}

.hidden {
  display: none;
}

@media (max-width: 960px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .app-shell {
    padding: 14px;
  }

  .hero,
  .workspace,
  .order-workspace,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .customer-card,
  .order-card {
    grid-template-columns: 1fr;
  }

  .customer-actions {
    width: 100%;
  }

  .icon-button {
    flex: 1;
  }
}
