:root {
  --ink: #18212f;
  --muted: #667085;
  --line: #d9dee8;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --brand: #096b68;
  --brand-dark: #075754;
  --accent: #d85d2f;
  --ok: #147a45;
  --bad: #b8332a;
  --shadow: 0 16px 40px rgba(22, 33, 49, .09);
}

html { font-size: 14px; position: relative; min-height: 100%; }

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(9, 107, 104, .10), transparent 300px), var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a { color: var(--brand); }

.container { max-width: none; padding: 0; }
main[role="main"] { padding: 0 !important; }
.navbar,
.footer { display: none; }

.shell {
  width: min(1560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

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

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #0d887c);
  box-shadow: var(--shadow);
  font-weight: 800;
}

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

h1 {
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-block p,
.panel-head span,
.metric-card span,
.metric-card small,
.product-card-head span,
.stock-counts span {
  color: var(--muted);
}

.brand-block p { margin-bottom: 0; font-size: 13px; }

.ghost-button,
.primary-button,
.danger-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
}

.ghost-button:hover { border-color: #aeb8c8; color: var(--ink); }

.primary-button {
  width: 100%;
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

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

.danger-button {
  width: 100%;
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.danger-button:hover { background: #bd4e27; }

.notice {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.notice.success { color: var(--ok); border-color: rgba(20, 122, 69, .25); }
.notice.error { color: var(--bad); border-color: rgba(184, 51, 42, .25); }
.notice ul { margin-bottom: 0; }

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

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(22, 33, 49, .06);
}

.metric-card {
  min-height: 104px;
  padding: 15px;
}

.metric-card span,
.metric-card small {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.metric-card small { margin-top: 8px; font-weight: 500; }

.panel { margin-bottom: 18px; overflow: hidden; }

.panel-head {
  min-height: 58px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.2;
}

.split-head span { font-size: 12px; }

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

.product-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  min-width: 0;
}

.product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-card-head span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
}

.product-card h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.1;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--ok);
  background: rgba(20, 122, 69, .10);
  font-size: 12px;
  font-weight: 800;
}

.card-badge.neutral {
  color: #516071;
  background: #eef2f7;
}

.stock-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stock-counts div {
  background: var(--soft);
  border: 1px solid #e4e8f0;
  border-radius: 8px;
  padding: 10px;
}

.stock-counts span {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.stock-counts strong { font-size: 22px; }

.card-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.mini-form {
  display: grid;
  gap: 8px;
  border: 1px solid #e4e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.mini-entry { border-top: 3px solid var(--brand); }
.mini-exit { border-top: 3px solid var(--accent); }

.mini-title {
  font-size: 13px;
  font-weight: 900;
  color: #485467;
}

.create-product-panel {
  background: #fff;
}

.create-product-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  padding: 14px;
  align-items: center;
}

.create-product-form .primary-button {
  width: auto;
  min-width: 160px;
}

.product-empty {
  grid-column: 1 / -1;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compact input,
.mini-form input,
.mini-form select,
.filters input,
.filters select,
textarea {
  min-width: 0;
}

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

textarea { min-height: 76px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(9, 107, 104, .13);
}

.field-validation-error,
.field span { color: var(--bad); font-size: 12px; }

.filters {
  display: grid;
  grid-template-columns: 1.1fr .7fr .8fr auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.table-scroll {
  overflow: auto;
  max-height: 480px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #4b5566;
  background: #f8fafc;
  font-size: 12px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 28px 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 54px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill-in { color: var(--ok); background: rgba(20, 122, 69, .10); }
.pill-out { color: var(--bad); background: rgba(184, 51, 42, .10); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.manage-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.card-state-form {
  display: flex;
  justify-content: flex-end;
}

.warning-action {
  color: var(--bad);
  border-color: rgba(184, 51, 42, .28);
}

.is-closed {
  background: #f7f8fb;
}

.is-closed .stock-counts,
.is-closed .product-card-head {
  opacity: .72;
}

.closed-note {
  border: 1px dashed #c4cad6;
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}
@media (max-width: 1320px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

@media (max-width: 920px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-forms { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 18px, 1560px);
    padding-top: 10px;
  }

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

  h1 { font-size: 21px; }

  .top-actions,
  .top-actions .ghost-button { width: 100%; }
  .metrics,
  .filters,
  .two-col,
  .create-product-form,
  .manage-form { grid-template-columns: 1fr; }

  .create-product-form .primary-button {
    width: 100%;
  }
}



