:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #eef4ef;
  --ink: #17201b;
  --muted: #65706a;
  --line: #dce2dd;
  --accent: #1e7b58;
  --accent-strong: #135c41;
  --warning: #a76617;
  --danger: #b73535;
  --shadow: 0 18px 50px rgba(25, 36, 29, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: #2f6f3a;
  color: #f8fbf8;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  text-align: center;
}

.brand p,
.topbar h2,
.topbar p {
  margin: 0;
}

.brand-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
  border-radius: 8px;
  filter: brightness(0) invert(1);
}

.brand p {
  color: #eef7ea;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.nav-button,
.secondary-button,
.danger-button,
.primary-button,
.ghost-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 12px;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-button {
  background: transparent;
  color: #d7e4db;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(10, 49, 25, 0.62);
  color: #ffffff;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  min-width: 0;
}

.secondary-button,
.ghost-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: #a9bbb0;
}

.danger-button {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffd2d2;
}

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

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

.file-button {
  display: block;
}

.file-button input {
  display: none;
}

.logout-button {
  text-decoration: none;
}

.website-button,
.login-website-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.website-button {
  border-color: rgba(255, 255, 255, 0.35);
  background: #ecf6ef;
  color: var(--accent-strong);
  font-weight: 850;
}

.login-website-link {
  margin-top: -4px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 2px;
  font-size: 30px;
  line-height: 1.15;
}

.status-pill {
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.view {
  display: none;
  min-width: 0;
}

.view.active {
  display: block;
}

.grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.dashboard-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.management-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  margin-top: 16px;
}

.two-col {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: start;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 9px;
  font-size: 25px;
  line-height: 1.15;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.card-header h3 {
  margin: 0;
  font-size: 17px;
}

.card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.form label.wide {
  grid-column: 1 / -1;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.form textarea {
  resize: vertical;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.segmented {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

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

.segment-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-row span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  text-align: center;
}

.segment-row input:checked + span {
  border-color: var(--accent);
  background: #e4f3ea;
  color: var(--accent-strong);
  font-weight: 750;
}

.invoice-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.sales-stock-header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.stock-square {
  display: grid;
  place-items: center;
  min-height: 74px;
  border: 2px solid #b7d2bf;
  border-radius: 8px;
  background: #eef8f1;
  color: var(--ink);
  text-align: center;
}

.stock-square span {
  font-size: 12px;
  font-weight: 800;
}

.stock-square strong {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
}

.stock-square.warn {
  border-color: #d69b2d;
  background: #fff7df;
}

.stock-square.bad {
  border-color: var(--danger);
  background: #ffecec;
  color: var(--danger);
}

.invoice-form .form {
  padding: 0;
}

.product-lines,
.payment-split,
.invoice-preview {
  display: grid;
  gap: 10px;
}

.product-group {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf8;
}

.product-group h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.product-line {
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) minmax(96px, 0.4fr) minmax(90px, 0.32fr) minmax(116px, 0.44fr);
  gap: 8px;
  align-items: end;
}

.source-choice {
  grid-column: 2 / -1;
  display: grid;
  gap: 7px;
}

.source-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.source-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.source-options span,
.source-empty {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.source-options input:checked + span {
  border-color: var(--accent);
  background: #e4f3ea;
  color: var(--accent-strong);
}

.source-options.source-hexa input:checked + span {
  border-color: #d21b78;
  background: #fde7f2;
  color: #9b0f54;
}

.source-options.source-cube input:checked + span {
  border-color: #1e8a4c;
  background: #e5f5eb;
  color: #0e5f34;
}

.source-options.source-dukma input:checked + span {
  border-color: #b73535;
  background: #ffe7e7;
  color: #8d2424;
}

.source-empty {
  color: var(--danger);
}

.product-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-check span {
  position: relative;
  display: grid;
  grid-template-columns: 72px 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.product-stock-badge {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 12px;
  background: #143f2a;
  color: #ffffff;
  font-size: 24px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.product-stock-stack {
  display: grid;
  gap: 6px;
  width: 66px;
}

.product-stock-stack .product-stock-badge {
  width: 66px;
  height: 48px;
  border-radius: 10px;
  font-size: 18px;
}

.product-stock-badge small {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-stock-badge.warn {
  background: #b36a12;
}

.product-check b {
  min-width: 0;
  font-weight: 750;
}

.product-thumb {
  width: 92px;
  height: 92px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef4ef;
}

.product-thumb.empty {
  display: block;
}

.product-check input:checked + span {
  border-color: var(--accent);
  background: #e4f3ea;
  color: var(--accent-strong);
}

.product-line label,
.payment-split label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.cost-display {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 13px;
}

.compact-cost {
  min-height: 38px;
  padding: 6px 8px;
  font-size: 12px;
}

.compact-cost strong {
  font-size: 14px;
}

.cost-display strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
}

.readonly-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.readonly-value {
  display: grid;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #f8faf8;
  color: var(--ink);
  font-weight: 750;
}

.product-line input,
.payment-split input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}

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

.invoice-preview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.payment-split.warn input,
.invoice-preview.warn {
  border-color: #d69b2d;
  background: #fff7df;
}

.payment-split.bad input,
.invoice-preview.bad {
  border-color: var(--danger);
  background: #ffecec;
}

.invoice-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.invoice-preview strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.invoice-preview.warn .remaining-value {
  color: var(--warning);
}

.invoice-preview.bad .remaining-value {
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 11px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4ef;
  color: #34423a;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr.unpaid-row td {
  background: #fff0f0;
  color: #8d2424;
}

tr.unpaid-row .tooltip-cell {
  border-bottom-color: #b73535;
}

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

.mini-button {
  min-width: 34px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

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

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
}

.client-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.statement-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.statement-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.statement-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.statement-toolbar input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--panel-soft);
  color: #234333;
  font-size: 12px;
  font-weight: 700;
}

.tag.warn {
  background: #fff3dc;
  color: var(--warning);
}

.tag.bad {
  background: #ffe7e7;
  color: var(--danger);
}

.client-list-panel {
  display: grid;
  gap: 10px;
}

.client-type-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.client-type-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.client-type-toolbar button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.client-type-toolbar button.active {
  border-color: var(--accent);
  background: #e4f3ea;
  color: var(--accent-strong);
}

.low-profit {
  color: #b36a12;
  font-weight: 850;
}

.low-net-profit {
  color: #b36a12;
  font-weight: 900;
}

.bad-net-profit {
  color: #b73535;
  font-weight: 950;
}

.free-profit {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 8px;
  background: #b73535;
  color: #ffffff;
  font-weight: 850;
}

.tooltip-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-bottom: 1px dotted #8ba295;
}

.tooltip-cell .tooltip-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 5;
  display: none;
  min-width: 220px;
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  white-space: normal;
}

.tooltip-cell:hover .tooltip-panel {
  display: block;
}

.tooltip-panel strong {
  display: block;
  margin-bottom: 6px;
}

.tooltip-panel span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.month-section {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.invoice-grand-totals {
  display: grid;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.invoice-grand-totals h3 {
  margin: 0;
  font-size: 18px;
}

.invoice-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.invoice-tools span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.month-header {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(160px, 0.22fr) minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.month-header h3 {
  margin: 0;
  font-size: 18px;
}

.total-box {
  display: grid;
  min-width: 180px;
  border: 1px solid #b7d2bf;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef8f1;
  text-align: center;
}

.production-group-header {
  color: #ffffff;
}

.production-group-header h3 {
  color: #ffffff;
}

.hexa-header {
  background: #c20b63;
  border-color: #9b0f54;
}

.cube-header {
  background: #2f7d3d;
  border-color: #0e5f34;
}

.production-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.total-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.total-box strong {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 22px;
  line-height: 1;
}

.hexa-total-box strong {
  color: #c20b63;
}

.month-totals {
  display: grid;
  grid-template-columns: minmax(300px, 1.25fr) minmax(210px, 0.78fr) minmax(360px, 1.35fr);
  gap: 12px;
}

.month-totals span {
  color: #596860;
  font-size: 12px;
}

.month-totals strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
}

.summary-band {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 8px;
  align-content: start;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  padding: 38px 10px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
  min-height: 128px;
}

.summary-band::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  width: calc(100% - 20px);
  height: 4px;
  border-radius: 0 0 999px 999px;
}

.finance-band::before {
  background: #1769aa;
}

.bag-band::before {
  background: #6f8f7a;
}

.product-band::before {
  background: #d21b78;
}

.product-band {
  grid-template-columns: repeat(3, minmax(82px, 1fr));
}

.band-title {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5ece7;
  padding-bottom: 7px;
  color: #324139;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.summary-band > span:not(.band-title) {
  display: grid;
  align-content: center;
  min-height: 46px;
  border: 1px solid #e3ebe5;
  border-radius: 7px;
  padding: 7px 8px;
  background: #ffffff;
}

.summary-band > span:not(.band-title) strong {
  font-size: 17px;
  line-height: 1.1;
}

.finance-band {
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.bag-band {
  background: linear-gradient(180deg, #f7faf5 0%, #ffffff 100%);
}

.product-band {
  background: linear-gradient(180deg, #fff8fb 0%, #ffffff 100%);
}

.month-totals .total-sales strong {
  color: #13734d;
}

.month-totals .total-cost strong {
  color: #b36a12;
}

.month-totals .total-profit strong {
  color: #1769aa;
}

.month-totals .total-profit-percent strong {
  color: #1769aa;
  font-weight: 850;
}

.month-totals .out-10kg-hexa strong {
  color: #d21b78;
}

.month-totals .out-10kg-cube strong {
  color: #1e8a4c;
}

.month-totals .out-400g-hexa strong {
  color: #9b0f54;
}

.month-totals .out-400g-cube strong {
  color: #0e5f34;
}

.month-totals .low-profit strong,
.month-totals strong.low-profit {
  color: #b36a12;
  font-weight: 850;
}

.month-totals .free-profit strong,
.month-totals strong.free-profit {
  border-radius: 6px;
  padding: 2px 8px;
  background: #b73535;
  color: #ffffff;
  font-weight: 850;
}

.expense-history {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.expense-history h3 {
  margin: 0;
  font-size: 18px;
}

.expense-category-strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  padding: 38px 10px 10px;
  background: linear-gradient(180deg, #fffaf4 0%, #ffffff 100%);
  box-shadow: var(--shadow);
}

.expense-category-strip::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  width: calc(100% - 20px);
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: #b36a12;
}

.expense-category-strip > span:not(.band-title) {
  display: grid;
  align-content: center;
  min-width: 130px;
  min-height: 48px;
  border: 1px solid #f0dfc6;
  border-radius: 7px;
  padding: 7px 9px;
  background: #ffffff;
  color: #6a563b;
  font-size: 12px;
  font-weight: 750;
}

.expense-category-strip strong {
  display: block;
  margin-top: 3px;
  color: #b36a12;
  font-size: 17px;
}

.expense-category-strip .expense-grand-total {
  margin-left: auto;
  border-color: #f0b6b6;
  background: #fff0f0;
  color: #8d2424;
}

.expense-category-strip .expense-grand-total strong {
  color: #b73535;
  font-size: 20px;
  font-weight: 950;
}

.expense-category-strip .empty-category {
  color: var(--muted);
}

.expense-month-section {
  margin-bottom: 0;
}

.expense-month-header {
  grid-template-columns: minmax(140px, 0.18fr) minmax(0, 1fr);
}

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

.settings-list {
  padding: 16px 18px;
}

.settings-list dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 11px 18px;
  margin: 0;
}

.settings-list dt {
  color: var(--muted);
}

.settings-list dd {
  margin: 0;
  font-weight: 750;
}

.login-page {
  display: grid;
  min-height: 100vh;
  background: #245d32;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(100%, 380px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 26px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.login-logo {
  width: 210px;
  max-width: 100%;
  margin: 0 auto 4px;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 24px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.login-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-field button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 850;
}

.login-card .primary-button {
  min-height: 42px;
  text-align: center;
}

.login-error {
  border: 1px solid #f0b6b6;
  border-radius: 7px;
  padding: 9px 10px;
  background: #ffecec;
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
}

.login-success {
  border: 1px solid #b7d2bf;
  border-radius: 7px;
  padding: 9px 10px;
  background: #e4f3ea;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
}

.site-page {
  background: #ffffff;
  color: #202722;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(31, 70, 43, 0.12);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.site-logo img {
  display: block;
  width: 156px;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.site-links a,
.admin-link,
.hero-primary,
.hero-secondary,
.contact-card a {
  color: inherit;
  text-decoration: none;
}

.site-links a {
  color: #506057;
  font-size: 14px;
  font-weight: 750;
}

.admin-link,
.hero-primary,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  padding: 10px 16px;
  font-weight: 850;
}

.admin-link,
.hero-primary {
  background: #2f7d3d;
  color: #ffffff;
}

.hero-secondary {
  border: 1px solid #b7d2bf;
  background: #ffffff;
  color: #245d32;
}

.site-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 26px;
  min-height: calc(100vh - 78px);
  padding: clamp(34px, 5vw, 72px) clamp(18px, 5vw, 70px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.82) 48%, rgba(238, 247, 234, 0.96) 100%),
    #eef7ea;
}

.site-kicker {
  color: #2f7d3d;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 8px 0 10px;
  color: #2d322f;
  font-size: clamp(56px, 10vw, 128px);
  line-height: 0.88;
}

.hero-copy p {
  max-width: 620px;
  margin: 0;
  color: #536158;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.45;
}

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

.hero-product {
  display: grid;
  justify-items: end;
}

.hero-product img {
  width: min(100%, 760px);
  max-height: 74vh;
  object-fit: contain;
  filter: drop-shadow(0 28px 40px rgba(38, 56, 42, 0.18));
}

.site-section {
  padding: clamp(42px, 7vw, 90px) clamp(18px, 5vw, 70px);
}

.section-heading {
  display: grid;
  gap: 8px;
  max-width: 780px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  color: #253028;
  font-size: clamp(30px, 4.5vw, 58px);
  line-height: 1.04;
}

.about-band,
.order-band {
  background: #f4f8f2;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 1.08fr);
  gap: 22px;
  align-items: start;
}

.about-grid p {
  margin: 0;
  color: #58665d;
  font-size: 18px;
  line-height: 1.6;
}

.about-points,
.order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.about-points span,
.order-grid div,
.contact-card {
  border: 1px solid #dbe8de;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(30, 55, 37, 0.08);
}

.about-points span {
  color: #245d32;
  font-weight: 850;
}

.product-showcase {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.product-showcase article {
  display: grid;
  grid-template-rows: 220px auto auto;
  gap: 10px;
  border: 1px solid #e0e8e1;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(30, 55, 37, 0.08);
}

.product-showcase img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-showcase h3,
.order-grid strong {
  margin: 0;
  color: #253028;
  font-size: 18px;
}

.product-showcase p,
.order-grid p {
  margin: 0;
  color: #617067;
  line-height: 1.45;
}

.order-grid {
  grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.contact-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: center;
}

.contact-card a,
.contact-card span {
  color: #245d32;
  font-weight: 850;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 5vw, 70px);
  background: #245d32;
  color: #ffffff;
}

.zara-hero {
  position: relative;
  min-height: 720px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.88) 44%, rgba(240,247,237,0.8) 100%),
    radial-gradient(circle at 82% 20%, rgba(196, 224, 88, 0.34), transparent 34%),
    #ffffff;
}

.zara-hero::after {
  content: "";
  position: absolute;
  left: clamp(18px, 5vw, 70px);
  right: clamp(18px, 5vw, 70px);
  bottom: 18px;
  height: 1px;
  background: #dbe8de;
}

.zara-hero .hero-copy h1 {
  max-width: 780px;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.96;
}

.hero-stack {
  position: relative;
  min-height: 560px;
}

.hero-stack img {
  position: absolute;
}

.hero-main-pack {
  right: 0;
  bottom: 8%;
  z-index: 2;
}

.hero-side-pack {
  left: 0;
  top: 4%;
  width: min(48%, 390px) !important;
  opacity: 0.92;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 1px;
  padding: 0 clamp(18px, 5vw, 70px) 34px;
  background: #ffffff;
}

.trust-strip div {
  display: grid;
  gap: 5px;
  border-top: 4px solid #5a9f43;
  padding: 18px 16px;
  background: #f5f8f4;
}

.trust-strip strong {
  color: #245d32;
  font-size: 22px;
}

.trust-strip span {
  color: #59685f;
  font-size: 13px;
  font-weight: 750;
}

.split-heading {
  max-width: 1050px;
}

.centered-heading {
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
}

.about-editorial {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
}

.product-band {
  background: #ffffff;
}

.product-catalog {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.product-catalog article {
  grid-template-rows: 250px auto auto auto;
  border-color: #dfe8e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
}

.product-catalog article span {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  background: #e4f3ea;
  color: #245d32;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quality-section {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1fr);
  gap: clamp(22px, 5vw, 70px);
  align-items: center;
  background: #f3f7f1;
}

.quality-image {
  display: grid;
  place-items: center;
}

.quality-image img {
  width: min(100%, 440px);
  max-height: 620px;
  object-fit: contain;
  filter: drop-shadow(0 22px 36px rgba(30, 55, 37, 0.18));
}

.quality-copy h2 {
  margin: 8px 0 12px;
  color: #253028;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.02;
}

.quality-copy p {
  margin: 0;
  color: #5c6c62;
  font-size: 18px;
  line-height: 1.55;
}

.quality-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.quality-list span {
  border-left: 4px solid #5a9f43;
  padding: 12px 14px;
  background: #ffffff;
  color: #245d32;
  font-weight: 850;
}

.contact-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.site-page {
  overflow-x: hidden;
}

.cursor-glow {
  --x: 50vw;
  --y: 50vh;
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--x) var(--y), rgba(196, 224, 88, 0.23), transparent 140px),
    radial-gradient(circle at var(--x) var(--y), rgba(90, 159, 67, 0.12), transparent 280px);
  mix-blend-mode: multiply;
}

.site-nav {
  transition: box-shadow 220ms ease, background 220ms ease, transform 220ms ease;
}

.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 44px rgba(30, 55, 37, 0.12);
}

.cinematic-scene {
  position: relative;
  isolation: isolate;
}

.cinematic-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transform: scale(1.04);
  background:
    radial-gradient(circle at 16% 18%, rgba(90, 159, 67, 0.12), transparent 24%),
    radial-gradient(circle at 86% 46%, rgba(196, 224, 88, 0.18), transparent 30%);
  transition: opacity 800ms ease, transform 1200ms ease;
}

.cinematic-scene.is-visible::before {
  opacity: 1;
  transform: scale(1);
}

.reveal-scene {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 720ms ease, transform 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-scene.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-copy h1 {
  overflow: hidden;
}

.hero-copy h1 span {
  display: block;
  transform: translateY(105%) rotateX(18deg);
  opacity: 0;
  animation: titleReveal 850ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transform-origin: left bottom;
}

.hero-copy h1 span:nth-child(2) {
  animation-delay: 120ms;
}

.hero-copy h1 span:nth-child(3) {
  animation-delay: 240ms;
}

.hero-main-pack {
  animation: cinematicFloat 5.5s ease-in-out infinite;
}

.hero-side-pack {
  animation: cinematicFloat 6.5s ease-in-out infinite reverse;
}

.product-catalog {
  perspective: 1200px;
}

.tilt-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  overflow: hidden;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 220ms ease;
  will-change: transform;
}

.tilt-card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.72), transparent 28%);
  transition: opacity 180ms ease;
}

.tilt-card:hover {
  border-color: rgba(90, 159, 67, 0.45);
  box-shadow: 0 30px 70px rgba(30, 55, 37, 0.17);
}

.tilt-card:hover::after {
  opacity: 1;
}

.tilt-card img,
.tilt-card span,
.tilt-card h3,
.tilt-card p {
  position: relative;
  z-index: 1;
}

.tilt-card img {
  transform: translateZ(34px);
  transition: transform 220ms ease;
}

.tilt-card:hover img {
  transform: translateZ(54px) scale(1.035);
}

.trust-strip div,
.quality-list span,
.order-grid div,
.contact-card {
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.trust-strip div:hover,
.quality-list span:hover,
.order-grid div:hover,
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 54px rgba(30, 55, 37, 0.12);
}

@keyframes titleReveal {
  to {
    transform: translateY(0) rotateX(0deg);
    opacity: 1;
  }
}

@keyframes cinematicFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-1deg);
  }

  50% {
    transform: translate3d(0, -16px, 0) rotate(1.2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy h1 span,
  .hero-main-pack,
  .hero-side-pack {
    animation: none;
  }

  .reveal-scene,
  .cinematic-scene::before,
  .tilt-card,
  .tilt-card img,
  .site-nav {
    transition: none;
  }

  .reveal-scene,
  .hero-copy h1 span {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1060px) {
  .site-nav,
  .site-hero,
  .about-grid,
  .quality-section,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .site-links {
    justify-content: start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .admin-link {
    justify-self: start;
  }

  .hero-product {
    justify-items: center;
  }

  .product-showcase,
  .order-grid,
  .product-catalog,
  .trust-strip {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .hero-stack {
    min-height: 420px;
  }

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    gap: 14px;
    padding: 14px 16px;
  }

  .brand {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
  }

  .brand-logo {
    width: 124px;
  }

  .nav {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-button,
  .secondary-button,
  .danger-button {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
    text-align: center;
  }

  .sidebar-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    margin-top: 0;
  }

  .dashboard-grid,
  .management-grid,
  .two-col,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .month-totals {
    grid-template-columns: 1fr;
  }

  .product-line {
    grid-template-columns: minmax(280px, 1fr) minmax(90px, 0.35fr) minmax(90px, 0.35fr) minmax(112px, 0.42fr);
  }
}

@media (max-width: 640px) {
  .site-nav {
    gap: 12px;
  }

  .site-logo img {
    width: 132px;
  }

  .site-hero {
    min-height: auto;
  }

  .about-points,
  .product-showcase,
  .order-grid,
  .product-catalog,
  .quality-list,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .hero-stack {
    min-height: 330px;
  }

  .hero-side-pack {
    display: none;
  }

  .product-showcase article {
    grid-template-rows: 190px auto auto;
  }

  .site-footer {
    flex-direction: column;
  }

  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .status-pill {
    min-width: 0;
    width: 100%;
    border-radius: 8px;
  }

  .nav,
  .sidebar-actions,
  .form,
  .segment-row,
  .sales-stock-header,
  .payment-split,
  .invoice-preview {
    grid-template-columns: 1fr;
  }

  .product-line {
    grid-template-columns: 1fr 1fr 1fr;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;
  }

  .product-line .product-check {
    grid-column: 1 / -1;
  }

  .product-check span {
    grid-template-columns: 64px 86px minmax(0, 1fr);
    min-height: 104px;
  }

  .product-stock-badge {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    font-size: 21px;
  }

  .product-stock-stack {
    width: 58px;
  }

  .product-stock-stack .product-stock-badge {
    width: 58px;
    height: 44px;
    font-size: 16px;
  }

  .product-thumb {
    width: 86px;
    height: 86px;
  }

  .source-choice {
    grid-column: 1 / -1;
  }

  .source-options span,
  .source-empty {
    flex: 1 1 140px;
    justify-content: center;
    text-align: center;
  }

  .month-header {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .expense-month-header {
    grid-template-columns: 1fr;
  }

  .summary-band,
  .product-band {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    margin-inline: -2px;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 9px 8px;
    font-size: 12px;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions button {
    flex: 1;
    text-align: center;
  }
}

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

  .brand-logo {
    width: 108px;
  }

  .brand p {
    font-size: 12px;
  }

  .nav-button,
  .secondary-button,
  .danger-button,
  .primary-button,
  .ghost-button {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .card-header,
  .form,
  .invoice-form {
    padding: 14px;
  }

  .product-line {
    grid-template-columns: 1fr;
  }

  .product-check span {
    grid-template-columns: 58px 78px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .product-stock-badge {
    width: 52px;
    height: 52px;
    font-size: 19px;
  }

  .product-stock-stack {
    width: 52px;
  }

  .product-stock-stack .product-stock-badge {
    width: 52px;
    height: 40px;
    font-size: 15px;
  }

  .product-thumb {
    width: 78px;
    height: 78px;
  }

  .summary-band,
  .product-band {
    grid-template-columns: 1fr;
  }

  .expense-category-strip > span:not(.band-title) {
    min-width: 100%;
  }
}
