:root {
  --font-display: "Fraunces", "Palatino Linotype", Palatino, serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
  --ink: #102a32;
  --muted: #5e7178;
  --cream: #f3eee6;
  --card: #fffaf4;
  --line: rgba(16, 42, 50, 0.1);
  --teal: #0f6e6b;
  --teal-deep: #0b4f4d;
  --coral: #e15a3a;
  --gold: #e2a63b;
  --indigo: #315f9a;
  --sidebar: 272px;
  --shadow: 0 18px 50px rgba(16, 42, 50, 0.08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; }

:focus { outline: none; }

:focus-visible {
  outline: 3px solid #c4841d;
  outline-offset: 2px;
}

h1, h2, .display, .stat strong, .formula-large strong, .type-tile strong {
  font-family: var(--font-display);
  font-weight: 560;
  letter-spacing: -0.03em;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: white;
  color: var(--ink);
  padding: 8px 12px;
  z-index: 80;
  border-radius: 10px;
}

.skip:focus { top: 12px; }

.login-body {
  min-height: 100vh;
  background: #102a32;
}

.login-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #12343c;
}

.login-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 24, 28, 0.08) 0%, rgba(8, 24, 28, 0.18) 38%, rgba(8, 24, 28, 0.88) 100%);
}

.login-copy {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 72px);
  color: #f7f2ea;
}

.display {
  margin: 0;
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 0.96;
  max-width: 11ch;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
}

.eyebrow.light, .hero-band .eyebrow { color: #f0c15a; }

.login-formula {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 22px 0 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: fit-content;
}

.login-formula span {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.login-points li {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 24, 28, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 14px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  background:
    radial-gradient(500px 240px at 100% 0%, rgba(225, 90, 58, 0.16), transparent 60%),
    radial-gradient(420px 220px at 0% 100%, rgba(15, 110, 107, 0.16), transparent 55%),
    var(--cream);
}

.login-card {
  width: min(440px, 100%);
  background: var(--card);
  border-radius: 28px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 70px rgba(16, 42, 50, 0.16);
  position: relative;
}

.panel-form {
  background-color: var(--card);
  background-image: linear-gradient(90deg, #e36a4c, #e2a63b, #1f8a78, #4d7ec0);
  background-size: 100% 5px;
  background-repeat: no-repeat;
}

.login-card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 5px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #e36a4c, #e2a63b, #1f8a78, #4d7ec0);
}

.login-card h1 {
  margin: 22px 0 8px;
  font-size: 3rem;
  line-height: 1;
}

.lede {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 46rem;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 14px;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-text small {
  display: block;
  margin-top: 4px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark svg { width: 26px; height: 26px; }

.brand.on-light { color: var(--ink); }
.brand.on-light .brand-text small { color: var(--muted); }
.brand.on-light .brand-mark { background: var(--ink); border-color: transparent; }

.stack { display: grid; gap: 14px; margin-top: 22px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field select,
.field textarea,
.filters input,
.filters select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(16, 42, 50, 0.12);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
}

.field textarea { min-height: 96px; resize: vertical; padding-top: 12px; }

.date-field { position: relative; }
.date-field [data-date-text] { padding-right: 46px; }
.date-field .date-native {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
.date-field .date-native::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 12px;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  opacity: 0.75;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filters input:focus,
.filters select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 110, 107, 0.12);
}

.upper { text-transform: uppercase; }
.upper::placeholder { text-transform: none; }

input[readonly] {
  background: #f3eee7;
  color: #3e555c;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  font-weight: 700;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23102a32' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}

::placeholder { color: #8aa0a6; }

.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 76px; }

.password-field button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.id-field { position: relative; }
.id-field span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8a6a32;
  background: #f8e7c4;
  border-radius: 999px;
  padding: 4px 8px;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #c4452c; }

.field-error {
  margin: 6px 0 0;
  color: #a33b28;
  font-size: 13px;
}

.banner {
  padding: 12px 14px;
  border-radius: 14px;
  margin: 16px 0 0;
}

.banner-error { background: #fde8e2; color: #8d2f1e; }
.banner-success { background: #e5f4ef; color: #0d5348; }
.banner a { color: inherit; font-weight: 700; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(180deg, #1a6b66, #0e4e4b);
  color: #f6f1ea;
  box-shadow: 0 10px 20px rgba(14, 78, 75, 0.18);
}

.btn-primary:hover { background: linear-gradient(180deg, #22867f, #12615d); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(16, 42, 50, 0.14);
}

.btn-ghost:hover { background: rgba(16, 42, 50, 0.04); }

.btn-danger {
  background: #fff1ec;
  color: #a33b28;
}

.btn-danger:hover { background: #fde0d8; }

.btn-small { padding: 8px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.app-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(225, 90, 58, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at -10% 100%, rgba(15, 110, 107, 0.1), transparent 46%),
    radial-gradient(ellipse 40% 30% at 80% 110%, rgba(226, 166, 59, 0.14), transparent 40%),
    var(--cream);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 16px;
  color: #f6f1ea;
  background: linear-gradient(180deg, #102a32 0%, #0d3c42 58%, #123f38 100%);
}

.sidebar .brand {
  display: block;
  padding: 0 4px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand-logo {
  width: auto;
  max-width: 100%;
  max-height: 112px;
  margin: 0 auto;
}

.login-card .brand {
  display: block;
}

.login-card .brand-logo {
  max-width: 320px;
  margin: 0 auto;
}

.sidebar .brand-text small { color: rgba(246, 241, 234, 0.66); }

.side-nav { display: grid; align-content: start; }

.nav-group {
  margin: 18px 10px 8px;
  color: rgba(246, 241, 234, 0.48);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 12px;
  border-radius: 14px;
  color: rgba(246, 241, 234, 0.88);
  text-decoration: none;
  font-weight: 600;
}

.nav-link svg { width: 20px; height: 20px; flex: none; }

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-link.active { box-shadow: inset 3px 0 0 var(--gold); }

.side-foot { margin-top: auto; padding-top: 18px; }

.who-block {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 6px 12px;
}

.who-block strong, .who-block small { display: block; }
.who-block small { color: rgba(246, 241, 234, 0.62); font-size: 13px; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #e2a63b;
  color: #2a2112;
  font-weight: 700;
}

.sign-out {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.sign-out:hover { background: rgba(255, 255, 255, 0.14); }

.app-main { min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(243, 238, 230, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(16, 42, 50, 0.06);
}

.topbar-kicker { margin: 0; font-weight: 700; }
.topbar-spacer { flex: 1; }
.today, .who, .formula-chip { margin: 0; }

.today, .who { color: var(--muted); font-size: 14px; }
.who { color: var(--ink); font-weight: 700; }

.formula-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(16, 42, 50, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.formula-chip span {
  color: var(--teal-deep);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
}

.icon-btn svg { width: 20px; height: 20px; }

.nav-backdrop { display: none; }

.content {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 1.02;
}

.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-band {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 0;
  background: #102a32;
  color: #f6f1ea;
  border-radius: 28px;
  overflow: hidden;
  min-height: 300px;
  margin-bottom: 18px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 36px;
}

.mill-quote {
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 3px solid #f0c15a;
}

.mill-quote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.25;
  color: #f7f2ea;
}

.hero-band h2 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.05;
  color: #f7f2ea;
}

.hero-band p { color: rgba(247, 242, 234, 0.84); margin: 0; }

.formula-large {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 22px 0 0;
}

.formula-large span {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: rgba(247, 242, 234, 0.7);
}

.formula-large strong {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: #f0c15a;
  line-height: 1;
}

.hero-photo { position: relative; min-height: 280px; }

.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  border-radius: 24px;
  padding: 20px;
  color: #f7f2ea;
  transition: transform 0.18s ease;
}

a.stat { text-decoration: none; display: block; }
a.stat:hover { transform: translateY(-3px); }

.stat::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  right: -36px;
  bottom: -48px;
  background: rgba(255, 255, 255, 0.14);
}

.stat p {
  position: relative;
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.82;
}

.stat strong {
  position: relative;
  display: block;
  margin: 16px 0 8px;
  font-size: 3rem;
  line-height: 0.9;
}

.stat span {
  position: relative;
  display: block;
  max-width: 18ch;
  font-size: 14px;
}

.stat.teal { background: linear-gradient(145deg, #14918a, #0b4f4d); }
.stat.coral { background: linear-gradient(145deg, #ef7a58, #c4452c); }
.stat.gold { background: linear-gradient(145deg, #f0c15a, #c4841d); color: #2a2112; }
.stat.indigo { background: linear-gradient(145deg, #4d7ec0, #274e86); }
.stat.plum { background: linear-gradient(145deg, #a86b80, #6d3a4c); }
.stat.navy { background: linear-gradient(145deg, #1d4e89, #16324f); }

.stat p.wide-label {
  letter-spacing: 0.04em;
  line-height: 1.35;
  max-width: 22ch;
}

.report-fields {
  display: grid;
  grid-template-columns: 180px 180px minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.report-fields.stock-fields {
  grid-template-columns: minmax(280px, 520px) auto;
}

.stock-table {
  max-width: 640px;
}

.report-fields .field,
.report-actions {
  min-height: 0;
}

.report-fields .picker-button,
.report-fields .field input {
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
}

.report-actions {
  display: flex;
  gap: 10px;
  height: 48px;
  align-items: center;
}

.report-filters .hint {
  margin: 12px 0 0;
}

.report-sheet {
  margin-top: 18px;
  background: #fffdf9;
  border: 1px solid rgba(16, 42, 50, 0.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 26px 22px;
}

.report-banner {
  margin-bottom: 18px;
}

.report-banner h2 {
  margin: 4px 0 6px;
  font-size: 1.8rem;
}

.report-banner p:last-child {
  margin: 0;
  color: var(--teal);
  font-weight: 700;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table.receive-back-table th,
.report-table.receive-back-table td { padding: 12px 8px; }

@media print {
  .report-sheet.wide-report { break-inside: auto; }
  .report-table.receive-back-table {
    min-width: 0;
    font-size: 11px;
  }
  .report-table.receive-back-table th,
  .report-table.receive-back-table td { padding: 5px 4px; }
}

.report-table th,
.report-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(16, 42, 50, 0.08);
}

.report-table th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.report-table .num,
.report-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-table tfoot td {
  border-bottom: 0;
  border-top: 2px solid #16324f;
  font-weight: 700;
  font-size: 1.05rem;
  color: #16324f;
}

@media print {
  .sidebar,
  .topbar,
  .report-filters,
  .page-head,
  .skip,
  .nav-backdrop,
  .flash {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .content {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .report-sheet {
    box-shadow: none;
    border: 0;
    margin: 0;
    padding: 0;
  }
}

.product-stat-name {
  letter-spacing: 0.06em;
  line-height: 1.35;
  max-width: 16ch;
}

.dash-grid, .split {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.dash-grid { grid-template-columns: 0.85fr 1.25fr; }

.split { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }

.panel {
  background: rgba(255, 250, 244, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel-form {
  border-radius: 24px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow);
}

.list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.list-head h2 { margin: 0; font-size: 1.7rem; }
.list-head p, .list-head a { margin: 0; color: var(--muted); }
.list-head a { font-weight: 700; color: var(--teal-deep); text-decoration: none; }

.type-tiles { display: grid; gap: 12px; margin-top: 14px; }

.type-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 16px 18px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(16, 42, 50, 0.06);
}

.type-tile strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-size: 2rem;
  line-height: 1;
}

.type-tile small { color: var(--muted); }
.type-tile.teal { box-shadow: inset 5px 0 0 #0f6e6b; }
.type-tile.coral { box-shadow: inset 5px 0 0 #e15a3a; }
.type-tile.gold { box-shadow: inset 5px 0 0 #c4841d; }
.type-tile.indigo { box-shadow: inset 5px 0 0 #315f9a; }
.type-tile.plum { box-shadow: inset 5px 0 0 #8a4d62; }
.type-tile:hover { transform: translateY(-2px); }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.filters input, .filters select { flex: 1 1 180px; width: auto; }
.filters .btn { flex: 0 0 auto; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }

table { width: 100%; border-collapse: collapse; min-width: 680px; }

th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  font-weight: 700;
}

td {
  padding: 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

th.right, td.right { text-align: right; }
tr.is-current { background: rgba(15, 110, 107, 0.07); }

.num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.account-name { font-weight: 700; letter-spacing: 0.02em; }

.sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  max-width: 36ch;
}

.table-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.table-link:hover { color: var(--teal-deep); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(15, 110, 107, 0.12);
  color: #0b4f4d;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill-coral { background: rgba(225, 90, 58, 0.12); color: #9a341f; }
.pill-gold { background: rgba(196, 132, 29, 0.16); color: #8a5a10; }
.pill-indigo { background: rgba(49, 95, 154, 0.12); color: #234572; }
.pill-plum { background: rgba(138, 77, 98, 0.14); color: #6d3a4c; }

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.actions form { margin: 0; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.empty { padding: 28px 8px 12px; text-align: center; }
.empty p { color: var(--muted); margin: 0 0 14px; }

.flash {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.flash p { margin: 0; }
.flash-success { background: #e5f4ef; color: #0d5348; }
.flash-error { background: #fde8e2; color: #8d2f1e; }
.flash.is-leaving { opacity: 0; transform: translateY(-6px); }

.flash button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

dialog {
  border: 0;
  padding: 0;
  border-radius: 24px;
  width: min(440px, calc(100% - 32px));
  box-shadow: 0 24px 80px rgba(16, 42, 50, 0.28);
}

dialog::backdrop { background: rgba(16, 42, 50, 0.48); }

.dialog-card { padding: 24px; background: var(--card); }
.dialog-card h2 { margin: 0 0 8px; font-size: 1.8rem; }
.dialog-card p { margin: 0 0 18px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.product-sheet {
  display: grid;
  gap: 18px;
}

.product-search {
  margin: 0;
}

.receive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.receive-main { min-width: 0; }

.receive-receipt { grid-column: 1; grid-row: 1; }

.design-lines {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

.receive-head {
  display: grid;
  grid-template-columns: 160px 190px minmax(220px, 1fr);
  gap: 14px;
  align-items: start;
}

.receive-head.with-bill {
  grid-template-columns: 156px 214px minmax(148px, 176px) minmax(0, 1fr);
}

.receive-list { margin-top: 18px; }

.detail-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.line-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
}

.line-remove {
  border: 0;
  background: transparent;
  padding: 0;
  color: #c4452c;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.line-remove:hover { color: #8d2f1e; }

.lines-wrap { overflow: visible; }

.detail-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.detail-table .col-product { width: 42%; }
.detail-table .col-design { width: 22%; }
.detail-table .col-qty { width: 14%; }
.detail-table .col-actions { width: 22%; }

.detail-table.issue-table { min-width: 860px; }
.detail-table.issue-table th { white-space: nowrap; }
.detail-table.issue-table .col-product { width: 34%; }
.detail-table.issue-table .col-design { width: 18%; }
.detail-table.issue-table .col-available { width: 14%; }
.detail-table.issue-table .col-issue { width: 14%; }
.detail-table.issue-table .col-actions { width: 20%; }

.detail-table.shop-table { min-width: 1080px; }
.detail-table.shop-table th { white-space: nowrap; }
.detail-table.shop-table .col-product { width: 24%; }
.detail-table.shop-table .col-design { width: 14%; }
.detail-table.shop-table .col-article { width: 18%; }
.detail-table.shop-table .col-available { width: 12%; }
.detail-table.shop-table .col-issue { width: 12%; }
.detail-table.shop-table .col-actions { width: 20%; }

.detail-table.return-table { min-width: 980px; }
.detail-table.return-table th { white-space: nowrap; }
.detail-table.return-table .col-product { width: 26%; }
.detail-table.return-table .col-design { width: 14%; }
.detail-table.return-table .col-issued { width: 12%; }
.detail-table.return-table .col-received { width: 14%; }
.detail-table.return-table .col-pending { width: 14%; }
.detail-table.return-table .col-receive { width: 20%; }

.detail-table th,
.detail-table td {
  vertical-align: middle;
  padding: 10px 12px 10px 0;
}

.detail-table th:first-child,
.detail-table td:first-child { padding-left: 6px; }

.detail-table th:last-child,
.detail-table td:last-child { padding-right: 6px; }

.detail-line .picker { width: 100%; }

.detail-line .picker-button,
.detail-line input {
  display: block;
  width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid rgba(16, 42, 50, 0.12);
  border-radius: 14px;
  background-color: #fff;
  padding: 0 14px;
  color: var(--ink);
  line-height: 46px;
}

.detail-line .picker-button {
  padding-right: 40px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-line input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 110, 107, 0.12);
  outline: none;
}

.qty-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 92px;
  align-self: start;
  z-index: 6;
  height: max-content;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 28px;
  padding: 22px;
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(240, 193, 90, 0.35), transparent 60%),
    linear-gradient(165deg, #9a341f, #c4452c 55%, #7a241c);
  color: #fff6f2;
  box-shadow: 0 18px 40px rgba(154, 52, 31, 0.28);
}

.qty-panel p {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: #f0c15a;
}

.qty-panel strong {
  display: block;
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 5vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: #fffaf4;
}

.qty-panel span {
  display: block;
  max-width: 16ch;
  color: rgba(255, 246, 242, 0.86);
  font-size: 14px;
}

.qty-panel.issue-total {
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(240, 193, 90, 0.28), transparent 60%),
    linear-gradient(165deg, #1d4e89, #16324f 58%, #10283f);
  box-shadow: 0 18px 40px rgba(22, 50, 79, 0.32);
}

.qty-panel.return-total {
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(240, 193, 90, 0.4), transparent 60%),
    linear-gradient(165deg, #0f6e6b, #0c4f55 55%, #16324f);
  box-shadow: 0 18px 40px rgba(15, 110, 107, 0.28);
}

.loaded-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-top: 8px;
}

.loaded-facts p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(16, 42, 50, 0.04);
}

.loaded-facts span {
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
}

.line-read {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 600;
}

.issue-table { min-width: 980px; }

.available-stock,
.pending-stock {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.available-stock { color: #c4452c; }

.pending-stock { color: #16324f; }

.picker { position: relative; }

.picker-button {
  width: 100%;
  min-height: 48px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(16, 42, 50, 0.12);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23102a32' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  padding: 12px 40px 12px 14px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}

.picker-button.is-empty { color: #8aa0a6; }

.field.has-error .picker-button { border-color: #c4452c; }

.picker-panel {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(16, 42, 50, 0.18);
  border: 1px solid rgba(16, 42, 50, 0.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-panel[hidden] { display: none; }

.picker-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(16, 42, 50, 0.12);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  color: var(--ink);
}

.picker-options {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  max-height: 220px;
}

.picker-choice {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.picker-choice:hover,
.picker-choice:focus-visible,
.picker-choice.is-active {
  background: rgba(15, 110, 107, 0.16);
}

.picker-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .receive-layout { grid-template-columns: 1fr; }
  .receive-receipt,
  .qty-panel,
  .design-lines {
    grid-column: 1;
    grid-row: auto;
  }
  .qty-panel { position: static; }
  .receive-head,
  .receive-head.with-bill { grid-template-columns: 1fr; }
  .report-fields,
  .report-fields.stock-fields { grid-template-columns: 1fr; }
  .report-actions { flex-wrap: wrap; }
}

.product-line {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1.6fr) minmax(120px, 0.8fr) minmax(130px, 0.7fr) auto;
  gap: 14px;
  align-items: start;
}

.product-line .form-actions {
  padding-top: 28px;
}

.product-line .field input,
.product-line .id-field input {
  min-width: 0;
}

@media (min-width: 1101px) {
  .panel-form { position: sticky; top: 86px; }
  .panel-form.product-entry { position: static; }
}

@media (max-width: 980px) {
  .product-line {
    grid-template-columns: 1fr 1fr;
  }
  .product-line .form-actions {
    padding-top: 0;
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .product-line { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .stats, .dash-grid, .split, .hero-band, .login-stage { grid-template-columns: 1fr; }
  .login-visual { min-height: 52vh; }
  .login-panel { min-height: auto; }
  .hero-photo { min-height: 220px; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(16, 42, 50, 0.46);
  }
  .page-head { flex-direction: column; align-items: flex-start; }
  .stats { grid-template-columns: 1fr 1fr; }
  .who { display: none; }
}

@media (max-width: 720px) {
  .today, .formula-chip { display: none; }
  .content { width: calc(100% - 28px); }
  .topbar { padding: 14px 16px; }
  .login-card { padding: 28px 20px 22px; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
