:root {
  --ink: #172026;
  --muted: #667085;
  --line: #d8e0e8;
  --page: #f4f7f8;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --gold: #b7791f;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(23, 32, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

button {
  cursor: pointer;
}

.site-shell,
.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header,
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

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

.nav-actions,
.app-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 900;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.gold {
  background: var(--gold);
  color: #ffffff;
}

.btn.ghost {
  background: #e8f3f1;
  color: var(--accent-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 470px);
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 18px 0 34px;
}

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

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

h1 {
  max-width: 820px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-visual {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mock-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 900;
}

.mock-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.mock-row,
.mock-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.mock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.mock-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 28px 0 46px;
}

.product-card,
.panel,
.invoice-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-card {
  display: grid;
  align-content: start;
  min-height: 260px;
  gap: 14px;
  padding: 18px;
}

.product-card span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8f3f1;
  color: var(--accent-dark);
  font-size: 24px;
  font-weight: 900;
}

.product-card p {
  color: var(--muted);
  line-height: 1.5;
}

.app-shell {
  padding-bottom: 34px;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d3df;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.stack {
  display: grid;
  gap: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.items-table {
  min-width: 650px;
}

.tiny {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  padding: 0 9px;
  background: #edf1f5;
  color: var(--ink);
  font-weight: 900;
}

.invoice-preview {
  position: sticky;
  top: 16px;
  padding: 18px;
}

.invoice-box {
  border: 1px solid #111111;
  background: #ffffff;
  padding: 16px;
  font-family: Arial, Helvetica, sans-serif;
  color: #111111;
}

.invoice-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 2px solid #111111;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.invoice-title h2 {
  margin: 0;
}

.invoice-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.totals {
  display: grid;
  gap: 7px;
  max-width: 260px;
  margin-left: auto;
}

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

.total-due {
  border-top: 2px solid #111111;
  padding-top: 8px;
  font-size: 18px;
  font-weight: 900;
}

.record-list,
.stock-list {
  display: grid;
  gap: 8px;
}

.record-card,
.stock-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.record-card span,
.stock-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.payment-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.payment-link {
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-size: 13px;
}

.status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

  .hero {
    min-height: auto;
  }

  .invoice-preview {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header,
  .app-header,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions,
  .app-actions,
  .button-row {
    width: 100%;
  }

  .btn {
    flex: 1 1 auto;
    min-height: 46px;
  }

  .form-grid,
  .item-grid,
  .stock-grid,
  .invoice-meta {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }
}
